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!!!



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.
