So, if any of you use the Wordpress shopping cart plugin WP Ecommerce, first of all you’ll notice that it is a superb ecommerce solution for a Wordpress site. With that being said, there are some bugs here and there, which is to be expected I think…after all the plugin is free!
So, what I would like to address today is one of those bugs - passing variations on to Google Checkout.
Within WP Ecommerce you can set up variation sets, like for example: Small, Medium and Large if you are selling T-Shirts. Here’s where the bug comes in. If you’re using Google Checkout as your payment gateway, you’ll notice that the variations don’t get passed on to the Google Checkout page which makes it very difficult to know what exactly your customer ordered, besides just the product itself.
So, what you will need to do is FTP into your site and in “wp-contents/plugins/wp-shopping-cart/shopping_cart_functions.php” find this chunk of code (which starts on line 168 of my version which is 3.6.8 RC1):
if (array_search("google",get_option('custom_gateway_options')) !== false) {
$google_item = new GoogleItem(utf8_decode($product['name']),utf8_decode($product['description']), $quantity, $google_unit_price);
$google_item->SetMerchantItemId($product['id']);
$google_cart->SetMerchantCalculations(get_option('siteurl'),"false","false","false");
//echo serialize($cart_item->product_variations);
$google_item->SetMerchantPrivateItemData("some variations");
$google_cart->AddItem($google_item);
}
The second line in that code is what you will want to change. Copy the code below and replace the second line in that chunk of code:
$google_item = new GoogleItem(utf8_decode($product['name'].$variation_list),utf8_decode($product['description']), $quantity, $google_unit_price);
That’s it! Now your shopping cart should pass the variation sets over to Google Checkout and you’ll know what your customers ordered!! Good luck and happy coding.
Until next time…







November 19th, 2008 at 8:15 pm
Variations still do not seem to get passed onto Google Checkout.
November 21st, 2008 at 10:42 am
That’s odd…I have tested it and retested it and it’s working on my test installation.
November 26th, 2008 at 1:12 pm
Yeah, it’s not working for me either. Has anyone gotten this to work?
November 26th, 2008 at 5:37 pm
Hmm…if you want to contact me through the contact page and get me login info, I’ll take a look at it for you.
December 8th, 2008 at 1:09 am
I can’t get this working either. please, please advise.
December 8th, 2008 at 1:57 am
please respond to my post on this issue on the Instinct forums as soon as possible. your suggestions on the forums have been very helpful and i am grateful for them. sadly this issue is a major bump in the road.
here is the link:
http://www.instinct.co.nz/forums/topic.php?id=910&replies=24#post-11172
with much appreciation,
Andrew
I am also on skype. please feel free to call me tomorrow (monday) 415.501.9651
December 8th, 2008 at 5:14 pm
Hi Andrew,
The issue should be resolved now…check this post:
http://www.instinct.co.nz/forums/topic.php?id=910
December 9th, 2008 at 10:20 am
Variations DO get passed onto Google Checkout now.
December 9th, 2008 at 5:13 pm
Hi Shayne - Thanks for this - I just upgraded to RC3 and noticed that your fix for this appears to be included in the new version, however variations are not being passed through to Google - any thoughts?
Thanks for all your work!
December 10th, 2008 at 10:44 am
Read the post on the link I posted above…that should fix it up.