/** * Get processor class object * * @return null|\XLite\Model\Shipping\Processor\AProcessor */ public function getProcessorObject() { return \XLite\Model\Shipping::getProcessorObjectByProcessorId($this->getProcessor()); }
/** * Returns true if product is restricted in user country * * @return boolean */ public function isRestrictedProduct() { $processorObject = \XLite\Model\Shipping::getProcessorObjectByProcessorId(\XLite\Module\XC\PitneyBowes\Model\Shipping\Processor\PitneyBowes::PROCESSOR_ID); if (!$processorObject->isConfigured() || !\XLite::getController()->getCart()->isPitneyBowesSelected()) { $this->isRestricted = false; } elseif (null === $this->isRestricted) { $this->isRestricted = false; $address = $this->getShippingAddress(); if ($address) { foreach ($this->getRestrictions() as $restriction) { if ($address['country'] === $restriction->getCountry()->getCode()) { $this->isRestricted = true; break; } } } } return $this->isRestricted; }