a1anm
a1anm

Reputation: 1629

Magento - Use Short description for Google base description

I am using magento and it's built in functionality for adding products to google base. I would like to change it so that it uses the Short description as the Description in Google base. As opposed to the detailed description.

Upvotes: 1

Views: 1705

Answers (4)

Edwin van der Mout
Edwin van der Mout

Reputation: 1

Magento 1.7.0.2 Google Shopping 1.7.0.0

app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php

Change $description = $this->getGroupAttributeDescription();

In $description = $this->getGroupAttributeShortDescription();

Upvotes: 0

Artur Jach
Artur Jach

Reputation: 1

I eventually got the module to work and managed to fix all errors.

I put together short step-by-step guide on how to set up the Magento Google Base feed, including account configuration, adding the condition attribute & mapping attributes and publishing them here http://blog.pod1.com/e-commerce/magento-google-base-feed/

Upvotes: 0

a1anm
a1anm

Reputation: 1629

Figured out all I had to do was change:

if ($object->getDescription()) {
    $content = $service->newContent()->setText( $object->getDescription() );
    $entry->setContent($content);
}

to

if ($object->getDescription()) {
    $content = $service->newContent()->setText( $object->getShortDescription() );
    $entry->setContent($content);
}

in app/code/core/Mage/GoogleBase/Model/Service/Item.php

Upvotes: 1

Alana Storm
Alana Storm

Reputation: 166106

According to this Screencast you should be able to setup attribute attribute mappings. Is that not working for you?

Looking deeper, I don't have a google base account, so I can't test this, BUT, when I search through the Google Base module it looks like this is where it's grabbing the description

app/code/core/Mage/GoogleBase/Model/Service/Item.php    
protected function _setUniversalData()
{
    //...
    if ($object->getDescription()) {
        $content = $service->newContent()->setText( $object->getDescription() );
        $entry->setContent($content);
    }
    //...
}

My general approach here would be to create an override for the _setUniversalData method on the Mage_GoogleBase_Model_Service_Item class that looks something like this

protected function _setUniversalData()
{
    parent::_setUniversalData();

    //your code to parse through this object, find the long desription, 
    //and replace with the short.  The following is pseudo code and just 
    //a guess at what would work
    $service = $this->getService();
    $object = $this->getObject();
    $entry = $this->getEntry();     

    $new_text   = $object->getShortDescription(); //not sure on getter method
    $content = $service->newContent()->setText( $new_text );
    $entry->setContent($content);

    return $this;
}

Good luck!

Upvotes: 1

Related Questions