Forums / Built-in Shipping and Payment Modules / No Shipping Estimate Quote -- writing my own shipping module

No Shipping Estimate Quote -- writing my own shipping module

Locked

Views: 2,475

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
17 Sep 2008, 10:53 PM
#1
relentless avatar

relentless

New Zenner

Join Date:
Sep 2007
Posts:
56
Plugin Contributions:
0

No Shipping Estimate Quote -- writing my own shipping module

In a shipping module chmod default shows as chmod 0644
Read and write for owner, read for everybody else, chmod 0644

In shipping modules are both shipping files set to,
Everything for owner, read and execute for others
chmod("/some_shipping_dir/some_shipping_file_1", 0755)
chmod("/some_shipping_dir/some_shipping_file_2", 0755)
or only 755

will either of these three be selected,
for shipping modules.
Sticky bit, SUID, SGID
Thank You
Relentless

18 Sep 2008, 1:22 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: No Shipping Estimate Quote -- writing my own shipping module

What is wrong with the 644 setting? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Sep 2008, 12:52 AM
#3
relentless avatar

relentless

New Zenner

Join Date:
Sep 2007
Posts:
56
Plugin Contributions:
0

Re: No Shipping Estimate Quote -- writing my own shipping module

Thank you for pointing out to me that 0644 is not an issue.

What I see in my shipping Module now, line 37 to 52.
Line 54 to 72 is what I think is missing.
Module loads with no errors, to Admin., with yellow disabled

if (!zen_not_null($error_msg)) {
$base_URL = 'http://www.shippingcompany.shipco.com/XMLRating.jsp?';

37] function getFXFQuote($url) {
$isError = false;
$connectMethod = false;

  if (($fp = @fopen($url, "r"))) {
    $connectMethod = 'fopen';
    $data = fread($fp, 4096);
  } elseif (function_exists('curl_init')) {
    $connectMethod = 'curl';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 180);
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    $data = curl_exec($ch);		

52] }

54]function getFXFQuote($url) {
$isError = false;
$connectMethod = false;

  if (($fp = @fopen($url, "r"))) {
    $connectMethod = 'fopen';
    $data = fread($fp, 4096);
  } elseif (function_exists('curl_init')) {
    $connectMethod = 'curl';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 180);
    curl_setopt($ch, CURLOPT_URL, "http://mywebsite/shippingmodule.php"); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    $data = curl_exec($ch);
curl_close ($ch);
    fclose ($fp);

72] }

Thank You
Relentless

20 Sep 2008, 12:59 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: No Shipping Estimate Quote -- writing my own shipping module

You are posting code, but not the error message that you are getting ...

Could you post the error message and where you are when you get it?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Sep 2008, 3:11 AM
#5
relentless avatar

relentless

New Zenner

Join Date:
Sep 2007
Posts:
56
Plugin Contributions:
0

Re: No Shipping Estimate Quote -- writing my own shipping module

There are no errors,
but no Shipping Estimate Quote.
with product cost$ enabled, or with out.
There were a few errors, got rid of them.
This Module is installed in admin with yellow disabled.

Tried enable_error_logging.php

  • Tool for debugging hard-to-track-down issues
    [this file did not appear] /cache/myDEBUG-xxxxxxx.log folder .
    when I checked out, and got email order confirmation, no errors
    Order Confirmation from My web site [Order #4]
    There are no errors in error_log
    ====
    Do you think this will help
    Tip: If you are having trouble getting libcurl to do what you want,
    add the following code before closing the cURL handle:
<pre> <?php print_r(curl_getinfo($ch)); echo "\n\ncURL error number:" .curl_errno($ch); echo "\n\ncURL error:" . curl_error($ch); // ...close cURL handle ($ch) below ?> </pre>

This will force libcurl to report back on what happened on the last transfer,
making it easier to troubleshoot.

The link to this curl error report.
http://devzone.zend.com/node/view/id/1081

=============
In my Module code added, enable, force libcurl to report back.

function getFXFQuote($url) {
$isError = false;
$connectMethod = false;

  if (($fp = @fopen($url, "r"))) {
    $connectMethod = 'fopen';
    $data = fread($fp, 4096);
  } elseif (function_exists('curl_init')) {
    $connectMethod = 'curl';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 180);
    curl_setopt($ch, CURLOPT_URL, "http://mywebsite/shippingmodule.php"); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    $data = curl_exec($ch);

	<pre> 
<?php print_r(curl_getinfo($ch)); echo "\n\ncURL error number:" .curl_errno($ch); echo "\n\ncURL error:" . curl_error($ch); // ...close cURL handle ($ch) below ?> </pre> curl_close ($ch);/*assuming that this should be added, to mod file*/ fclose ($fp); /*assuming that this should be added, to mod file*/ } ------------ Shall I add these two lines to my shipping module. curl_close ($ch); fclose ($fp); ------------ Thank You Relentless Relentless research