Closed GoogleCodeExporter closed 8 years ago
Here is the fix:
Open library/googlecart.php and find at around line 153:
$xml_data->Element('merchant-private-date',
$item->merchant_private_data);
Replace this with:
$xml_data->Push('merchant-private-data');
if(is_array($item->merchant_private_data))
{
foreach($item->merchant_private_data as $key => $value)
{
$xml_data->Element($key,
$value);
}
}
$xml_data->Pop('merchant-private-data');
Then all you have to do is send $private_data when Google_Item is called as a
basic
array.
Original comment by abrookba...@gmail.com
on 14 Feb 2007 at 12:34
Sorry (idiot on the loose) the replacement code should be:
$xml_data->Push('merchant-private-item-data');
if(is_array($item->merchant_private_data))
{
foreach($item->merchant_private_data as $key => $value)
{
$xml_data->Element($key,
$value);
}
}
$xml_data->Pop('merchant-private-item-data');
Original comment by a...@devellion.com
on 14 Feb 2007 at 12:59
Still does not work!
XML output for merchant-item-private-data is blank.
-note: I tried using both foreach($item->merchant_private_data as $key =>
$value)
and foreach($item->merchant_private_item_data as $key => $value)
in the file. Neither worked.
Current (non functional) configuration of my test page:
Using democart.php:
$item_1 = new GoogleItem("MegaSound 2GB MP3 Player", // Item name
"Portable MP3 player - stores 500 songs", // Item
description
1, // Quantity
175.49); // Unit price
$item_1->SetMerchantPrivateItemData('<color>blue</color><weight>3.2</weight>');
following mod made to googlecart.php:
$xml_data->Push('merchant-private-item-data');
if(is_array($item->merchant_private_item_data))
{
foreach($item->merchant_private_item_data as $key => $value)
{
$xml_data->Element($key,
$value);
}
}
$xml_data->Pop('merchant-private-item-data');
Original comment by gegam...@gmail.com
on 1 Jun 2007 at 1:39
hi, new v1.2 has 2 classes to handle merchant private data and merchant private
item
data.
try it
ropu
Original comment by b8.atx.t...@gtempaccount.com
on 13 Jun 2007 at 4:19
Original comment by rovagn...@gmail.com
on 13 Jun 2007 at 4:19
Original issue reported on code.google.com by
ddslever...@gmail.com
on 2 Feb 2007 at 8:48