Advertisement
giwrgos

Untitled

May 9th, 2018
989
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: giwrgos
  5.  * Date: 19/04/2018
  6.  * Time: 11:06 PM
  7.  */
  8.  
  9. if (!defined('_PS_VERSION_')) {
  10.     exit;
  11. }
  12.  
  13. include_once _PS_MODULE_DIR_ . 'test/library/model/PreorderFlagModel.php';
  14.  
  15. class Product extends ProductCore
  16. {
  17.  
  18.     /** @var boolean isPreorder */
  19.     public $isPreorder;
  20.  
  21.     public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
  22.     {
  23.         $preOrder = (new PreorderFlagModel())->getPreorderFlag($id_product);
  24.         self::$definition['fields']['isPreorder'] =  $preOrder->date === null ? false : $preOrder->date;
  25.         parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement