Download & Extend

Product condition always listed as 'used'.

Project:Ubercart Google Merchant Integration
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Here's where I've identified some issues that need correction.

1. Product node links not outputting to google using the 'link' attribute. This prevents google from linking back to your website. (lines: 509,510)

509: $node_link = $item->xml->addChild('link');
510: $node_link->addAttribute('href',$base_url.$node->path);

2. Products listing as used in google even if new is selected in the ubercart config. (lines 526, 329-338, )

526: $item->add_attribute('condition', ($uc_gbase['product_condition'] == 0)? 'new': ($uc_gbase['product_condition'] == 1)? 'used' : 'Refurbished');

329: $form['uc_gbase']['product_condition'] = array(
330: '#type' => 'radios',
331: '#title' => 'Product Condition',
332: '#default_value' => isset($defaults['product_condition']) ? $defaults['product_condition'] : 0,
333: '#options' => array(
334: t('New'),
335: t('Used'),
336: t('Refurbished'),
337: ),
338: );

Comments

#1

Issue #1:

There are two problems.

1) $base_url and $node->path are not separated by a forward slash.
original 510: $node_link->addAttribute('href',$base_url.$node->path);
modified 510: $node_link->addAttribute('href',$base_url.'/'.$node->path);

2) Data sent to Google does not conform to their standards.
http://code.google.com/apis/base/starting-out.html#ItemTypes

To provide the link, use the standard Atom link element, as in the following example: <atom:link rel='alternate' type='text/html' href='http://www.somehost.com/123456jsh9'/>

@ line 510

- $node_link->addAttribute('href',$base_url.'/'.$node->path);
+ $node_link->addAttribute('rel','alternate');
+ $node_link->addAttribute('type','text/html');
+ $node_link->addAttribute('href',$base_url.'/'.$node->path);

#2

I went to line 514 and replaced this:

$node_link->addAttribute('href',$base_url.$node->path);

With this:
  $node_link->addAttribute('rel','alternate');
  $node_link->addAttribute('type','text/html');
  $node_link->addAttribute('href',$base_url.'/'.$node->path);

but products are still coming up as 'used' as opposed to 'new'

$20 dollar bounty for anyone who helps me with this! email aaron at ecopaper dot com or respond here to help the ocmmunity.

#3

Title:Product node linking issues, product condition listing wrong. » Product condition always listed as 'used'.

#4

Status:needs work» fixed

#5

Status:fixed» closed (fixed)
nobody click here