Jump to content

[solved]Google Checkout- Add Product Attributes PS V1.3.1


Dusty
 Share

Recommended Posts

Hi
Presently GC does not show item size & color on orders. Just the item Qty, Name & brief description. As I sell clothing this is pretty useless. I'm trying to get GC to show the product size and color on the order. If I modify googleitem.php at line 35 by adding:

var $item_size;


var $item_color;


It makes no difference. Can anyone tell me:
1. Is this the correct file and place to make changes?
2. Is the code I am using correct or should it be something else ie product_attrib_size, product_attrib_color?
All and any help would be appreciated. I have tried a google search Presta shop Google Checkout and could only find one site selling clothing using PS & GC. The size & color of the items did not appear on the order either. Even PS unchanged will not allow the purchase of a green Ipod shuffle using GC. Color is not shown.

Share this post


Link to post
Share on other sites

Thanks for your reply. I tried your suggestion but GC just returned a blank page. I suspect that I have to modify googleitem.php so that item imported into gcheckout.php is correct and shows the options. I added var $product_detail; to googleitem.php as it shows in the PS cart as follows:

Green

Unfortunately no joy. I then tried adding the following to line 131 in gcheckout.php:

utf8_decode($product['product_detail']),

Still no joy. You cant buy a green Ipod shuffle using GC. Would greatly appreciate any further suggestions you may have particularly as no else on this forum seems capable of helping.

Share this post


Link to post
Share on other sites

I've been posting it in line 131 in gcheckout.php as follows:

$googleCart->AddItem(new GoogleItem(utf8_decode($product['name']), utf8_decode($product['product_detail']), utf8_decode($product['description_short']), intval($product['cart_quantity']), Tools::convertPrice($product['price_wt'], $currency)));



I thought private merchant data would be merchant I.D. rather than attributes such as size & color.

Share this post


Link to post
Share on other sites

I'll give it a go. On my OsCom site it hasn't been a problem. I don't need a callback from GC, just the email notifying me of the order and the details. I then process in the GC merchant center. I have also been playing around with Open Cart. I don't like the layout as much as PS but the GC does pick up the product attributes unfortunately it nots very happy with the shipping modules. Can't win somedays.

Share this post


Link to post
Share on other sites

You have hit nail on the head. Since GC is not available to merchants in EU they just go through the charade of offering GC to make it look like a cosmopolitan enterprise. IF you do a search of this site for "Google Checkout" you will find unresolved issues going back to versions from the dawn of mankind. Try a search on Bug Tracker, many reports, very few answers, even fewer solutions. Try a google search on the web for " Google Checkout Presta shop" I found very few merchant websites and none that worked where product attributes were required. I am delighted that you have determined to sort this out and if there is anything I can do to assist, I will.
Dusty.

Share this post


Link to post
Share on other sites

Tried adding to "private data" and got the following error:

Error parsing XML; message from parser is: cvc-datatype-valid.1.2.1: '

Medium weight Thornproof Waxed Cotton with a pure Cotton lining, the original Barbour Beaufort is studded to take an optional Warm Pile Lining making it an all-season companion. Sometimes called the "Poachers Coat" because of all its pockets. This definitely is one of the most alltime popular wax jackets from Barbour. Bring on the rain!.

' is not a valid value for 'integer'.

Share this post


Link to post
Share on other sites

Hi I need help with the following:
‘merchant-private-item-data’ node

What is that on a good day? keeping in mind that i am a shop keeper not a programmer. I looked in GCcheckout.php but could find nothing similar.

Dusty

Share this post


Link to post
Share on other sites

Dusty...
OK, I found out from EdSF on the forum that the merchant-private-item-data would be private anyway and would not be read by checkout.

However...

He did say that in order to add size, color, etc to your products, you are supposed to use the DESCRIPTION, i.e.

Item 1 of shopping cart:

merchant-item-id: EDSF123
item-name: Peets Coffee
item-description: Major Dickason Blend, 1lb bag.

Item 2 of shopping cart:

merchant-item-id: EDSF345
item-name: Peets Coffee
item-description: Major Dickason Blend, Decaf, 1lb bag.



Item 2 is for Decaf.
Now, that would entail some modifications to this code in gcheckout.php:

foreach ($params['cart']->getProducts() as $product)
 $googleCart->AddItem(new GoogleItem(utf8_decode($product['name']), 
                                   utf8_decode($product['description_short']), 
                                   intval($product['cart_quantity']), 
                                   Tools::convertPrice($product['price_wt'], 
                                   $currency)));



Open classes/Cart.php, find the SQL in getProducts() and run it separately with a valid cart and product id to see what it returns.
If it returns a size and color, then we are in business without having to modify that SQL. (Note, I can't do that because I don't
have any size/color attributes for my products)

Post the results of the SQL and then I'll tell you how to modify the code in gcheckout.

Share this post


Link to post
Share on other sites

Placed an order for a "green" ipod. Attribute "green" was not included in the sandbox order. I then opened sql ps_cart but there is no getProducts() See the following:

SQL result

Host: localhost
Database: prestashop131
Generation Time: Sep 03, 2010 at 11:17 PM
Generated by: phpMyAdmin 2.11.5 / MySQL 5.0.51a-community-nt
SQL query: SELECT * FROM `ps_cart` LIMIT 0, 30 ;
Rows: 3

id_cart id_carrier id_lang id_address_delivery id_address_invoice id_currency id_customer id_guest recyclable gift gift_message date_add date_upd
1 2 2 6 6 1 1 1 1 0 NULL 2010-09-02 15:38:04 2010-09-02 15:38:04
2 2 1 3 3 3 2 3 0 0 2010-09-02 16:54:45 2010-09-02 17:51:02
3 2 1 3 3 3 2 3 1 0 2010-09-03 23:51:06 2010-09-04 00:05:08

Am I missing something?
dusty

Share this post


Link to post
Share on other sites

I then opened sql ps_cart but there is no getProducts()
Am I missing something?


Yes, I said to open /classes/Cart.php and check the SQL in the getProducts() function.
Modify it by adding the id_cart and id_product values and run it in phpMyAdmin to see
what the results are. Paste them here.

Share this post


Link to post
Share on other sites

I've had no joy in trying to follow your instructions. My knowledge of sql is non existent. I did see the response on gc forum from EdSF but don't think that solution is the answer. My old osc site picks up the attributes from the cart no bother and the open cart gc module does the same.

Share this post


Link to post
Share on other sites

I'm afraid I am unable to follow your instructions.

1.When I open/classs/cart.php I can find
foreach ($this->getProducts() AS $product)
I don't know how to check the sql
2. TO find the id_product value, go to the ps_cart_product table and look for the id_product with the same id_cart value from ps_cart for the cart you created.
When I do this the date/time on the cart is incorrect so I don't which cart is correct. When I inspect the elements of the cart I get the following:





ps_cart_product shows 5 carts, 2 numbered "1", 2 numbered "3" and 1 numbered "2". Cart number "2" has id_product 2 as does one of the number"3" carts. After that I am unable to track down anything further

Share this post


Link to post
Share on other sites

Thanks to tomerg3 for the following:

Change line # 131 in gcheckout.php
From
 $googleCart->AddItem(new GoogleItem(utf8_decode($product['name']), utf8_decode($product['description_short']), intval($product['cart_quantity']), Tools::convertPrice($product['price_wt'], $currency)));



To

 $googleCart->AddItem(new GoogleItem(utf8_decode($product['name'].($product['attributes'] != ""?" - ".$product['attributes']:"")), utf8_decode($product['description_short']), intval($product['cart_quantity']), Tools::convertPrice($product['price_wt'], $currency)));


Keep a copy of the file before making the change, and test it out.



Works perfectly! The GC Module should be modified to include this "Fix" so that we are not constantly re-inventing the wheel.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More