From c769a2599c9e1662dce6492d11042c35175e9b39 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 3 Dec 2012 15:23:25 +0100 Subject: [PATCH] [-] BO : fixed bug when toggle status on product listing, redirect_type was not good --- classes/Product.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index 127212156..88d789415 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -658,7 +658,26 @@ class ProductCore extends ObjectModel return parent::validateFieldsLang($die, $error_return); } - + + public function toggleStatus() + { + //test if the product is active and if redirect_type is empty string and set default value to id_product_redirected & redirect_type + // /!\ after parent::toggleStatus() active will be false, that why we set 404 by default :p + if ($this->active) + { + //case where active will be false after parent::toggleStatus() + $this->id_product_redirected = 0; + $this->redirect_type = '404'; + } + else + { + //case where active will be true after parent::toggleStatus() + $this->id_product_redirected = 0; + $this->redirect_type = ''; + } + return parent::toggleStatus(); + } + public function delete() { /*