Hi folks,
I've just completed a level 1 integration of Google Checkout in a 2.3 store. Thought I'd throw in my 2 cents in case it is of any use to anyone.
I used the same package as Alan, but on a modified store so can't provide line numbers.
The problem some people are getting with the shopping cart button is that it's placed within the update cart form if you follow the instructions. It needs to be outside this form, so I placed it here.
catalog/shopping_cart.php
<p align="right"><?php echo $value; ?></p>
<?php
}
}
?>
</div>
</form>
<?php
// *** BEGIN GOOGLE CHECKOUT ***
if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS') && MODULE_PAYMENT_GOOGLECHECKOUT_STATUS == 'True') {
include_once('googlecheckout/gcheckout.php');
}
// *** END GOOGLE CHECKOUT ***
} else {
?>
<div class="contentContainer">
<div class="contentText">
<?php echo TEXT_CART_EMPTY; ?>
I placed the addition in the login script before the closing require calls;
catalog/login.php
</form>
</div>
</div>
<?php
// *** BEGIN GOOGLE CHECKOUT ***
if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS') && MODULE_PAYMENT_GOOGLECHECKOUT_STATUS == 'True') {
include_once('googlecheckout/gcheckout.php');
}
// *** END GOOGLE CHECKOUT ***
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
The additions to admin/orders.php and /admin/includes/functions/general.phpare the same as Alan's. The admin/modules.php script has an additional edit;
catalog/admin/modules.php
if (tep_not_null($action)) {
switch ($action) {
case 'save':
// *** BEGIN GOOGLE CHECKOUT ***
require(DIR_FS_CATALOG . 'googlecheckout/inserts/admin/modules2.php');
// *** END GOOGLE CHECKOUT ***
reset($HTTP_POST_VARS['configuration']);
I would suggest not using the gc_return.php script as it's using the 2.2 layout. I just created a replacement script for 2.3 that displays a message and empties the cart. You may wish to include the text content in a language definition.
<?php
require('includes/application_top.php');
require(DIR_WS_INCLUDES . 'template_top.php');
?>
<h1><?php echo "Thankyou for your order through Google Checkout." ?></h1>
<div class="contentContainer">
<div class="contentText">
<p>Thank you for buying with <img src="http://checkout.google.com/seller/images/google_checkout.gif" /></p>
<p>Please <a href='contact_us.php'>contact us</a> if you have any queries, we will process your order shortly.</p>
</div>
<div class="buttonSet">
<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?></span>
</div>
</div>
<?php
$cart->reset(true);
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
For the config of the payment module, don't forget to actually install it. There's a few posts scattered around the web that seem to have missed this step. Once you have your ID and key populated for the sandbox/live checkout, open the advanced settings for the module. If, like me, you rename your admin directory, the API callback URL listed may be incorrect (although this didn't affect me as I'm not using a level 2 integration).
If you have created another page instead of gc_return.php, enter the name of that script in the "continue shopping URL" at the end of the advanced settings page.
You may also want to add a class to the additional text for the Google checkout button so you can style it. This is in the catalog/googlecheckout/gcheckout.php script.
$google_analytics_id = gc_get_configuration_value($config->googleAnalyticsId());
if ($google_analytics_id != $config->nullValue()) {
$Gcart->AddGoogleAnalyticsTracking($google_analytics_id);
}
?>
<div align="right">
<?php
echo '<div class='gcAddTxt' style="width: 180px; text-align: center;"><b>' . MODULE_PAYMENT_GOOGLECHECKOUT_TEXT_OPTION . '</b></div>';
?>
Hopefully someone will find this of some use, it's a messy "plugin".
Baps.