Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>By default Canonical tags should still be http although the address bar of your browser is https.</p> <p>To test this, in the address bar of your browser type in both the https and http version and then view page source for each version and search for canonical tag (href value) in the header section. They should be the same not https.</p> <p>If you have a issue let me know what version of magento you are using.</p> <p>To extend the block do</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;RWS_ProductCanonical&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;/RWS_ProductCanonical&gt; &lt;/modules&gt; &lt;global&gt; &lt;blocks&gt; &lt;productcanonical&gt; &lt;class&gt;RWS_ProductCanonical_Block&lt;/class&gt; &lt;/productcanonical&gt; &lt;catalog&gt; &lt;rewrite&gt; &lt;category_view&gt;RWS_ProductCanonical_Block_Category_View&lt;/category_view&gt; &lt;/rewrite&gt; &lt;/catalog&gt; &lt;/blocks&gt; &lt;helpers&gt; &lt;productcanonical&gt; &lt;class&gt;RWS_ProductCanonical_Helper&lt;/class&gt; &lt;/productcanonical&gt; &lt;/helpers&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <p>Create block app/code/local/RWS/ProductCanonical/Block/Category/View.php (I extend Mage_Core_Block_Template and copy all the code because when in extend the Mage_Catalog_Block_Category_View it was add multiply tags to the header)</p> <pre><code>class RWS_ProductCanonical_Block_Category_View extends Mage_Core_Block_Template { protected function _prepareLayout() { parent::_prepareLayout(); $this-&gt;getLayout()-&gt;createBlock('catalog/breadcrumbs'); if ($headBlock = $this-&gt;getLayout()-&gt;getBlock('head')) { $category = $this-&gt;getCurrentCategory(); if ($title = $category-&gt;getMetaTitle()) { $headBlock-&gt;setTitle($title); } if ($description = $category-&gt;getMetaDescription()) { $headBlock-&gt;setDescription($description); } if ($keywords = $category-&gt;getMetaKeywords()) { $headBlock-&gt;setKeywords($keywords); } if ($this-&gt;helper('catalog/category')-&gt;canUseCanonicalTag()) { ////// add to header here $headBlock-&gt;addLinkRel('canonical', $category-&gt;getUrl() . '?limit=all'); } /* want to show rss feed in the url */ if ($this-&gt;IsRssCatalogEnable() &amp;&amp; $this-&gt;IsTopCategory()) { $title = $this-&gt;helper('rss')-&gt;__('%s RSS Feed',$this-&gt;getCurrentCategory()-&gt;getName()); $headBlock-&gt;addItem('rss', $this-&gt;getRssLink(), 'title="'.$title.'"'); } } return $this; } public function IsRssCatalogEnable() { return Mage::getStoreConfig('rss/catalog/category'); } public function IsTopCategory() { return $this-&gt;getCurrentCategory()-&gt;getLevel()==2; } public function getRssLink() { return Mage::getUrl('rss/catalog/category',array('cid' =&gt; $this-&gt;getCurrentCategory()-&gt;getId(), 'store_id' =&gt; Mage::app()-&gt;getStore()-&gt;getId())); } public function getProductListHtml() { return $this-&gt;getChildHtml('product_list'); } /** * Retrieve current category model object * * @return Mage_Catalog_Model_Category */ public function getCurrentCategory() { if (!$this-&gt;hasData('current_category')) { $this-&gt;setData('current_category', Mage::registry('current_category')); } return $this-&gt;getData('current_category'); } public function getCmsBlockHtml() { if (!$this-&gt;getData('cms_block_html')) { $html = $this-&gt;getLayout()-&gt;createBlock('cms/block') -&gt;setBlockId($this-&gt;getCurrentCategory()-&gt;getLandingPage()) -&gt;toHtml(); $this-&gt;setData('cms_block_html', $html); } return $this-&gt;getData('cms_block_html'); } /** * Check if category display mode is "Products Only" * @return bool */ public function isProductMode() { return $this-&gt;getCurrentCategory()-&gt;getDisplayMode()==Mage_Catalog_Model_Category::DM_PRODUCT; } /** * Check if category display mode is "Static Block and Products" * @return bool */ public function isMixedMode() { return $this-&gt;getCurrentCategory()-&gt;getDisplayMode()==Mage_Catalog_Model_Category::DM_MIXED; } /** * Check if category display mode is "Static Block Only" * For anchor category with applied filter Static Block Only mode not allowed * * @return bool */ public function isContentMode() { $category = $this-&gt;getCurrentCategory(); $res = false; if ($category-&gt;getDisplayMode()==Mage_Catalog_Model_Category::DM_PAGE) { $res = true; if ($category-&gt;getIsAnchor()) { $state = Mage::getSingleton('catalog/layer')-&gt;getState(); if ($state &amp;&amp; $state-&gt;getFilters()) { $res = false; } } } return $res; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload