Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By dirtydog6921 on
Hello!
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!
Comments
Why You Need JS?
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
http://api.drupalcommerce.org/api/Drupal%20Commerce
There is also a provided
There is also a provided block to show the shopping cart.
I know,but the boost module
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.
Boost only works for
---removed---
Or the other idea is : Can i
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?