Has anyone tried to integrate GCO with MZMT (multi table multi zone) shipping that dreamscape made?
Printable View
Has anyone tried to integrate GCO with MZMT (multi table multi zone) shipping that dreamscape made?
Can anyone confirm if this has been resolved? This is also my major stumbling block. I cannot use GC unless it can support separate shipping policies for USA zone and international zone.
@ropu - do you see any daylight on this? I think you spoke previously that your team was working on this issue. Any news? Thanks.
For more info on the basic shipping configuration I refer to please see the "National and International Per Item Shipping" package at
http://www.zen-cart.com/index.php?ma...roducts_id=334
Woody
ropu, you can use attached file if you like. I have tested with ZC 137 and it seems to work fine. It is just your GCO 1.0.5 files with the orders.php and the three tpl_* files from ZC 1.3.7 (because of the "split" login in ZC137, the show_google_components part needs to appear at an additional place in tpl_login_default.php so that both GCO and PayPay buttons will show up on this split login page, if both methods are enabled), and responsehandler.php modified as suggested by BBG. In case both express payment methods are enabled, the page layout needs some work to align the buttons better on shopping cart page and split login page (for the latter, the text mentions only PayPal, it should mention GCO as well) And you may want to also use the split login page when GCO is enabled but PayPay is disabled.
These are minor issues. For me, the single major issue remains to be: INTERNATIONAL SHIPPING!! I hope somebody can shed some light on this.
Just thought I'd share my experience attempting to use coupons with GCO 1.0.5.
There's a section for adding coupons within the GCO website (Settings->Coupons). "Create and manage coupons to offer discounts to your customers", sounds easy! I added several coupons, and tried it out. Nope, didn't work. I tried to search for documentation regarding this coupon feature, but couldn't find anything at all. I couldn't find anything on the GC merchant forums either. I assume this just doesn't work since there's merchant calculations being done, but I wish I could have found some documentation saying so. If anyone found any documentation regarding using the GCO web admin coupon feature, I'd appreciate it if you could send me a link.
Moving on, I added some coupons in the ZC Coupon Admin and tried it out. It seemed to be working, however (isn't there always a however?), GCO completely ignored the minimum order restriction I specified with the coupon. So you could add any of the coupons regardless of the shopping cart total. So, I had to modify the the calculate_coupons() function within responsehandler.php to reject coupons if the shopping cart didn't reach the minimum order restriction. I only added 4 lines of code, but I've included the whole calculate_coupons() function for googlecheckout/responsehandler.php for those interested:
You can see the lines I've added within the // BBG Start and // BBG End comments.Code:function calculate_coupons($root, $data, &$merchant_result, $price=0) {
global $order, $db;
require_once(DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_general.php');
$currencies = new currencies();
require_once(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/discount_coupon.php');
$codes = get_arr_result($data[$root]['calculate']['merchant-code-strings']['merchant-code-string']);
//print_r($codes);
$first_coupon = true;
foreach($codes as $curr_code) {
$text_coupon_help = '';
//Update this data as required to set whether the coupon is valid, the code and the amount
$coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_code = '" . zen_db_input($curr_code['code']) . "' and coupon_type != 'G'");
if (!$first_coupon || $coupon->RecordCount() < 1) {
// invalid discount coupon code or more than one entered!
$text_coupon_help = $first_coupon?sprintf(TEXT_COUPON_FAILED,$curr_code['code']):'Sorry, only one coupon per order';
$coupons = new GoogleCoupons("false", $curr_code['code'],0, "USD", $text_coupon_help);
$merchant_result->AddCoupons($coupons);
// BBG Start - Invalid discount coupon if coupon minimum order is over 0 and the order total doesn't meet the minimum
} else if ($coupon->fields['coupon_minimum_order']>0 && $order->info['total'] < $coupon->fields['coupon_minimum_order']) {
$text_coupon_help = 'Sorry, the minimum purchase hasn\'t been reached to use this coupon';
$coupons = new GoogleCoupons("false", $curr_code['code'],0, "USD", $text_coupon_help);
$merchant_result->AddCoupons($coupons);
// BBG End
} else {
// valid discount coupon code
$lookup_coupon_id = $coupon->fields['coupon_id'];
$coupon_desc = $db->Execute("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . (int)$lookup_coupon_id . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'");
$coupon_amount = $coupon->fields['coupon_amount'];
switch ($coupon->fields['coupon_type']) {
case 'F':
$text_coupon_help = 'Discount Coupon: '.$curr_code['code'];
break;
case 'P':
$text_coupon_help = 'Discount Coupon: '.$curr_code['code'];
$coupon_amount = $coupon_amount * $order->info['total'] / 100;
break;
case 'S':
$text_coupon_help = 'Free Shipping Coupon: '.$curr_code['code'];
$coupon_amount = $price;
break;
default:
}
$get_result=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id='" . (int)$lookup_coupon_id . "' and category_id !='0'");
$cats = '';
while (!$get_result->EOF) {
if ($get_result->fields['coupon_restrict'] == 'N') {
$restrict = TEXT_CAT_ALLOWED;
} else {
$restrict = TEXT_CAT_DENIED;
}
$result = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and c.categories_id='" . $get_result->fields['category_id'] . "'");
$cats .= '<br />' . $result->fields["categories_name"] . $restrict;
$get_result->MoveNext();
}
if ($cats=='') $cats = TEXT_NO_CAT_RESTRICTIONS;
$get_result=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id='" . (int)$lookup_coupon_id . "' and product_id !='0'");
while (!$get_result->EOF) {
if ($get_result->fields['coupon_restrict'] == 'N') {
$restrict = TEXT_PROD_ALLOWED;
} else {
$restrict = TEXT_PROD_DENIED;
}
$result = $db->Execute("SELECT * FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'and p.products_id = '" . $get_result->fields['product_id'] . "'");
$prods .= '<br />' . $result->fields['products_name'] . $restrict;
$get_result->MoveNext();
}
if ($prods=='') $prods = TEXT_NO_PROD_RESTRICTIONS;
$coupons = new GoogleCoupons("true", $curr_code['code'],$coupon_amount,"USD", $text_coupon_help);
$merchant_result->AddCoupons($coupons);
$first_coupon = false;
}
}
}
Disclaimer: This modification was done to fill my particular need, so YMMV.
Shawn
Hi,
I fixed the erros I was recieving the other day. Now I am getting this one from sandbox.google.com Do I need to edit my responsehandler.php in some was to add this information? I can place orders, recieve the emails, and I can see the order in my admin but I can not getting the shipping charges pulled through.
Error: Error parsing XML; message from parser is: Unexpected element (div) encountered: div
Warnings: The namespace of all API requests and postings should be "http://checkout.google.com/schema/2", but this document has: "". Try <div xmlns="http://checkout.google.com/schema/2" ...> for your root element.
XML We Received: <div class="systemError">1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1<br />in:<br />[select products_id, products_weight from products p where products_id in ()]<br /></div>
hi, i dont think you have the latest version of admin/includes/functions/extra_functions/added_functions_for_google_checkout.php
have a look at line ~147 and change it for this code
look at the line 150,PHP Code:
if(isset($notify_comments)) {
$postargs = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<send-buyer-message xmlns=\"http://checkout.google.com/schema/2\" google-order-number=\"". $google_order. "\">
<message>". strip_tags($notify_comments) . "</message>
</send-buyer-message>";
fwrite($message_log, sprintf("\r\n%s\n",$postargs));
send_google_req($googlepay->request_url, $googlepay->merchantid, $googlepay->merchantkey,
$postargs, $message_log);
}
.PHP Code:
<message>". strip_tags($notify_comments) . "</message>
This eliminates html tags that are confused as part of the xml if sent in plain text. There is no sense to scape them because GC srv will strip them the same.
try this and send ur feedback
ropu
ropu, are you referring to:
Warning: Invalid argument supplied for foreach() in /admin/includes/functions/extra_functions/added_function_for_google_checkout.php on line 267
because that's the sql error I'm getting
By the way whoever coded to have GCO detect the other methods, I LOVE U!