views:

311

answers:

3

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.

+1  A: 

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!

Alan Storm
the mappings only seem to be for non default attributes. The description seems to be hard coded somewhere but I can't find where.
a1anm
Update the answer with some more info. Good luck!
Alan Storm
A: 

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

a1anm
A: 

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/

Artur Jach