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):
1 2 3 4 5 6 7 8 9 | 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:
1 | $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…
Deanna says
Variations still do not seem to get passed onto Google Checkout.
shayne says
That's odd…I have tested it and retested it and it's working on my test installation.
Michael Mahoney says
Yeah, it's not working for me either. Has anyone gotten this to work?
shayne says
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.
Andrew says
I can't get this working either. please, please advise.
Andrew says
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…
with much appreciation,
Andrew
I am also on skype. please feel free to call me tomorrow (monday) 415.501.9651
shayne says
Hi Andrew,
The issue should be resolved now…check this post:
http://www.instinct.co.nz/forums/topic.php?id=910
Deanna says
Variations DO get passed onto Google Checkout now. ๐
Chris says
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!
shayne says
Read the post on the link I posted above…that should fix it up.
Robin says
I'm a newbie and thrilled with WP e-commerce, especially now that I've discovered you. However, I currently have an issue with Google chcekout because they require a secure Google API callback url. The one I'm given through WP e-commerce does not have the "s" (https://) . How do I go about making my site secure so I can get this proper url for google checkout?
shayne says
Robin,
That's something that can be done through your hosting provider. Just contact them and tell them you need a SSL certificate for your site, and they can help out with that.
Robin says
Shayne,
Thanks again and happy holidays! You wouldn't believe the disaster securing my site has caused. My entire database was corrupted in a renaming process, and I had to almost start over. The blessing is that I changed themes which several experts had suggested I do. My domain host was veyr helpful in restoring what data they could, but I lost 3 days getting the problem resolved. Anyway….
I just left a comment on one of your other posts, and then remembered another question. I'd like to have my products show only images on the main page, and when you click on the image, the full description appears. I noticed it does this when you do a search for products – the page changes to this format but reverts to the original when you leave the site and return. I suspect it's an easy change I'm overlooking, but how do I get my page to only show images, titles and price until you click on the image for the full description? Is it possible to "tile" the images?
shayne says
Robin –
The easiest way to accomplish this is to get the Gold/Grid View module from Instinct.
Otherwise, you could edit the PHP files, but that would be a little bit of work…