Dusty Posted August 24, 2010 Share Posted August 24, 2010 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. Link to comment Share on other sites More sharing options...
Dusty Posted August 25, 2010 Author Share Posted August 25, 2010 C'mon Guys,Surely someone can at least tell me if I'm headed in the right direction?? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 1, 2010 Share Posted September 1, 2010 Did you try adding your options by adding more lines like this in gcheckout.php: $googleCart->SetMerchantPrivateData($params['cart']->id); I'm suspecting that you may be able to add color, size, etc like that. I can't test it but give it a shot. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 1, 2010 Share Posted September 1, 2010 Of course, you will want to add things from the $product, not $params['cart']... Link to comment Share on other sites More sharing options...
Dusty Posted September 2, 2010 Author Share Posted September 2, 2010 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:GreenUnfortunately 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. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 2, 2010 Share Posted September 2, 2010 Since I know nothing about attributes, I can't tell you if you are putting the wrong values in there.So your code looks like this?? $googleCart->SetMerchantPrivateData(utf8_decode($product[‘product_detail’])); Link to comment Share on other sites More sharing options...
Dusty Posted September 2, 2010 Author Share Posted September 2, 2010 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. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 2, 2010 Share Posted September 2, 2010 Try adding it as the private data and see what you get. The problem is that Google isn't expecting the extra item and I believe you can add as much private data as you want. Link to comment Share on other sites More sharing options...
Dusty Posted September 2, 2010 Author Share Posted September 2, 2010 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. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 2, 2010 Share Posted September 2, 2010 I intend to get heavily into the Google Checkout API and see if I can fix the PS code for good.Seems that since they can't use GC in France, it is not a priority for them to fix it. It will be up tous US and GB developers to fix it.E. Link to comment Share on other sites More sharing options...
Dusty Posted September 2, 2010 Author Share Posted September 2, 2010 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. Link to comment Share on other sites More sharing options...
Dusty Posted September 3, 2010 Author Share Posted September 3, 2010 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'. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 3, 2010 Share Posted September 3, 2010 try adding it in a 'merchant-private-item-data' node, instead.I have a question out on the Merchant Center forums for help on this one. Link to comment Share on other sites More sharing options...
Dusty Posted September 3, 2010 Author Share Posted September 3, 2010 Hi I need help with the following:‘merchant-private-item-data’ nodeWhat 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 Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 3, 2010 Share Posted September 3, 2010 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'thave 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. Link to comment Share on other sites More sharing options...
Dusty Posted September 3, 2010 Author Share Posted September 3, 2010 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 resultHost: localhostDatabase: prestashop131Generation Time: Sep 03, 2010 at 11:17 PMGenerated by: phpMyAdmin 2.11.5 / MySQL 5.0.51a-community-ntSQL query: SELECT * FROM `ps_cart` LIMIT 0, 30 ; Rows: 3id_cart id_carrier id_lang id_address_delivery id_address_invoice id_currency id_customer id_guest recyclable gift gift_message date_add date_upd1 2 2 6 6 1 1 1 1 0 NULL 2010-09-02 15:38:04 2010-09-02 15:38:042 2 1 3 3 3 2 3 0 0 2010-09-02 16:54:45 2010-09-02 17:51:023 2 1 3 3 3 2 3 1 0 2010-09-03 23:51:06 2010-09-04 00:05:08Am I missing something?dusty Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 3, 2010 Share Posted September 3, 2010 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. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 3, 2010 Share Posted September 3, 2010 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. Link to comment Share on other sites More sharing options...
Dusty Posted September 4, 2010 Author Share Posted September 4, 2010 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. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 5, 2010 Share Posted September 5, 2010 So, you have no idea how to operate phpMyAdmin? Link to comment Share on other sites More sharing options...
Dusty Posted September 5, 2010 Author Share Posted September 5, 2010 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 sql2. 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: iPod shuffle 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 Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 7, 2010 Share Posted September 7, 2010 I will install a new shop and run what I need. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 8, 2010 Share Posted September 8, 2010 Ok, I have what I need and am working on it. I am going to have to setup my sandbox and see if I can get the XML correct. Link to comment Share on other sites More sharing options...
Dusty Posted September 15, 2010 Author Share Posted September 15, 2010 Thanks to tomerg3 for the following: Change line # 131 in gcheckout.phpFrom $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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now