kenfeyl Posted July 8, 2006 Share Posted July 8, 2006 Hey guys, I hacked up abbat's code to compute the cheapest shipping method and pass it on to Google as a default-flat-rate. It does the same for tax. In keeping with Google's mandate that no login be required before offering Google Checkout, I stuck the whole order summary on the "View Shopping Cart" page, along with the Google Checkout button. The tax is hidden on this summary because we don't have the user's location, but the tax configuration details are read from OSc's Tax Zones and Tax Rates and passed on to Google Checkout. I then configured Checkout's Callback URL to point to a script that collects order and customer information from Google and sticks it into OSc's order and customer tables. All in all, I'm pretty happy with the hacks -- my site no longer requires users to log in, and an entire purchase takes two clicks: one on the Google Checkout button on my "View Shopping Cart" page, and one on the actual Google Checkout page after the user has entered his information. What are your thoughts? Is there documentation on how I could wrap up a module with this stuff? Hey man, This contrib is small. Very small. You're right. It does not include everything it should (and should it at all?) Google API supports everything, besides the Tax, shipping - which is VERY EASY TO ADD - it also support order processing, status, notifications etc. Shipping and taxes are the simpe thing - same simple as top build the google shopping cart. 40 lines of code - you're right. I can tell with 100% that adding shipping and taxes will not take more than 40 lines of code... If you're so cool, lets take a look at YOUR CODE - I can BET I fit in 40 lines by adding shipping and taxes to this contrib - will you fit in this 40 lines? Common, let us see what you can do! This will be the Google Checkout v 1.5 - with shipping and taxes! I only assume those 40 lines will not be more than 255 chars :):):) So, pleople, let us wait for his code? How do you think? About those 2-3 months - I'm planning to include everything Google API allows, including order processing and notification techniques. I'm also planning to redo an API a little so tose guys who does not have curl installed could use curl from comman line. The same with DOM XML library, which is currently for php < 5. And most of new hosting companies have php > 5 - so why does not allow to use Google checkout for them? Quote Link to comment Share on other sites More sharing options...
Mediajuggle Posted July 8, 2006 Share Posted July 8, 2006 After making the purchase... does the customer return to the oscommerce page. Is the order logged into osc and can this be used for automatic downloads? Quote My Contribution Music Download Store Template http://www.oscommerce.com/community/contributions,4275 Link to comment Share on other sites More sharing options...
jodo Posted July 8, 2006 Share Posted July 8, 2006 kenfeyl, Would love to see your "hack." Sounds like great work. I hacked up abbat's code to compute the cheapest shipping method and pass it on to Google as a default-flat-rate. Are you grabbing real rates from e.g. UPS? . I then configured Checkout's Callback URL to point to a script that collects order and customer information from Google and sticks it into OSc's order and customer tables. Does this capture all the attributes? Like size or color. Again, please post your work somewhere. A lot of us would really appreciate it. Quote Link to comment Share on other sites More sharing options...
kenfeyl Posted July 9, 2006 Share Posted July 9, 2006 kenfeyl, Would love to see your "hack." Sounds like great work. Are you grabbing real rates from e.g. UPS? Does this capture all the attributes? Like size or color. Again, please post your work somewhere. A lot of us would really appreciate it. Essentially, I copied pieces from the various checkout_*.php steps, so that the "View Cart" page displays all the data on the order summary on checkout_payment.php, albeit with the ability to add and subtract items from the cart. So yes, this total includes all attributes and shipping. Although it does not display tax in this summary (because it doesn't know where you live), in the background it loads your tax zones and rates and keeps them in the XML sent to Google if the user checks out. The tax part works only for U.S. states. My current version calls out to $shipping->cheapest() to get the cheapest of all the shipping modules you've enabled (this is the method labelled "Best Way" in the standard osCommerce checkout_shipping.php). That is just my personal hack because I have two shipping modules from which the user will always prefer the cheaper. One thing I would like to do before packaging up this module is to add an Ajax shipping selection on the "View Cart" page, so that your user is allowed to select a shipping method before proceeding to Google, rather than just choosing the cheapest. This part will probably take me another few days as I know zero Ajax at the moment and Ajax is necessary since the XML will have to be repopulated after the shipping choice. The final step is the order and customer processing. Behind the scenes it adds rows to customers and orders once Google calls home via the callback API. If you want to get an idea of what's happening, and I'm embarassed to give out the link because you'll see that my site looks stock to the point of absurdity (my gf is working on a new template), check out http://www.officialclassicgames.com. Add an item to your cart, and then click on either "View Cart" or "Checkout." If you proceed to Google, you need to log in to your Google account before it actually populates the shipping and tax costs. But rest assured those came straight from my shipping modules and tax zones. The only real disconnect of my hack to the osCommerce world is that I'm short-circuiting the concept of registered customers. My customers no longer log in -- they simply fill up their cart and then proceed to Google. Tell me what you guys think. I know it's a bit radical to eliminate logins -- what do you guys think? Also, my hacks do make Google the only means of payment. Quote Link to comment Share on other sites More sharing options...
stevemills Posted July 9, 2006 Author Share Posted July 9, 2006 kenfeyl, That mod looks very well done. I almost ordered a Backgammon set by accident. :) But does your mod really make Google Checkout the only form of payment available? Quote Link to comment Share on other sites More sharing options...
MaxPowers Posted July 11, 2006 Share Posted July 11, 2006 Whoever is actively working on this mod, please contact me via PM or email... I can code the Google stuff, but I have no clue how osCommerce is setup. I really don't want to have to learn the osCommerce system just for this plugin, but I was hired to do the Google integration, then found out that the site was in osCommerce. Help me figure out what osCommerce-specific commands to use and which of the thousands of files it goes into and I can whip out a Google solution that doesn't rely on their libxml (PHP4 only) code or some of the other unnecessary (and largely incompatible) Google example code. If you know where the osCommerce equivalent is located, I can cover the Google end of the code. Quote Link to comment Share on other sites More sharing options...
savajr Posted July 11, 2006 Share Posted July 11, 2006 Yeah, I agree with you mijman2. This guy doesn't really understand the concept of open source development. You don't understand concept of shareware business. Also open source != free. Try learning a little. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 11, 2006 Share Posted July 11, 2006 OK people...I'm finishing a rather large contribution but will step up and code the level 2 integration. Quote Link to comment Share on other sites More sharing options...
MaxPowers Posted July 11, 2006 Share Posted July 11, 2006 If you need anything from the Google side of it, let me know. I can code G-checkout to work on php5 systems. Quote Link to comment Share on other sites More sharing options...
Horizons1 Posted July 13, 2006 Share Posted July 13, 2006 Kenfeyl, That is fantastic. Frankly, I don't mind the loss of the os login. I'd use your hack if you made it available! Quote Link to comment Share on other sites More sharing options...
graith Posted July 17, 2006 Share Posted July 17, 2006 After making the purchase... does the customer return to the oscommerce page. Is the order logged into osc and can this be used for automatic downloads? The customer is not required to return to the OSC site. L2 Messages are passed while they're away that you can use to create an OSC order. I've got shipping working, order logging, risk notification and stock decrementing. Vouchers are a problem because the customer is not required to have an account so you can't count uses. Taxes should be easy but Google seem to have complicated things a lot. On final testing.... Graith dot co dot uk Quote Link to comment Share on other sites More sharing options...
Mediajuggle Posted July 17, 2006 Share Posted July 17, 2006 But how will this module work with automatic downloads...? Quote My Contribution Music Download Store Template http://www.oscommerce.com/community/contributions,4275 Link to comment Share on other sites More sharing options...
DERTY Posted July 18, 2006 Share Posted July 18, 2006 I've updated some of Alex's code from his contribution to handle a few errors (some not of his own) in the processing. I've also corrected a query for it to function properly with CRE Loaded. There are also some other debugging messages included for now for development purposes. Most of the fixes I made are captured in the comments within the GoogleCheckout.php file at the top. http://stenod.derty.org/googlecheckout.php Quote Link to comment Share on other sites More sharing options...
Royal123 Posted July 18, 2006 Share Posted July 18, 2006 Any word on a Level 2 module? Really looking foward to it :) I wish I could code :( Quote Link to comment Share on other sites More sharing options...
graith Posted July 19, 2006 Share Posted July 19, 2006 Any word on a Level 2 module?Really looking foward to it :) I wish I could code :( I've finished Level 2 OSC and I'm looking for people to test it. I know CRE Loaded code as well as MS2. At the moment I've just got MS2 code but I'll be working on CRE Loaded as soon as I get a chance. PM me if you're interested. Quote Link to comment Share on other sites More sharing options...
Mediajuggle Posted July 19, 2006 Share Posted July 19, 2006 graith, Will your module work well with those selling automatic downloads? Meaning, as soon as a person pays with his Google payment, he can download his music. I don't mind paying for something that fits my needs. Quote My Contribution Music Download Store Template http://www.oscommerce.com/community/contributions,4275 Link to comment Share on other sites More sharing options...
graith Posted July 19, 2006 Share Posted July 19, 2006 graith,Will your module work well with those selling automatic downloads? Meaning, as soon as a person pays with his Google payment, he can download his music. I don't mind paying for something that fits my needs. I don't see why not. I'd need access to a copy of your database and website to ensure I got it right though. I'll PM you my email address. Google Checkout is a PayPal killer and may even be a good replacement for cc payment clearing facilities as the transaction charges might be lower (especially if you pay Google for Ads anyway), but we need to make it as usable as any other payment method. The only way to do that is with Level 2. Quote Link to comment Share on other sites More sharing options...
graith Posted July 20, 2006 Share Posted July 20, 2006 I've finished Level 2 OSC and I'm looking for people to test it. I know CRE Loaded code as well as MS2. At the moment I've just got MS2 code but I'll be working on CRE Loaded as soon as I get a chance. PM me if you're interested. Thanks for all the offers to help testing. I've now got enough people testing it. Quote Link to comment Share on other sites More sharing options...
warrenerjm Posted July 20, 2006 Share Posted July 20, 2006 Thanks for all the offers to help testing. I've now got enough people testing it. Hi Brian As you are in the UK, do you know when Google checkout will be available here & when will your code be available as a contribution. I understand you need to cover your costs first. :thumbsup: Thanks Julie Quote Link to comment Share on other sites More sharing options...
ValleyRoaster Posted July 21, 2006 Share Posted July 21, 2006 Essentially, I copied pieces from the various checkout_*.php steps, so that the "View Cart" page displays all the data on the order summary on checkout_payment.php, albeit with the ability to add and subtract items from the cart. So yes, this total includes all attributes and shipping. Although it does not display tax in this summary (because it doesn't know where you live), in the background it loads your tax zones and rates and keeps them in the XML sent to Google if the user checks out. The tax part works only for U.S. states. My current version calls out to $shipping->cheapest() to get the cheapest of all the shipping modules you've enabled (this is the method labelled "Best Way" in the standard osCommerce checkout_shipping.php). That is just my personal hack because I have two shipping modules from which the user will always prefer the cheaper. One thing I would like to do before packaging up this module is to add an Ajax shipping selection on the "View Cart" page, so that your user is allowed to select a shipping method before proceeding to Google, rather than just choosing the cheapest. This part will probably take me another few days as I know zero Ajax at the moment and Ajax is necessary since the XML will have to be repopulated after the shipping choice. The final step is the order and customer processing. Behind the scenes it adds rows to customers and orders once Google calls home via the callback API. If you want to get an idea of what's happening, and I'm embarassed to give out the link because you'll see that my site looks stock to the point of absurdity (my gf is working on a new template), check out http://www.officialclassicgames.com. Add an item to your cart, and then click on either "View Cart" or "Checkout." If you proceed to Google, you need to log in to your Google account before it actually populates the shipping and tax costs. But rest assured those came straight from my shipping modules and tax zones. The only real disconnect of my hack to the osCommerce world is that I'm short-circuiting the concept of registered customers. My customers no longer log in -- they simply fill up their cart and then proceed to Google. Tell me what you guys think. I know it's a bit radical to eliminate logins -- what do you guys think? Also, my hacks do make Google the only means of payment. Your Google checkout is just what I need! Do you think you will have a contrib put together? Quote Life Is Too Short, Enjoy Your Coffee! Pete Link to comment Share on other sites More sharing options...
graith Posted July 21, 2006 Share Posted July 21, 2006 Hi Brian As you are in the UK, do you know when Google checkout will be available here & when will your code be available as a contribution. I understand you need to cover your costs first. :thumbsup: Thanks Julie I'm not privvy to inside Google knowledge, but I'd be surprised if Google hold Google Checkout back from UK/Germany for more than a few months. I will put my own code level 2 code as a contribution when I've covered my development costs. I'd guess six months tops. There some screenshots of OSC with Google Checkout on graith dot com Quote Link to comment Share on other sites More sharing options...
Guest Posted July 21, 2006 Share Posted July 21, 2006 perhaps I am missing something, last time I checked the gbuy files they were released under apache license v2.0. And this from the www.gnu.org Apache Software License, version 2.0 This is a free software license but it is incompatible with the GPL. The Apache Software License is incompatible with the GPL because it has a specific requirement that is not in the GPL: it has certain patent termination cases that the GPL does not require. (We don't think those patent termination cases are inherently a bad idea, but nonetheless they are incompatible with the GNU GPL.) So how it will be integrated into a contribution with osc? unless google has a different set of files. Quote Link to comment Share on other sites More sharing options...
graith Posted July 21, 2006 Share Posted July 21, 2006 perhaps I am missing something, last time I checked the gbuy files they were released under apache license v2.0. And this from the www.gnu.org So how it will be integrated into a contribution with osc? unless google has a different set of files. The google checkout sample code are available free under the Apache license, but they don't integrate with OSCommerce. Google Checkout Level 1 and Level 2 is explained on Graith dot com. The integration with OSCommerce is what we're talking about. Quote Link to comment Share on other sites More sharing options...
jodo Posted July 22, 2006 Share Posted July 22, 2006 Brian, could you clarify that level2 can handle all the attributes associated with an order item and that it will be returned to the admin's order section. And that all attributes will be visible and recorded as all other orders in the oscommerce database. And that google "calls" back to get our low shipping for that order based on the zip code. (this info will come from ups or fedex) or it may be free if the minimum is met. I use the master produscts contrib. No problems, right? Quote Link to comment Share on other sites More sharing options...
hootsandtwinkles Posted July 23, 2006 Share Posted July 23, 2006 The mod look awesome and is exactly what I'm looking for. If you post the contrib or instructions for setting it up it would be great appreciated. j Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.