protected function _toHtml() { if ($this->config_enabled == 1 && !$this->helper('customer')->isLoggedIn()) { $this->setTemplate('pricehide/price.phtml'); } if (!$this->getProduct() || $this->getProduct()->getCanShowPrice() === false) { return ''; } return parent::_toHtml(); }
/** * Add content of template block below price html if defined in config * * @return string */ public function _toHtml() { $html = trim(parent::_toHtml()); if (empty($html) || !Mage::getStoreConfigFlag('catalog/price/display_block_below_price')) { return $html; } if ($this->getTemplate() != $this->_tierPriceDefaultTemplate) { $html .= $this->getLayout()->createBlock('core/template')->setTemplate('germansetup/price_info.phtml')->setFormattedTaxRate($this->getFormattedTaxRate())->setIsIncludingTax($this->isIncludingTax())->setIsShowShippingLink($this->isShowShippingLink())->toHtml(); } return $html; }
protected function _toHtml() { if (!$this->getProduct() || $this->getProduct()->getCanShowPrice() === false) { return ''; } if (!(!$this->helper('customerprices')->isEnabled() || (!$this->helper('customerprices')->isHidePrice() || $this->helper('customer')->isLoggedIn())) && $this->getTemplate() == 'catalog/product/price.phtml') { return 'You need to <a href="' . Mage::getUrl('customer/account/login') . '">login</a> to see product price<br/>'; } if (!(!$this->helper('customerprices')->isEnabled() || (!$this->helper('customerprices')->isHidePrice() || $this->helper('customer')->isLoggedIn()))) { return ''; } return parent::_toHtml(); }
protected function _toHtml() { $helper = Mage::helper('downloads'); $isCategory = Mage::registry('current_category') && !Mage::registry('current_product'); $toolbar = $this->getLayout()->getBlock('product_list_toolbar'); $isGridMode = $toolbar && $toolbar->getCurrentMode() && $toolbar->getCurrentMode() == 'grid'; $html = parent::_toHtml(); if (!$isCategory || !$helper->isEnabled() || !$helper->isEnableFilesOnCategoryPages() || !$this->getProduct() || !$this->getProduct()->getId()) { return $html; } $filesBlock = $this->getLayout()->createBlock('downloads/product_link', '', array('id' => $this->getProduct()->getId(), 'is_category' => true, 'is_grid_mode' => $isGridMode))->toHtml(); $html .= $filesBlock; return $html; }
public function _toHtml() { $htmlToInsertAfter = '<div class="price-box">'; if ($this->getTemplate() == 'catalog/product/price.phtml') { $product = $this->getProduct(); if (is_object($product) && $product->isConfigurable()) { $extraHtml = '<span class="label" id="configurable-price-from-' . $product->getId() . $this->getIdSuffix() . '"><span class="configurable-price-from-label">' . $this->__('Price From:') . '</span></span>'; $priceHtml = parent::_toHtml(); #manually insert extra html needed by the extension into the normal price html return substr_replace($priceHtml, $extraHtml, strpos($priceHtml, $htmlToInsertAfter) + strlen($htmlToInsertAfter), 0); } } return parent::_toHtml(); }
/** * Convert block to html string * * @return string */ protected function _toHtml() { $product = $this->getProduct(); $isReservation = ITwebexperts_Payperrentals_Helper_Data::getAttributeCodeForId($product->getId(), 'is_reservation'); $typeId = $product->getTypeId(); if ($this->getTemplate() == $this->getTierPriceTemplate()) { return parent::_toHtml(); } if ($typeId == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE || $isReservation != ITwebexperts_Payperrentals_Model_Product_Isreservation::STATUS_DISABLED && $isReservation !== false) { $priceHtml = $this->getLayout()->createBlock("payperrentals/catalog_product_price")->setTemplate('payperrentals/catalog/product/priceppr.phtml')->setProduct($product)->setDisplayMinimalPrice($this->getDisplayMinimalPrice())->setIdSuffix($this->getIdSuffix()); $priceHtml = $priceHtml->toHtml(); return $priceHtml; } return parent::_toHtml(); }
/** * Convert block to html string * * @return string */ protected function _toHtml() { $product = $this->getProduct(); if ($this->getMAPTemplate() && Mage::helper('catalog')->canApplyMsrp($product) && $product->getPriceType() != Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC) { if (Mage::helper('catalog')->isShowPriceOnGesture($product)) { $this->setWithoutPrice(true); } $realPriceHtml = parent::_toHtml(); $this->unsWithoutPrice(); $addToCartUrl = $this->getLayout()->getBlock('product.info.bundle')->getAddToCartUrl($product); $product->setAddToCartUrl($addToCartUrl); $html = $this->getLayout()->createBlock('catalog/product_price')->setTemplate($this->getMAPTemplate())->setRealPriceHtml($realPriceHtml)->setIdSuffix('_clone')->setProduct($product)->toHtml(); return $realPriceHtml . $html; } return parent::_toHtml(); }
public function _toHtml() { if (Mage::getStoreConfig('amconf/general/display_price') && $this->getTemplate() == 'catalog/product/price.phtml') { $product = $this->getProduct(); $product = $this->_confProduct; if (is_object($product) && $product->isConfigurable()) { $priceHtml = parent::_toHtml(); /* add label before*/ $priceTag = '<div class="price-box">'; $labelHtml = $priceTag . '<span class="label configurable-price-from">' . $this->__('Price From:') . ' </span>'; $priceHtml = str_replace($priceTag, $labelHtml, $priceHtml); /*save configurable id*/ preg_match_all("/product-price-([0-9]+)/", $priceHtml, $res); if ($res[0]) { return str_replace($res[0][0], "product-price-" . $product->getId(), $priceHtml); } } } return parent::_toHtml(); }
protected function _toHtml() { $html = parent::_toHtml(); $html = Mage::helper('aitunits/event')->addAfterToHtml($html, $this); return $html; }
protected function _toHtml() { if (Mage::helper('sarp')->extensionEnabled('AW_Maprice')) { if (AW_Maprice_Helper_Data::isModuleOutputDisabled()) { return parent::_toHtml(); } if ($this->isCustomTemplateNeeded()) { $sr = $this->helper('maprice')->getProductAttributes($this->data); switch ($this->getRequest()->getControllerName()) { case 'result': $pageType = AW_Maprice_Model_Pagetype::PAGE_TYPE_SEARCH; break; case 'category': $pageType = AW_Maprice_Model_Pagetype::PAGE_TYPE_CATEGORY; break; default: $pageType = AW_Maprice_Model_Pagetype::PAGE_TYPE_PRODUCT; } $result = ''; if ($this->listPriceCondition) { $result = Mage::getStoreConfig('maprice/pricetemplates/listpricetemplate'); } if ($this->mapCondition) { if (in_array($pageType, explode(',', Mage::getStoreConfig('maprice/displaypriceson/price')))) { $result .= str_replace('#productId#', $this->product->getId(), $this->helper('maprice')->getButtonHtml()); } if (AW_Maprice_Model_Pagetype::PAGE_TYPE_PRODUCT == $pageType) { $result .= Mage::getStoreConfig('maprice/button/additionaltext'); } // additional html } else { if (in_array($pageType, explode(',', Mage::getStoreConfig('maprice/displaypriceson/price')))) { $result .= Mage::getStoreConfig('maprice/pricetemplates/pricetemplate'); } if ($this->data['you_save_price'] && in_array($pageType, explode(',', Mage::getStoreConfig('maprice/displaypriceson/yousaveprice')))) { $result .= Mage::getStoreConfig('maprice/pricetemplates/yousavepricetemplate'); } } $result = Mage::getModel('core/email_template_filter')->filter($result); foreach ($sr as $search => $replace) { $result = str_replace('{' . $search . '}', $replace, $result); } $this->setTemplate('maprice/maprice_link.phtml'); $this->setMAPriceHtml($result); $this->setPageType($pageType); } return parent::_toHtml(); } else { return parent::_toHtml(); } }
/** * Override this method in descendants to produce html * * @return string */ protected function _toHtml() { if ($this->isEnabled()) { $this->setTemplate('rewards/product/price.phtml'); } return parent::_toHtml(); }