on ‎2018 Apr 30 10:35 AM
Hi All,
I have a requirement , where user would be able to switch between currencies. can you please let me know how to recalculate cart & return response of Getcart in the new currency that's being switched
Thanks
Request clarification before answering.
I did the same as below:
/**
* Recalculates cart when currency has changed
*/
protected void recalculateCart(final String currencyString) throws RecalculationException
{
if (getCartService().hasSessionCart())
{
final CartModel cart = getCartService().getSessionCart();
if (cart != null)
{
try
{
getCalculationService().recalculate(cart);
}
catch (final CalculationException e)
{
throw new RecalculationException(e, YSanitizer.sanitize(currencyString));
}
}
}
}
After that get the session cart.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.