Forums / Addon Payment Modules / Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

Locked
Results 1 to 13 of 13
This thread is locked. New replies are disabled.
11 Dec 2007, 07:50
#1
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

GOOGLE CHECKOUT MOD - places google checkout button on step 2 out of 3 on the zencart checkout. It gives google checkout the
total value and description of the purchase, thus eliminating the need for google to calculate tax and shipping (and eliminating all the errors that go along with that).
This is to go around the google checkout bug that screws up calculating shipping on zen cart purchases.

Another good thing is that you don't need to have google checkout enabled in zencart, this method simply gives information straight to your google checkout account.

THIS IS A BETA VERSION SO I WOULD LIKE TO REPEAT

PLEASE BACK UP FILES BEFORE MODIFYING!!!!
(don't say i didn't warn you)

PLEASE POST HERE ANY PROBLEMS / ISSUES AND I WILL TRY MY BEST TO ANSWER

By Serge Bronstein
Sebron Company
Fullerton, California
Date: 12-10-2007
We create online stores and do custom programming!
questions? --> "http://www.sebronco.com/services/contactus.php"


*************************************************************************************************************

Please backup original copies of files before modifying!
Files to backup:
\includes\templates\YOURTEMPLATE\templates\tpl_checkout_payment_default.php
\includes\templates\YOURTEMPLATE\templates\tpl_shopping_cart_default.php
\includes\templates\template_default\templates\tpl_modules_order_totals.php
\includes\templates\template_default\sideboxes\tpl_shopping_cart.php


Replace where it says YOURTEMPLATE with your template name
Replace MerchantID# with your google checkout merchant #


*********************************
In file \includes\templates\YOURTEMPLATE\templates\tpl_checkout_payment_default.php

after text:

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE_CHECKOUT, BUTTON_CONTINUE_ALT, 'onclick="submitFunction('.zen_user_has_gv_account($_SESSION['customer_id']).','.$order->info['total'].')"'); ?></div>
<div class="buttonRow back"><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '<br />' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></div>
<div align=right>

add:

<!-- Code by Sebron Company www.sebronco.com/services -->

<form method="POST" action="https://checkout.google.com/cws/v2/Merchant/MERCHANTID#/checkoutForm" accept-charset="utf-8" name=googlecheckout>
<!-- Product Name -->
<input type="hidden" name="item_name_1" value="Payment to ***YOUR COMPANY NAME ***"/>
<!-- Product Description -->
<input type="hidden" name="item_description_1" value="<?php echo $_SESSION['myproducts']." *** OPTIONS: ".$_SESSION['myoptions']." *** SHIPPING: ".$GLOBALS['myshipping'];?>">
<!-- Quantity -->
<input type="hidden" name="item_quantity_1" value="1"/>
<input type="hidden" name="item_price_1" value="<?php echo str_replace("$","",$GLOBALS['mytotal']);?>"/>
<!-- charset=UTF-8; Do not remove this line -->
<input type="hidden" name="_charset_"/>
<!-- Display Google Checkout button -->
<br>
<input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=421499532774289&w=180&h=46&style=white&variant=text&loc=en_US"
height="46" width="180"/>
OR
</form>
</p>
</div>
**********************************
in file \includes\templates\YOURTEMPLATE\templates\tpl_shopping_cart_default.php

after text:

/**
* Page Template
*
* Loaded automatically by index.php?main_page=shopping_cart.<br />
* Displays shopping-cart contents
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_shopping_cart_default.php 4140 2006-08-15 03:37:53Z drbyte $
*/

add:

$_SESSION['myoptions']='';

after text:

<?php
echo $product['attributeHiddenField'];
if (isset($product['attributes']) && is_array($product['attributes'])) {
echo '<div class="cartAttribsList">';
echo '<ul>';
reset($product['attributes']);
foreach ($product['attributes'] as $option => $value) {
?>

<li><?php

add:

$_SESSION['myoptions'].=$value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']);
************************************************

in file \includes\templates\template_default\templates\tpl_modules_order_totals.php

replace:

if ($GLOBALS[$class]->output[$i]['title']=="Total:"){
$GLOBALS['mytotal']=$GLOBALS[$class]->output[$i]['text']; }
if ((!stristr($GLOBALS[$class]->output[$i]['title'],"Total:"))&&(!stristr($GLOBALS[$class]->output[$i]['title'],"Tax"))){

with:

if ($GLOBALS[$class]->output[$i]['title']=="Total:"){
$GLOBALS['mytotal']=$GLOBALS[$class]->output[$i]['text']; }
if ((!stristr($GLOBALS[$class]->output[$i]['title'],"Total:"))&&(!stristr($GLOBALS[$class]->output[$i]['title'],"Tax"))){
$GLOBALS['myshipping']=$GLOBALS[$class]->output[$i]['title']; }

**************************************************************
in file \includes\templates\template_default\sideboxes\tpl_shopping_cart.php

after text:

/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cartt Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_shopping_cart.php 4821 2006-10-23 10:54:15Z drbyte $
*/

add:

$_SESSION['myproducts']="";

after text:

$content .= $products[$i]['name']. '</span></a></li>' . "\n";

add:

$_SESSION['myproducts'].=" *** ".$products[$i]['name'].$products[$i]['attribute'];
***************************************



THATS IT!!!
16 Dec 2007, 22:46
#2
v0903856 avatar

v0903856

New Zenner

Join Date:
Sep 2005
Posts:
41
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

hi serge111,
do I still have to have cURL on my server? My host says that they just upgraded their Cpanel and no longer support cURL or libcURL. If I still need it can I use PHP/cURL? When you say that you dont have to have google checkout enabled, do you still have to have the mod (beta 1.4.1) installed?
Thanks,
Sean
16 Dec 2007, 23:53
#3
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

v0903856:

hi serge111,
do I still have to have cURL on my server? My host says that they just upgraded their Cpanel and no longer support cURL or libcURL. If I still need it can I use PHP/cURL? When you say that you dont have to have google checkout enabled, do you still have to have the mod (beta 1.4.1) installed?
Thanks,
Sean


hi sean,

you just need to have a regular php/zen cart installation. you don't need to have google checkout installed or enabled in zencart, but you do need valid working google checkout account. (general account). all this does is use a custom google checkout form and submits the price and products names from the zen cart order.
17 Dec 2007, 05:06
#4
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

today found a small bug...doesn't display # of multiple purchases...will fix soon...for example if someone buys 5 of the same item, it doesn't show '5' in the purchase notes...only discovered this today after many purchases so it's not super duper important but i will fix soon...just need to find where zencart keeps that #...
21 Dec 2007, 20:48
#5
marcelo63 avatar

marcelo63

Zen Follower

Join Date:
Dec 2007
Posts:
125
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

Hi there,
This is a cool idea better than the google checkout module. Although works fine for me, is not included in the payment option and keeps looping back, which is no nice. Also like you state messing with the shipping and tax tables.

However i tried to implement this and did not work
1) Moved the left column to the right and the right was pushed down below
2) in the file tpl_module_order_totals.php

I have the following


<?php
/**
* Module Template
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_order_totals.php 2993 2006-02-08 07:14:52Z birdbrain $
*/
?>
<?php
/**
* Displays order-totals modules' output
*/
for ($i=0; $i<$size; $i++) { ?>
<div id="<?php echo str_replace('_', '', $GLOBALS[$class]->code); ?>">
<div class="totalBox larger forward"><?php echo $GLOBALS[$class]->output[$i]['text']; ?></div>
<div class="lineTitle larger forward"><?php echo $GLOBALS[$class]->output[$i]['title']; ?></div>
</div>
<br class="clearBoth" />
<?php } ?>




Which differs from the one provided by you.

Any help here?

I would love to implement this rather the google checkout

Sincerely
Marcelo
21 Dec 2007, 22:50
#6
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

i missed that file! sorry...ok here's what my file looks like...

includes/templates/template_default/templates/tpl_modules_order_totals.php

*******

<?php
/**
* Module Template
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_order_totals.php 2993 2006-02-08 07:14:52Z birdbrain $
*/
?>
<?php
/**
* Displays order-totals modules' output
*/

// added serge bronstein
for ($i=0; $i<$size; $i++) { ?>
<div id="<?php echo str_replace('_', '', $GLOBALS[$class]->code); ?>">
<div class="totalBox larger forward"><?php echo $GLOBALS[$class]->output[$i]['text']; ?></div>
<div class="lineTitle larger forward"><?php echo $GLOBALS[$class]->output[$i]['title']; ?></div>
<?php
if ($GLOBALS[$class]->output[$i]['title']=="Total:"){
$GLOBALS['mytotal']=$GLOBALS[$class]->output[$i]['text']; }
if ((!stristr($GLOBALS[$class]->output[$i]['title'],"Total:"))&&(!stristr($GLOBALS[$class]->output[$i]['title'],"Tax"))){
$GLOBALS['myshipping']=$GLOBALS[$class]->output[$i]['title']; }
?>
</div>
<br class="clearBoth" />
<?php } ?>

***************
21 Dec 2007, 23:06
#7
marcelo63 avatar

marcelo63

Zen Follower

Join Date:
Dec 2007
Posts:
125
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

Ok neighbour I am gonna try see what happens
30 Dec 2007, 21:32
#8
marcelo63 avatar

marcelo63

Zen Follower

Join Date:
Dec 2007
Posts:
125
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

marcelo63:

Ok neighbour I am gonna try see what happens


sorry I tried many times I give up is not working
- check put page shows my payment methods and close to checkout button the Google "badge" hence is not as located as payment options. chick on Google check out image goes no where and in fact pops up a warning that no payment has been selected.
Also in the script you declare a sandbox account which the "badge" does not work

<input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=421499532774289&w=180&h=4 6&style=white&variant=text&loc=en_US"
height="46" width="180"/>


1) My knowledge of ht ml and PHP is intermediate/ Novice. I just follow instruction pretty well, that's it. so I am sorry if I am dub on this.
2) good if someone (if not done alredy ) can adapt this module to Zen-Cart
addons.oscommerce.com/info/5157
3) Is a pain in the :censored: for us when processing Priority Handling, Gift Wrapping, Free shipping, Wholesale prices, and other discounts and coupons with Google as Check out Module. Also my people haddetected that if the customers sign up for an account with us, look around and come back again, they go to Google and select to have their email address "hidden" to the merchant, the return information creates a duplicate account.
4) Also I Would love to have s contribution Amazon Payments, which still in beta test will be a pain for PayPoopoo ) aka PayEnemy
addons.oscommerce.com/info/5628

Sincerely
Marcelo
www.ysandals.com
31 Dec 2007, 17:38
#9
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

that sandbox part is just an image...so it should be fine...i tried makin an account with your store and i didn't even see the GC button on the 2 of 3 page of checkout...can you upload everything and then email me [email protected] and i will take a look at your page...btw your store looks nice

also check out my signature links - you can list your products for free there with a froogle feed...you can produce a froogle feed for zencart by downloading and installing an "easy populate" mod
04 Jan 2008, 03:06
#10
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

ok here are the files as i have them, open zip and read the readme file thanks!

http://www.rottenemployer.com/files/gc.zip
04 Jan 2008, 10:40
#11
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

serge111:

ok here are the files as i have them, open zip and read the readme file thanks!


Serge-

I like the ideas you have going here.

It is good to support the standard ZC checkout process with Google Checkout (similar to PayPal IPN) as well as provide ability to click GC buttons on both the login and shop cart pages (similar to PayPal Express).

Ropu has stated he would like to support the same but much refactoring of the code would be required to do it correctly.

I assume you are applying latest code changes to a GC mod version previously released by Ropu? If so which previous version of the GC mod have you integrated/tested your latest modifications?

Do you have a public site where your modifications are working and can be demo'd or tested?

Thanks for any info.

Woody
05 Jan 2008, 01:26
#12
serge111 avatar

serge111

New Zenner

Join Date:
Apr 2007
Posts:
57
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

hi,

this works completely independent of the zencart google checkout module, you do not need to have it installed, however, you have to have a google checkout account. it simply uses the custom payment form method to submit information to google...the version of zencart that i have this on is 1.3.7

yes, it's working on http://www.sebronco.com

the only known bug is that it doesn't display item multiples, ie if someone ordered 5 of some product...i will fix this soon (just didn't have time). it's not a big bug, ive been using the code for over a year with no problems.

i know this is advertisement, but please checkout http://www.buyverify.com,
it's a free product search engine, uses froogle feed...trying to get that site going...thanks!
09 Jan 2008, 19:07
#13
marcelo63 avatar

marcelo63

Zen Follower

Join Date:
Dec 2007
Posts:
125
Plugin Contributions:
0

Re: Google Checkout Mod for Zen Cart (NEW) -- Quick GC Button

Now I understand why it did not work for me.
I am running 1.3.8a Have many issues and both templates Apple-Zen and Cherry Zen. did some modifications and works partially. Also you CAN NOT have in google account setting both Google check out and this modification. Otherwise will pop up and error on Google account.
The reason is or either your account will receive Google Checkout Payments or single Item Payments according to Google.
This modification is a Single Payment Button modified and grabbing the cart information, in which Google TOS (Term of a Service) makes very clear they DO NOT WANT this.

http://checkout.google.com/seller/checkout_buttons.html

OS commerce people have abandoned too this modification and they also are concerned about Google consequences in modify the use of buttons badges.
Although I need this and love this idea and Serge helped a lot I have to give up too, do not like the idea of getting the account closed.