Re: Google Checkout module for Zen Cart (beta)
Quote:
Originally Posted by
ladyink
Lines 38 thru 45:
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
I can make that error go away by changing:
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
to
if (!function_exists('selfURL')) {
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
}
and that's when I get this error:
Fatal error: Cannot redeclare strleft() (previously declared in /home/XXXXX/public_html/googlecheckout/gcheckout.php:46) in /home/XXXXX/public_html/googlecheckout/gcheckout.php on line 46
I promise that I have really tried (and tried) to fix this!!
Thanks
Nancy
I guess I should have added line 46 in there:
it's only
}
Thanks
Re: Google Checkout module for Zen Cart (beta)
Quote:
Originally Posted by
ladyink
Well, I have completely reinstalled and now I'm back to:
Fatal error: Cannot redeclare selfurl() (previously declared in /home/xxxxx/public_html/googlecheckout/gcheckout.php:39) in /home/xxxxx/public_html/googlecheckout/gcheckout.php on line 38
Any other thoughts??
Nancy
This can mean that there are 2 copies of the file with that function in your installation.
Re: Google Checkout module for Zen Cart (beta)
Quote:
Originally Posted by
chain_man
This can mean that there are 2 copies of the file with that function in your installation.
I agree- and that subject has been discussed several times over the last couple of years. There is only one copy of this file on my server. I can make this error go away by changing the code to (which I found posted here):
if (!function_exists('selfURL')) {
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
}
But then I get this error:
Fatal error: Cannot redeclare strleft() (previously declared in /home/XXXXX/public_html/googlecheckout/gcheckout.php:46) in /home/XXXXX/public_html/googlecheckout/gcheckout.php on line 46
FYI Lines 46- 48 are:
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
}
I don't have clue how to fix that!! I've tried commenting it out and that didn't work- I'm not giving up!!
Thanks
Nancy
Re: Google Checkout module for Zen Cart (beta)
how can i get this to work with the table rate shipping modual??????
Re: Google Checkout module for Zen Cart (beta)
Reply from Google
Thank you for your email. I understand that you have currently
integrated
with Google Checkout through Zen Cart and are experiencing problems
with
the calculation of shipping cost in your account
This issue is apparently occurring because the shipping tags are not
correctly implemented into your Checkout API request. To perform
custom
calculations for an order before your customer confirms a purchase,
you
must include the <merchant-calculations-url> tag in your Checkout API
request. The <merchant-calculations-url> tag's value is the URL to
which
Google Checkout will send requests for merchant calculations.
See the page
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_AP...
for reference on this issue.
Because Zen Cart has integrated your Google Checkout solution, they
are
best able to address the causes of this issue. Please forward this
information regarding the errors that you are receiving to Zen Cart
for
the fastest resolution to this issue.
found here http://groups.google.com/group/googl...4b38077c34a837
Re: Google Checkout module for Zen Cart (beta)
shipping gen for GC not work right either.
with weight price and items set to 1 with table rate of 0.5:0.87,9:4.34,39:13.03,69:17.38,149:21.73,299:26.08,499:34.77,1000:39.12 i get the shipping price of 13.03
how does it make 13.03 for item weighting 1???
Re: Google Checkout module for Zen Cart (beta)
yep, this is a major issue for me too, I haven't been able to get GC to work with table rates.. just returns 0...
I have no idea why
Re: Google Checkout module for Zen Cart (beta)
Quote:
Originally Posted by
ladyink
I agree- and that subject has been discussed several times over the last couple of years. There is only one copy of this file on my server. I can make this error go away by changing the code to (which I found posted here):
...
I don't have clue how to fix that!! I've tried commenting it out and that didn't work- I'm not giving up!!
Thanks
Nancy
Well, I've made progress. It's boils down to the location of the code that is supposed to be added to the tpl_shopping_cart_default.php page!!!
<!-- * BEGIN GOOGLE CHECKOUT * -->
<?php
// ** GOOGLE CHECKOUT **
include(DIR_WS_MODULES . 'show_google_components.php');
// ** END GOOGLE CHECKOUT **
?>
<!-- * END GOOGLE CHECKOUT * -->
I've made some changes to that page (zencartoptimization) and now I don't know where to put the Google checkout code. I went back to the original tpl_shopping_cart_default.php and I no longer have the issue. If anyone has any thoughts for where I should try, I'll gladly give it a go!
Thanks
Nancy
Re: Google Checkout module for Zen Cart (beta)
Quote:
Originally Posted by
ladyink
Well, I've made progress. It's boils down to the location of the code that is supposed to be added to the tpl_shopping_cart_default.php page!!!
<!-- * BEGIN GOOGLE CHECKOUT * -->
<?php
// ** GOOGLE CHECKOUT **
include(DIR_WS_MODULES . 'show_google_components.php');
// ** END GOOGLE CHECKOUT **
?>
<!-- * END GOOGLE CHECKOUT * -->
I've made some changes to that page (zencartoptimization) and now I don't know where to put the Google checkout code. I went back to the original tpl_shopping_cart_default.php and I no longer have the issue. If anyone has any thoughts for where I should try, I'll gladly give it a go!
Thanks
Nancy
OK, I fixed it so I'm here to post for all!!
Basically, it came down to the fact that the Google code listed above was already on my page- just not marked with** so I didn't recognize it. So I removed the extra code that I had placed there (as per the Google Checkout installation instructions). When I did, I did not get the error message when the cart was empty but the Google Checkout button was not visible. I had to move that line of code. Of course I can't tell you where because not all of us have the same code and I'm lucky enough to have fixed this but I don't quite have enough experience to explain it!
I hope this helps someone!
Nancy
Re: Google Checkout module for Zen Cart (beta)
I am using zencart 1.38a, and using Advanced shipper module (paid version) But it is not working with GC. Did anyone get it working with GC. Please let me know. I really have a hard time with it. Any help will be really appreciated.