Jump to content
Latest News: (loading..)
rickheck

MVS Shipping Estimator - no estimate for multiple items in cart

Recommended Posts

Just installed MVS Shipping Estimator version 2.2.2 20100309 on www.trexgenerators.com . The instructions/mods were carefully followed and verified.

 

Problems:

 

1) If I add two accessory items, and then "estimate shipping" from the shopping cart, the popup will display. I enter the ZIP code (84075), click the estimate button, and no shipping value is returned. If there is only one item in the shopping cart, the estimate will show properly.

 

2) If I have only one item in the shopping cart, there are times where no estimate is returned, not even an error/info message. I just get the "zipcode/country" form again.

 

You can test on the site www.trexgenerators.com , but use 'accessories' items, and they are the only ones that have shipping costs (other items have free shipping).

 

THanks...Rick...

Share this post


Link to post
Share on other sites

It's working for me. Do you have an example of two products that do not return a result? Which UPS module are you using?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

It's working for me. Do you have an example of two products that do not return a result? Which UPS module are you using?

 

Regards

Jim

 

Thanks for the quick reply. On the site, go into the Accessories section, and add any two accessory items to the shopping cart. Then

 

- click on the Shipping icon in the center (shopping cart) area (icon has been changed), fill in a zip code (I've used 84075 and 95821), click Get Quote, and no value returned.

 

- or, click on shipping icon on right column, same procedure, same results.

 

- and then, remove one item from the shopping cart, try again, same procedure, same (no) results.

 

Observe, as you try the above steps, that the estimate screen doesn't have the "Close" prompt at the bottom.

 

Now, close that window, open up a new window, go to the site, display any accessory, chose "shipping" icon, enter zip code, click button, shipping estimate is shown. (Notice that the "close" prompt is shown.)

 

Not sure where to find UPS shipping module info....

 

Hope this info helps....Rick...

Share this post


Link to post
Share on other sites

When I tried this the first time it always worked. Now it's not working. The address bar now changes to include action=ship_error, which tells me the shipping module is not working correctly, or some other error is occurring. Unfortunately osCommerce does not have a good way of handling errors.

 

MVS contains two UPS shipping modules: the stock UPS (actually UPS Choice) and UPSXML. UPSXML is more reliable but harder to set up. Both have issues if not set up correctly.

 

Does shipping work reliably if you go through the checkout process with the same products?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Shipping costs are displayed properly when I get to the checkout area (checkout_shipping.php).

 

Where do I determine the shipping modules used?

 

THanks...Rick...

Share this post


Link to post
Share on other sites

Admin > Vendors > Vendor Manager > [select your vendor] > Manage.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Most vendors are set up with UPS. As an example, add some "Reliance" devices to your shopping cart (use "Reliance" link on left column to get their products.) Reliance set up with UPS.

 

If you have more than one "Reliance" product in your shopping cart, the shipping estimator popup will not have a 'close' button, nor will it compute the shipping value (when you access shipping estimator from the shopping cart page).

 

If you try the shipping estimator from the product page, the shipping charges will display.

 

A new discovery: if you first do a shipping estimate from the product page, that will display shipping OK. From that point on, shipping will display properly in the shopping cart, even for multiple items. But if you start a new session, add two items to shopping cart, then shipping estimate from shopping cart, no estimate is displayed (and the shipping estimate screen will not have a 'close' button). If you then go to a product page, then shipping estimate will display properly. And then shipping will display on the shopping cart page also.

 

So if you get shipping to display properly from the product page, shipping estimate will work OK from then on.

 

On a new session if you add products, go to shopping cart, then try shipping estimate, no good (and no close button). Shipping estimate only seems to work OK if you first try shipping estimate from product page.

 

...Rick...

Share this post


Link to post
Share on other sites

The customer's ZIP code and other data is kept in session variables. If the code works once, it will continue to work as long as the session is valid. Apparently the product estimator is setting these variables correctly while the one in the shopping cart is not. This is a puzzle, since they use essentially the same code to do this.

 

Try this: in catalog/ship_estimator.php, find these lines [45-49]:

          if (!tep_not_null ($_POST['shippostcode']) ) $error_code .= '&error_shippostcode=1';
         if (!tep_not_null ($_POST['shipzone']) && SHIP_ESTIMATOR_USE_ZONES == 'true') $error_code .= '&error_shipzone=1';
         if (!tep_not_null ($_POST['shipcountry']) ) $error_code .= '&error_shipcountry=1';
         tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=ship_error' . $error_code, 'NONSSL'));
         exit; // Don't do anything else

and comment them out. Then start a new session and try the cart estimator again.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

That seemed to work: adding two "Reliance" items to the shopping cart, then shipping quote, then enter zip code, click button.....that displayed the shipping quote for the two items.

 

I did notice that the shipping quote popup window does not display the "Close button", and there is also not a "Change address" button displayed. Those buttons will display when you do shipping quote from a product window; they do not display from the shopping cart window.

 

So...getting closer...

 

...Rick...

Share this post


Link to post
Share on other sites

That last change just disabled error checking. This proves that an error is being generated, which then means that the data from the form is not being passed correctly. Are you using any sort of security Addon that checks/cleans $_POST variables?

 

Also try changing Line 14 of that file to

  $debug = 'yes';

Please post the output from that here (after starting a new session.)

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Screen output after adding two items to shopping cart, then doing the estimate on the shopping cart page:

 

the action is: process

the $customer_id is:

the shipping cost from the cart

the county array id from the cart 223

the delivery zipcode from the cart 84075

the shipping title from the cart

the order->info tax: 0

the POSTED shipping:

the shipping from $order->info[]:

the subtotal: 138.95

the shipping tax:

the $shippostcode: 84075

the $shipcountry: 223

 

....but I think that you need me to re-enable the error checking (that was previously commented), so...I uncommented those lines, opened a new browser session, added 2 items, then shipping estimate from the shopping cart

 

the action is: ship_error

the $customer_id is:

the shipping cost from the cart

the county array id from the cart

the delivery zipcode from the cart

the shipping title from the cart

the order->info tax:

the POSTED shipping:

the shipping from $order->info[]:

the subtotal:

the shipping tax:

the $shippostcode:

the $shipcountry:

 

 

...Rick...

Share this post


Link to post
Share on other sites

Yes, I did need that with the error checking. It shows what I thought it would -- the ZIP code and country are not getting sent. It's also no help. Oh well.

 

I'm pretty much out of ideas at this point. This code works on every machine I have access to right now, and it works for many other people as well. There is something in your setup that is breaking it, and I have no way to find out what that is. You'll need to do some debugging yourself.

 

One further hint: The Close button is not an option -- it's always shown. If you're not seeing it, the page is likely halting on an error before it gets to that point. The failure to pass the customer's input values may also be due to a hidden error. Turn on all errors in osCommerce or look at your error log. Error messages would be very helpful at this point.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Below is the page source for shipping estimate from the pop-up page, before the zip code is entered (code formatted/indented via ColdFusion). Notice there are some orphan table rows and end-table code. That could be why the close button is not displaying, and therefore perhaps why the estimator is not working.

 

<script language="javascript" type="text/javascript"> 
<!--
function popup(url) {
window.open(url,'name','height=300,width=250');

}

// -->
</script>


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>T-Rex Generators</title>
 <base href="https://ssl4.westserver.net/trexgenerators.com/">
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="3">
<!-- heading //-->
 <tr>
   <td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td align="center" class="pageHeading"><b>Shipping Estimator</b></td>
     </tr>
     <tr>
       <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10" /></td>
     </tr>
   </table></td>
 </tr>
<!-- heading_eof //-->


<!-- ship-to_form //-->
 <tr>
   <td>
   <form name="est_shipping_id" action="https://ssl4.westserver.net/trexgenerators.com/ship_estimator.php?action=process&osCsid=11faa9761efcfedb575056e31e0523e3" method="post">    <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
     <tr class="infoBoxContents">
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td colspan=2 class="main"><b>Shipping Address:</b></td>
         </tr>
         <tr>
           <td class="infoBoxContents">Post Code:</td>
           <td class="infoBoxContents"><input type="text" name="shippostcode"> <span class="inputRequirement">* Required information</span></td>
         </tr>
         <tr>
           <td class="infoBoxContents">Country:</td>
           <td class="infoBoxContents"><select name="shipcountry"><option value="">Please Select</option><option value="223" SELECTED>United States</option></select> <span class="inputRequirement">* Required information</span></td>
         </tr>
         <tr>
           <td class="infoBoxContents"></td>
           <td class="infoBoxContents"><input type="image" src="includes/languages/english/images/buttons/button_process_quote.gif" border="0" alt="Click to get a shipping quote" title=" Click to get a shipping quote "></td>
         </tr>
       </table></td>
     </tr>
   </table></form></td>
 </tr>
<!-- ship-to_form_eof //-->

       </table></td>
     </tr>
   </table></td>
 </tr>
<!-- quote_eof //-->


<!-- close_window //-->
 <tr>
   <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10" /></td>
 </tr>
 <tr>
   <td>
     <p class="smallText" align="center">
     <a href="http://www.trexgenerators.com/ship_estimator.php?action=end&osCsid=11faa9761efcfedb575056e31e0523e3"></a>      </p>
   </td>
 </tr>
<!-- close_window_eof //-->
</table>

</body>
</html>

Share this post


Link to post
Share on other sites

I did a comparison against a working version of this popup. The only significant difference that I can see is the Javascript at the top of yours. That isn't needed, but it shouldn't harm anything.

 

The additional closing Table tags appear in the working version as well. You can remove them, but I doubt that's the problem.

 

Oh, and ColdFusion appears to be inserting XHTML markup into a HTML 4.01 document. That's a sign of a broken editor.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

I am having the same issue with the pop-ups. I have added it to my product_info and shopping_cart but it only seems to work after I put an item in the cart and then click for an estimate. The button on the product info page opens the pop-up but creates an error when the zip and country are submitted.

Also, for the missing close button issue, I have found that the code calls for the button image as a .jpg but all the new images are .gif.


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

I need to know what the error message is. I can't duplicate this error, so I can't find it for myself. Look in your error logs, or turn on All errors in application_top.php, and get me an error message.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Ok sorry for the delay. The error only occurs on the product info page when you click the shipping estimate button. I noticed that the button in product_info is pulling the code from products_ship_estimator.php while the button in the cart is pulling from ship_estimator.php.

The error I get in product info is:Error: Product was not found. Please close this window and try again.

Hope this helps.

P.S. Any updates on the Product Specifications Mod?


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

No, I need the PHP error message. I already know that the code is generating an error, I just don't know what it is.

 

I need to post some updates on Product Specifications. I just don't have time right now to put the update together.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

No, I need the PHP error message. I already know that the code is generating an error, I just don't know what it is.

 

I need to post some updates on Product Specifications. I just don't have time right now to put the update together.

 

Regards

Jim

 

I'm having the exact same problem as lyonsperf (Matt). There are no PHP errors per se. Things seem to go downhill from this point in products_ship_estimator.php:

 

Line 30: $products_id = (int) $_GET['pid'];

 

The result is the empty string. If I can be of further assistance, let me know.

Share this post


Link to post
Share on other sites

I can't help you without more information. This is working just fine on several sites, and my test server also works. Unless you can be bothered to turn on ALL errors, or read your site server's error log, there is nothing I can do.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Anybody solve this? I'm having the same problem with the empty string.

 

I'm having the exact same problem as lyonsperf (Matt). There are no PHP errors per se. Things seem to go downhill from this point in products_ship_estimator.php:

 

Line 30: $products_id = (int) $_GET['pid'];

 

The result is the empty string. If I can be of further assistance, let me know.

Share this post


Link to post
Share on other sites

Yes, I did need that with the error checking. It shows what I thought it would -- the ZIP code and country are not getting sent. It's also no help. Oh well.

 

I'm pretty much out of ideas at this point. This code works on every machine I have access to right now, and it works for many other people as well. There is something in your setup that is breaking it, and I have no way to find out what that is. You'll need to do some debugging yourself.

 

One further hint: The Close button is not an option -- it's always shown. If you're not seeing it, the page is likely halting on an error before it gets to that point. The failure to pass the customer's input values may also be due to a hidden error. Turn on all errors in osCommerce or look at your error log. Error messages would be very helpful at this point.

 

Regards

Jim

 

The Close button does not show in mine either. The problem is here in /catalog/ship_estimator.php

 

About line 888 it reads:

<?php echo '<a href="' . tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=end', 'NONSSL') . '">' . tep_image_button('button_close_window.jpg', IMAGE_BUTTON_CLOSE) . '</a>'; ?>

 

The problem is the "button_close_window.gif" is the file we uploaded, it is not a .jpg format file. So, just change .jpg to .gif and your "Close" button will show.

 

I'm having same problem as Matt in the shopping cart "What's In My Cart?" section, pre-login /catalog/shopping_cart.php?osCsid=a5ec130564b183c1d42dff893fafd73a This is very confussing for my customers!

 

Ship Estimator 2.2.2 will not calculate shipping if shipping was not calculated prior to pressing the "Buy Now" button in the individual items listing. In the "What's In My Cart?" section, I get no error, same window reloads waiting for zipcode and country. But the URL does have the word "error" in it: /catalog/ship_estimator.php?action=ship_error&osCsid=a5ec130564b183c1d42dff893fafd73a

Share this post


Link to post
Share on other sites

Well, I was experiencing the same thing as Matt when I installed Ship Estimator 2.2.2. Could'nt seem to find an answer, so just studied over things a bit. I'm not a Professional by no means, so back up your original files before you try this. But, this seems to work for me as guest not logged in and with test logins. I found the product section estimator would work okay from /catalog/products_ship_estimator.php so I copied the following from it, which start at about line 45.

 

switch ($action) {

case 'process':

//Error if customer is not logged in and address is not set

if (!tep_session_is_registered ('customer_id') && (!tep_session_is_registered ('shippostcode') || !tep_session_is_registered ('shipcountry') || (!tep_session_is_registered ('shipzone') && SHIP_ESTIMATOR_USE_ZONES == 'true') ) ) {

$error_code = '';

if (!tep_not_null ($_POST['shippostcode']) || !tep_not_null ($_POST['shipcountry']) ) {

if (!tep_not_null ($_POST['shippostcode']) ) $error_code .= '&error_shippostcode=1';

if (!tep_not_null ($_POST['shipzone']) && SHIP_ESTIMATOR_USE_ZONES == 'true') $error_code .= '&error_shipzone=1';

if (!tep_not_null ($_POST['shipcountry']) ) $error_code .= '&error_shipcountry=1';

tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=ship_error' . $error_code, 'NONSSL'));

exit; // Don't do anything else

} //if (!tep_not_null

} //if (!tep_session_is_registered

 

 

*******Next I opened /catalog/ship_estimator.php (the file with the problem) and hunted for the following which was very similar but not quit the same. It starts around line 41. Next, I deleted the below and replaced it with the above in /catalog/ship_estimator.php and now I don't seem to have Matt's problem. PLEASE NOTE: I already did change the words above - FILENAME_PRODUCTS_SHIP_ESTIMATOR to FILENAME_SHIP_ESTIMATOR - to go with the /catalog/ship_estimator.php file it is going into.

 

switch ($action) {

case 'process':

if (!tep_session_is_registered ('customer_id') && (!tep_session_is_registered ('shippostcode') || !tep_session_is_registered ('shipcountry') || (!tep_session_is_registered ('shipzone') && SHIP_ESTIMATOR_USE_ZONES == 'true') ) ) {

$error_code = '';

if (!tep_not_null ($_POST['shippostcode']) ) $error_code .= '&error_shippostcode=1';

if (!tep_not_null ($_POST['shipzone']) && SHIP_ESTIMATOR_USE_ZONES == 'true') $error_code .= '&error_shipzone=1';

if (!tep_not_null ($_POST['shipcountry']) ) $error_code .= '&error_shipcountry=1';

tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=ship_error' . $error_code, 'NONSSL'));

exit; // Don't do anything else

} //if (!tep_session_is_registered

Edited by NDboots

Share this post


Link to post
Share on other sites

has anyone get it works with UPS XML service yet? I have to install the 2.2.2 version to work with canada post, but it doesn't works with ups xml, it only calculate with weight, not dimension.

ken

Share this post


Link to post
Share on other sites

I just installed 2.2.3 today and ran into similar errors that others were having. The code below from ship_estimator.php starts around line 42:

 

   case 'process':
     if (!tep_session_is_registered ('customer_id') && (!tep_session_is_registered ('shippostcode') || !tep_session_is_registered ('shipcountry') || (!tep_session_is_registered ('shipzone') && SHIP_ESTIMATOR_USE_ZONES == 'true') ) ) {
       $error_code = '';
         if (!tep_not_null ($_POST['shippostcode']) ) $error_code .= '&error_shippostcode=1';
         if (!tep_not_null ($_POST['shipzone']) && SHIP_ESTIMATOR_USE_ZONES == 'true') $error_code .= '&error_shipzone=1';
         if (!tep_not_null ($_POST['shipcountry']) ) $error_code .= '&error_shipcountry=1';

         tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=ship_error' . $error_code, 'NONSSL'));
         exit; // Don't do anything else

     } //if (!tep_session_is_registered

 

I'm not a PHP developer by any means. So take this with a grain of salt. It seems to me in this section of code, that if customer_id isn't valid, along with some combination of shippostcode, shipcountry and shipzone (but only if ship_estimator_use_zones is true), then it attempts to set the values for shippostcode, shipzone and shipcountry with the $_POST.

 

That $_POST may well have been successful, but no matter because the next line of code redirects with an error. Therefore, in order to get mine working (your mileage may vary), I added a check before redirecting. So, if the $error_code doesn't get set to something, there is actually no error and processing can proceed.

 

   case 'process':
     if (!tep_session_is_registered ('customer_id') && (!tep_session_is_registered ('shippostcode') || !tep_session_is_registered ('shipcountry') || (!tep_session_is_registered ('shipzone') && SHIP_ESTIMATOR_USE_ZONES == 'true') ) ) {
       $error_code = '';
         if (!tep_not_null ($_POST['shippostcode']) ) $error_code .= '&error_shippostcode=1';
         if (!tep_not_null ($_POST['shipzone']) && SHIP_ESTIMATOR_USE_ZONES == 'true') $error_code .= '&error_shipzone=1';
         if (!tep_not_null ($_POST['shipcountry']) ) $error_code .= '&error_shipcountry=1';

         if ($error_code != '') {
             tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=ship_error' . $error_code, 'NONSSL'));
             exit; // Don't do anything else
         }
     } //if (!tep_session_is_registered

 

Again, I'm not a PHP developer. Maybe there's a deeper issue and my solution just masked it.

 

FWIW, the original solution, as well as this one works fine with USPS XML.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×