/** * Return true if order item is forced to be 'free shipping' item * * @return boolean */ public function isFreeShipping() { $result = parent::isFreeShipping(); if (!$result && $this->getOrder()->getUsedCoupons()) { foreach ($this->getOrder()->getUsedCoupons() as $coupon) { if (!$coupon->isDeleted() && $coupon->getCoupon()->isFreeShipping() && $coupon->getCoupon()->isValidForProduct($this->getProduct())) { // Product is affected by discount coupon 'FREE SHIPPING' $result = true; break; } } } return $result; }
/** * Return true if order item must be excluded from shipping rates calculations * * @param \XLite\Model\OrderItem $item Order item * * @return boolean */ protected function isIgnoreShippingCalculation($item) { return $item->getObject() && ($item->getObject()->getFreeShip() || $item->isFreeShipping() || $this->isIgnoreProductsWithFixedFee() && 0 < $item->getObject()->getFreightFixedFee()); }
/** * {@inheritDoc} */ public function isFreeShipping() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'isFreeShipping', array()); return parent::isFreeShipping(); }