* @copyright 2019 idnovate.com * @license See above */ class ChangeCurrencyController extends ChangeCurrencyControllerCore { public function initContent() { $currentCurrency = $this->context->currency; $currency = new Currency((int)Tools::getValue('id_currency')); if (Validate::isLoadedObject($currency) && !$currency->deleted) { $this->context->cookie->id_currency = (int)$currency->id; if (Module::isEnabled('quantitydiscountpro')) { include_once(_PS_MODULE_DIR_.'quantitydiscountpro/quantitydiscountpro.php'); $this->context->currency = $currency; $this->context->cart->id_currency = $currency->id; $quantityDiscount = new QuantityDiscountRule(); $quantityDiscount->createAndRemoveRules(); $this->context->currency = $currentCurrency; $this->context->cart->id_currency = $currentCurrency->id; } $this->ajaxDie('1'); } $this->ajaxDie('0'); } }