1

I want to make an automation that takes the web title of a product's page, and write this to the meta description section of the Magento's back end. How would that be posible ?

0

1 Answer 1

1

Not sure what your "web title" is, but you can do it in this way. It will set the metadescription on product save to product name.

  1. in config.xml add an observer to catalog_product_save_before

    <catalog_product_save_before>
        <observers>
            <some_alias>
                <type>model</type>
                <class>your_module/observer</class>
                <method>setMetaDescriptionFromProductName</method>
            </some_alias>
        </observers>
    </catalog_product_save_before>
    
  2. add this to Observer.php

    public function setMetaDescriptionFromProductName(Varien_Event_Observer $observer)
    {
        # adjust this to your needs
        $product = $observer->getProduct();
        $product->setMetaDescription($product->getName());
        return $this;
    }
    

If you want to generate meta data on the fly (without saving to product) you can use catalog_controller_product_view event instead: see How to copy product information to meta information in Magento 1.9.2

Not the answer you're looking for? Browse other questions tagged or ask your own question.