Jump to content

Edit History

Claudia Llana

Claudia Llana

On 5/7/2020 at 4:50 AM, pascal-ld said:

Hi Claudia,

you have to copy the FrontController class to override/classes/controller, let just the init mehtod with this new code on line +/- 306

Regards

Pascal

Ok, you mean that I need to copy this class:

if (Validate::isLoadedObject($cart) && $cart->OrderExists()) { $orderId = Db::getInstance()->getValue('SELECT `id_order` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$cart->id); $hasDetailOrder = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$orderId); if($hasDetailOrder) { PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int)$this->context->cookie->id_cart, true); unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS); $this->context->cookie->check_cgv = false; } }

and place it at override/classes/controller but in which file should I do that? Because that are lots of files inside the folder controller.

Thanks,

Claudia Llana

Claudia Llana

Claudia Llana

On 5/7/2020 at 4:50 AM, pascal-ld said:

Hi Claudia,

you have to copy the FrontController class to override/classes/controller, let just the init mehtod with this new code on line +/- 306

Regards

Pascal

Ok, you mean that I need to copy this class:

if (Validate::isLoadedObject($cart) && $cart->OrderExists()) { $orderId = Db::getInstance()->getValue('SELECT `id_order` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$cart->id); $hasDetailOrder = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$orderId); if($hasDetailOrder) { PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int)$this->context->cookie->id_cart, true); unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS); $this->context->cookie->check_cgv = false; } }

and place it at override/classes/controller but in which file should I do that? Because that are lots of files inside the folder controller.

Thanks,

Claudia Llana

 

 

but where is this front controller class? Where can I find it?

Thanks,

Claudia Llana

Claudia Llana

Claudia Llana

On 5/7/2020 at 4:50 AM, pascal-ld said:

Hi Claudia,

you have to copy the FrontController class to override/classes/controller, let just the init mehtod with this new code on line +/- 306

Regards

Pascal

Ok, but where can I override this method? in which file? 

Thanks,

Claudia Llana

×
×
  • Create New...