Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From your question, I assume you are referring to changing the meta title for products.</p> <p>There are 3 options open to you:</p> <ol> <li>Go through each product and manually update (or use a spreadsheet and import) each product meta title individually. These values are available in the admin area when editing a product.</li> <li>Rewrite Mage_Catalog_Block_Product_View and override the _prepareLayout() method which is where this tag is being generated.</li> <li>Use an observer and hook into catalog_controller_product_view event.</li> </ol> <p>Your decision is really between options 2 &amp; 3 (both of which will require you to create a custom module to achieve).</p> <p>I always try to be as unobtrusive as possible when extending Magento core functionality - so I would opt for option 3 here. Please see below code for a complete example:</p> <p>app/etc/modules/Yourcompany_Yourmodule.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Yourcompany_Yourmodule&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/Yourcompany_Yourmodule&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <p>app/code/local/Yourcompany/Yourmodule/etc/config.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Yourcompany_Yourmodule&gt; &lt;version&gt;1.0.0&lt;/version&gt; &lt;/Yourcompany_Yourmodule&gt; &lt;/modules&gt; &lt;global&gt; &lt;models&gt; &lt;yourmodule&gt; &lt;class&gt;Yourcompany_Yourmodule_Model&lt;/class&gt; &lt;/yourmodule&gt; &lt;/models&gt; &lt;/global&gt; &lt;frontend&gt; &lt;events&gt; &lt;catalog_controller_product_view&gt; &lt;observers&gt; &lt;yourmodule&gt; &lt;class&gt;Yourcompany_Yourmodule_Model_Observer&lt;/class&gt; &lt;method&gt;catalog_controller_product_view&lt;/method&gt; &lt;/yourmodule&gt; &lt;/observers&gt; &lt;/catalog_controller_product_view&gt; &lt;/events&gt; &lt;/frontend&gt; &lt;/config&gt; </code></pre> <p>app/code/local/Yourcompany/Yourmodule/Model/Observer.php</p> <pre><code>&lt;?php class Yourcompany_Yourmodule_Model_Observer { /** * Change product meta title on product view * * @pram Varien_Event_Observer $observer * @return Yourcompany_Yourmodule_Model_Observer */ public function catalog_controller_product_view(Varien_Event_Observer $observer) { if ($product = $observer-&gt;getEvent()-&gt;getProduct()) { $title = $product-&gt;getData('brand') . ' ' . $product-&gt;getData('name') . ' ' . $product-&gt;getData('sub_title'); $product-&gt;setMetaTitle($title); } return $this; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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