Exemple #1
0
 public function initialize()
 {
     // Сбрасываем зарезервированные параметры
     $this->unsetProperty('order_id');
     $this->unsetProperty('product_id');
     $this->unsetProperty('price');
     $this->unsetProperty('currency_id');
     if (!($order_id = $this->modx->basket->getActiveOrderID())) {
         return "Нет активной корзины";
     }
     // else
     $this->setProperty('order_id', $order_id);
     if (!($product_key = (int) $this->getProperty('product_key'))) {
         return 'Не был получен ключ товара';
     }
     $this->setProperties(array("order_product_id" => $product_key));
     return parent::initialize();
 }
Exemple #2
0
 public function initialize()
 {
     $this->setDefaultProperties(array("order_product_id" => $this->getProperty('id')));
     return parent::initialize();
 }