Trying to work out cart_status AJAX updates

Hey everyone,



Trying to work out “cart_status” AJAX updates and I thought I’d see whether anyone else on here has managed to work it out.



Whenever someone adds an item to their cart, an AJAX request is made and the contents of “cart_status.tpl” are returned with the latest item, subtotal, etc changes.



Updating the cart_status template file directly isn’t any issue.



What I’d like to know is how CS-Cart works it out so that any div with the id of “cart_status” is replaced.



Ultimately I’am wondering whether I could create an addon that updates multiple carts with the latest details in one go and I think figuring out how to point to a differently named div would probably be the first step.



So instead of “cart_status” being replaced, “sidebar_cart_status” is replaced with the contents of “sidebar_cart_status.tpl”.



So is cart working out the “cart_status” auto-magically or is the actual div id stored somewhere?



Any information that any of you guys might have would be really appreciated and that includes even the smalled hints.



Cheers,

  • Marcin

They use what is termed “micro classes”. You will find class names like ‘cm-reload’ that tell the jQuery stuff what to reload and what ajax requests to make on various events. If you can figure it out, my hat’s off to you.

Checkout out the website I worked on:





Epson ink cartridges



Two AJAX carts that with live update. Took a lot of time getting 2 AJAX cart to work properly.