문제

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.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top