Beispiel #1
0
 /**
  * We add sale price widget into the default section
  *
  * @param array $params
  * @param array $sections
  */
 public function __construct(array $params = array(), array $sections = array())
 {
     parent::__construct($params, $sections);
     $schema = array();
     $useCustomOgAdded = false;
     foreach ($this->schemaDefault as $name => $value) {
         $schema[$name] = $value;
         if ('description' == $name) {
             $schema['useCustomOG'] = $this->defineCustomOgField();
             $useCustomOgAdded = true;
         }
     }
     if (!$useCustomOgAdded) {
         $schema['useCustomOG'] = $this->defineCustomOgField();
     }
     $this->schemaDefault = $schema;
 }
Beispiel #2
0
 /**
  * Constructor
  *
  * @param array $params   Params   OPTIONAL
  * @param array $sections Sections OPTIONAL
  */
 public function __construct(array $params = array(), array $sections = array())
 {
     parent::__construct($params, $sections);
     $schema = array();
     $isFreeShippingAdded = false;
     foreach ($this->schemaDefault as $name => $value) {
         $schema[$name] = $value;
         if ('shippable' == $name) {
             $schema['freeShip'] = $this->defineFreeShipping();
             $schema['freightFixedFee'] = $this->defineFreightFixedFee();
             $isFreeShippingAdded = true;
         }
     }
     if (!$isFreeShippingAdded) {
         $schema['freeShip'] = $this->defineFreeShipping();
         $schema['freightFixedFee'] = $this->defineFreightFixedFee();
     }
     $this->schemaDefault = $schema;
 }
Beispiel #3
0
 /**
  * We add sale price widget into the default section
  *
  * @param array $params
  * @param array $sections
  */
 public function __construct(array $params = array(), array $sections = array())
 {
     parent::__construct($params, $sections);
     $schema = array();
     $salePriceAdded = false;
     // We insert the sale fields after market price input if the MarketPrice module is on or after the price input.
     $schemaIdToSeek = $this->getSchemaIdToSeek();
     foreach ($this->schemaDefault as $name => $value) {
         $schema[$name] = $value;
         if ($schemaIdToSeek == $name) {
             $schema['sale_price'] = $this->defineSalePriceField();
             $salePriceAdded = true;
         }
     }
     if (!$salePriceAdded) {
         $schema['sale_price'] = $this->defineSalePriceField();
     }
     $this->schemaDefault = $schema;
 }