/** * Return maximum allowed quantity * * @return integer */ protected function getMaxQuantity() { return $this->getProductVariant() && !$this->getProductVariant()->getDefaultAmount() ? $this->getProductVariant()->getAvailableAmount() : parent::getMaxQuantity(); }
/** * Check if the product has wholesale price * * @return boolean */ protected function hasWholesalePrice() { return $this->getProductVariant() && !$this->getProductVariant()->getDefaultPrice() ? \XLite\Core\Database::getRepo('XLite\\Module\\CDev\\Wholesale\\Model\\ProductVariantWholesalePrice')->hasWholesalePrice($this->getProductVariant()) : parent::hasWholesalePrice(); }
/** * Define the CSS classes * * @return string */ protected function getCSSClass() { return parent::getCSSClass() . ($this->hasWholesalePrice() ? ' wholesale-price-defined' : ''); }