How can i get the content of the shopping cart with javascript? For example : how many items are in it,the total price etc.
What are the variables what stores the content of the cart? (i need it on front page,products page,categories page).
I use Commerce Kickstart.

I hope u understand my question.
My english is not the best.

Thx the help!


dharani87’s picture

You can Create a custom block and Display the cart Items, qty, total price etc in the block contents.
Go through the Drupal commerce api for Further proceedings


nevets’s picture

There is also a provided block to show the shopping cart.

dirtydog6921’s picture

I know,but the boost module cache the shopping cart block too.
If i write a shopping cart block with javascript,its not cached.

Boost module dont cache js codes.
Thats the reason why i want it in javascript.

Jaypan’s picture


dirtydog6921’s picture

Or the other idea is : Can i load a View with javascript or ajax to a div with id?
-make a block with a div
-in this block is the ajax or javascript code

Have u any idea?