Ejemplo n.º 1
0
 public function getProduct()
 {
     $product = parent::getProduct();
     $this->_confProduct = $product;
     $product = Mage::helper('amconf')->getSimpleProductWithMinPrice($product);
     return $product;
 }
Ejemplo n.º 2
0
 public function getProduct()
 {
     $product = parent::getProduct();
     $this->_confProduct = $product;
     if (Mage::getStoreConfig('amconf/general/display_price')) {
         $product = Mage::helper('amconf')->getSimpleProductWithMinPrice($product);
     }
     return $product;
 }
Ejemplo n.º 3
0
 public function getProduct()
 {
     if (!$this->helper('customerprices')->isEnabled()) {
         return parent::getProduct();
     }
     $product = $this->_getData('product');
     if (!$product) {
         $product = Mage::registry('product');
     }
     $prices = Mage::getModel('customerprices/prices');
     $price = $prices->getProductPrice($product);
     $specialPrice = $prices->getProductSpecialPrice($product);
     if ($price && $price > 0) {
         $product->setFinalPrice($price);
         $product->setPrice($price);
     }
     if ($specialPrice && $specialPrice > 0) {
         $product->setFinalPrice($specialPrice);
         $product->setSpecialPrice($specialPrice);
     } else {
         $product->setFinalPrice($product->getSpecialPrice());
     }
     return $product;
 }
Ejemplo n.º 4
0
 /**
  * Retrieve current product model
  *
  * @return TBT_Rewards_Model_Catalog_Product
  */
 public function getProduct()
 {
     if (!$this->isEnabled()) {
         return parent::getProduct();
     }
     if ($this->_product == null) {
         $p = $this->_getData('product');
         if (empty($p)) {
             $p = Mage::registry('product');
         }
         if (!empty($p)) {
             if ($p instanceof TBT_Rewards_Model_Catalog_Product) {
                 $this->_product = $p;
             } else {
                 $this->_product = Mage::getModel('rewards/catalog_product')->load($p->getId());
             }
             Mage::unregister('product');
             Mage::register('product', $this->_product);
         } else {
             $this->_product = Mage::getModel('rewards/catalog_product');
         }
     }
     return $this->_product;
 }
Ejemplo n.º 5
0
 public function getProduct()
 {
     $sarpProduct = parent::getProduct();
     if ($sarpProduct->getAwSarpEnabled() && Mage::helper('sarp')->isSubscriptionType($sarpProduct) && $sarpProduct->getTypeInstance()->getDefaultSubscriptionPeriodId() != AW_Sarp_Model_Period::PERIOD_TYPE_NONE) {
         $newPrice = Mage::helper('sarp')->getSarpSubscriptionPrice($sarpProduct);
         if (!is_null($sarpProduct->getData('price'))) {
             $sarpProduct->setPrice($newPrice);
         }
         if (!is_null($sarpProduct->getData('final_price'))) {
             $sarpProduct->setFinalPrice($newPrice);
         }
         if (!is_null($sarpProduct->getData('minimal_price'))) {
             $sarpProduct->setMinimalPrice($newPrice);
         }
     }
     return $sarpProduct;
 }
Ejemplo n.º 6
0
 /**
  * For a given product price block check if the product is active
  *  - if it is active then set the price html as the default message
  *
  * @param Mage_Catalog_Block_Product_Price $oBlock
  * @param Varien_Object $oTransport
  */
 protected function transformPriceBlock($oBlock, $oTransport)
 {
     $oProduct = $oBlock->getProduct();
     $iCurrentProductId = $oProduct->getId();
     if ($this->oB2BHelper->isProductActive($oProduct) === false) {
         // To stop duplicate information being displayed validate that we only do this once per product
         if ($iCurrentProductId !== self::$iLastProductId) {
             self::$iLastProductId = $iCurrentProductId;
             $oTransport->setHtml($this->oB2BHelper->getLoginMessage());
         } else {
             $oTransport->setHtml('');
         }
         $this->setSymmetricsProductType($oProduct);
     }
 }
Ejemplo n.º 7
0
 public function getProduct()
 {
     $product = parent::getProduct();
     $sarpProduct = Mage::getModel('catalog/product')->load($product->getId());
     if ($sarpProduct->getAwSarpEnabled() && Mage::helper('sarp')->isSubscriptionType($product) && ($sarpProduct->getAwSarpPeriod() != AW_Sarp_Model_Period::PERIOD_TYPE_NONE || !is_numeric($sarpProduct->getAwSarpPeriod()))) {
         $newPrice = Mage::helper('sarp')->getSarpSubscriptionPrice($sarpProduct);
         if (!is_null($sarpProduct->getData('price'))) {
             $sarpProduct->setPrice($newPrice);
         }
         if (!is_null($sarpProduct->getData('final_price'))) {
             $sarpProduct->setFinalPrice($newPrice);
         }
         if (!is_null($sarpProduct->getData('minimal_price'))) {
             $sarpProduct->setMinimalPrice($newPrice);
         }
     }
     return $sarpProduct;
 }