0

One of the biggest SEO flaws with magento is that if you do not populate the meta information for the meta title, the title page for all products will be the name followed by the store name.

I have a requirement to include the manufacturer part number ($icecatcode), manufacturer name followed by the product name then my store name for my product page titles.

Since my programing ability is limited I am not capable of creating a module the next best thing is to copy /app/code/core/Mage/Catalog/Block/Product/View.php to /app/code/local/Mage/Catalog/Block/Product

I came across this post as a guide.

The problem is if I modify the logic, the page will not load.

Block of code:

  $manufacturer = $product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($product);
    $shortDescription = $product->getShortDescription(); $icecatcode = $product->getResource()->getAttribute('icecatcode')->getFrontend()->getValue($product);
    $suffix = Mage::getStoreConfig('design/head/title_suffix');
    // SEO values end

    if (!$title) {
        $title = $product->getName() .' '.$manufacturer. ' - '. $topCategory->getName() . $suffix;

        }

    $headBlock->setTitle($title); 

Specifically:

 $title = $product->getName() .' '.$manufacturer. ' - '. $topCategory->getName() . $suffix;

Tried the following and variations:

 $title = $product->getIcecatcode() .' '$manufacturer' - '. $product->getName() . $suffix;

How can I change the page titles using the above logic?

EDIT

I have the following working:

 $title = $product->getIcecatcode() . $manufacturer  . $product->getName() . $suffix;

However everything is stuck together. If I add '' to create a space between the page doesn't load.

0

try this

$title = $product->getIcecatcode() .' '. $manufacturer.' '.' '.$product->getName().' '. $suffix;
  • So simple, can't believe it didn't occur to me. Thanks! – SR_Magento Apr 17 '14 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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