I am trying to modify third-party code that adds a discount and then reloads the cart.
What I want to do is skip reloading the cart and updating the totals via JS.
To be able to do this, I need to pass the updated totals via JSON, and here is my problem:
I know the formatting of the totals is done by rendertotals()
in Mage_Checkout_Block_Cart_Totals
, but how can I access this code?
I can access the cart with Mage::helper('checkout/cart')->getCart()
, and I know there's Mage::helper('checkout/cart')->getCart()->getQuote()->getTotals()
, but this returns an array while I'd like to call the same formatting procedure that is called when the cart is displayed initially to be sure the update procedure is visually compatible.
I guess it's trivial, but I am not yet familiar with the calling syntax of Magentos helpers and singletons.
Thank you for reading!