Пример #1
0
 /**
  * Register the change amount inventory
  *
  * @param integer                                               $orderId Order identifier
  * @param \XLite\Module\XC\ProductVariants\Model\ProductVariant $variant Product variant object
  * @param integer                                               $delta   Inventory delta changes
  *
  * @return void
  */
 public function registerChangeVariantAmount($orderId, $variant, $delta)
 {
     /** @var \XLite\Model\Product $product */
     $product = $variant->getProduct();
     $inventory = $product->getInventory();
     if (!$variant->getDefaultAmount() || $inventory->getEnabled()) {
         $this->registerEvent($orderId, static::CODE_CHANGE_AMOUNT, $this->getOrderChangeAmountDescription($orderId, $delta, $inventory), $this->getOrderChangeAmountData($orderId, $product->getName(), $variant->getPublicAmount() - $delta, $delta));
     }
 }
 /**
  * {@inheritDoc}
  */
 public function getDefaultAmount()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDefaultAmount', array());
     return parent::getDefaultAmount();
 }