public function getTaggedProductsUrl() { if (!Mage::helper('magenotification')->checkLicenseKey('Seobytag')) { return parent::getTaggedProductsUrl(); } $tagId = $this->getTagId(); $storeId = Mage::app()->getStore()->getId(); if (!$storeId) { $storeId = $this->getFirstStoreId(); } if (!$this->getSeoHelper()->getConfig('enable')) { return parent::getTaggedProductsUrl(); } $rewrite = Mage::getModel('core/url_rewrite')->loadByIdPath("seobytag/{$storeId}/{$tagId}"); if ($rewrite->getId() && $this->getSeoHelper()->getConfig('cache')) { return Mage::getUrl(null, array('_direct' => $rewrite->getRequestPath())); } try { $this->generateUrlKey()->save(); $rewrite = $this->createRewrite(); if ($rewrite && $rewrite->getId()) { return Mage::getUrl(null, array('_direct' => $rewrite->getRequestPath())); } } catch (Exception $e) { } return parent::getTaggedProductsUrl(); }
public function getTaggedProductsUrl() { if ($this->getConfig()->isEnabledTagSeoUrls()) { $uri = Mage::getModel('catalog/product_url')->formatUrlKey($this->getName()); $options = array(); if ($this->getStoreId()) { $options['_store'] = $this->getStoreId(); } return Mage::getUrl('tag/' . $uri . '-' . $this->getId(), $options); } else { return parent::getTaggedProductsUrl(); } }