diff --git a/override/classes/Product.php b/override/classes/Product.php index 876bb925..4240027d 100644 --- a/override/classes/Product.php +++ b/override/classes/Product.php @@ -3,6 +3,7 @@ class Product extends ProductCore { public $home_edito; + public $failling_price; public static $products_flashsale; public static $definition = array( @@ -35,6 +36,7 @@ class Product extends ProductCore 'on_sale' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'), 'online_only' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'), 'home_edito' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'), + 'failling_price' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'), 'ecotax' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice'), 'minimal_quantity' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'), 'price' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice', 'required' => true), @@ -187,11 +189,11 @@ class Product extends ProductCore return $this; } - public static function getProductsInFlashsales() + public static function getProductsInFlashsales() { $products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT fsp.`id_product` - FROM '._DB_PREFIX_.'flash_sale_products fsp + SELECT fsp.`id_product` + FROM '._DB_PREFIX_.'flash_sale_products fsp INNER JOIN '._DB_PREFIX_.'flash_sale fs ON (fs.id_flash_sale = fsp.id_flash_sale AND fs.active = 1)' ); diff --git a/override/controllers/admin/AdminProductsController.php b/override/controllers/admin/AdminProductsController.php index 9048dbdc..dda63794 100644 --- a/override/controllers/admin/AdminProductsController.php +++ b/override/controllers/admin/AdminProductsController.php @@ -46,6 +46,10 @@ class AdminProductsController extends AdminProductsControllerCore if ($this->checkMultishopBox('home_edito', $this->context)) { $object->home_edito = (int)Tools::getValue('home_edito'); } + + if ($this->checkMultishopBox('failling_price', $this->context)) { + $object->failling_price= (int)Tools::getValue('failling_price'); + } } if ($this->isTabSubmitted('Prices')) { $object->on_sale = (int)Tools::getValue('on_sale'); diff --git a/override/controllers/admin/templates/products/informations.tpl b/override/controllers/admin/templates/products/informations.tpl index 74c8db2d..5fd23839 100644 --- a/override/controllers/admin/templates/products/informations.tpl +++ b/override/controllers/admin/templates/products/informations.tpl @@ -281,6 +281,11 @@ home_edito}checked="checked"{/if} > {l s='Remonté sur l\'accueil à côté des éditos'} +
+ +
diff --git a/themes/toutpratique/product-list.tpl b/themes/toutpratique/product-list.tpl index 1d11ba4d..ab06c06e 100644 --- a/themes/toutpratique/product-list.tpl +++ b/themes/toutpratique/product-list.tpl @@ -38,6 +38,12 @@ {l s='Nouveau'} + {elseif isset($product.failling_price) && $product.failling_price == 1} + + + {l s='Prix en baisse'} + + {/if}