Richard S Posted July 24, 2012 Share Posted July 24, 2012 Hello, I have a strange with cart being from context. The code below does not work: p($this->context->cart); echo "before"; // id_currency is 1 before echo $this->context->cart->getOrderTotal(true, Cart::BOTH); $this->context->cart->id_currency = 2; $this->context->cart->update(); $amount = number_format($this->context->cart->getOrderTotal(true, 3), 2, '.', ''); p($this->context->cart); echo "amount"; p($amount); so the problem is that I try to change the currency in the cart, it gets changed in DB table too - I can see 2 instead of 1 in id_currency field, bet the amount before and after is the same and it does not get transferred to other currency. Is it me here not seeing something, or is there a problem with these two lines // Define virtual context to prevent case where the cart is not the in the global context $virtual_context = Context::getContext()->cloneContext(); $virtual_context->cart = $this; in Cart class getOrderTotal method? Link to comment Share on other sites More sharing options...
masoud2011 Posted February 1, 2013 Share Posted February 1, 2013 Try to change currency id in this way $this->context->currency->id = 2 Link to comment Share on other sites More sharing options...
joseantgv Posted September 7, 2013 Share Posted September 7, 2013 Same problem here! Link to comment Share on other sites More sharing options...
Ehinarr Posted August 29, 2014 Share Posted August 29, 2014 I had similar problem, but with the creation of vouchers during the choice of payment method, the only solution I found was to make the page to refresh. Without that vouchers were not validated together with the order. Link to comment Share on other sites More sharing options...
Recommended Posts