protected function getOptionBaseValue(\Ess\M2ePro\Model\Listing\Product\Variation\Option $option) { if (!$option->getMagentoProduct()->isStatusEnabled() || !$option->getMagentoProduct()->isStockAvailability()) { return 0; } if ($this->getSource('mode') == \Ess\M2ePro\Model\Template\SellingFormat::QTY_MODE_PRODUCT) { if (!$this->getMagentoProduct()->isStatusEnabled() || !$this->getMagentoProduct()->isStockAvailability()) { return 0; } } return parent::getOptionBaseValue($option); }
protected function getOptionBaseValue(Variation\Option $option) { if ($this->isSourceModeProduct()) { $value = $this->getExistedProductValue($option->getMagentoProduct()); } elseif ($this->isSourceModeSpecial()) { $value = $this->getExistedProductSpecialValue($option->getMagentoProduct()); } elseif ($this->isSourceModeAttribute()) { $value = $option->getMagentoProduct()->getAttributeValue($this->getSource('attribute')); } else { throw new Logic('Unknown Mode in Database.'); } $value < 0 && ($value = 0); return $value; }
protected function getOptionBaseValue(\Ess\M2ePro\Model\Listing\Product\Variation\Option $option) { switch ($this->getSource('mode')) { case \Ess\M2ePro\Model\Template\SellingFormat::QTY_MODE_SINGLE: $value = 1; break; case \Ess\M2ePro\Model\Template\SellingFormat::QTY_MODE_NUMBER: $value = (int) $this->getSource('value'); break; case \Ess\M2ePro\Model\Template\SellingFormat::QTY_MODE_ATTRIBUTE: $value = (int) $option->getMagentoProduct()->getAttributeValue($this->getSource('attribute')); break; case \Ess\M2ePro\Model\Template\SellingFormat::QTY_MODE_PRODUCT_FIXED: $value = (int) $option->getMagentoProduct()->getQty(false); break; case \Ess\M2ePro\Model\Template\SellingFormat::QTY_MODE_PRODUCT: $value = (int) $option->getMagentoProduct()->getQty(true); break; default: throw new \Ess\M2ePro\Model\Exception\Logic('Unknown Mode in Database.'); } return $value; }