Forums / Bug Reports / [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

[DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Locked

Views: 5,391

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
8 May 2008, 5:44 PM
#1
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

[DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Hi!

I'm having issues on a site I'm working on.

I have USPS, FedEx, and ZipShip shipping modules turned on. I have shipping estimator set to show ON the shopping cart page.

I'm having issues where the shipping estimator doesn't bold the absolute cheapest option. After doing some testing, it seems that if I am logged in, then the SHIPPING ESTIMATOR always bolds the cheapest USPS option, even though there are other shipping options that are cheaper. If NOT logged into my account, it works correctly and WILL BOLD the cheapest option of them all.

When logged in, and I press "checkout", it DOES pre-select the cheapest option as it should. The error only occurs when logged in, when viewing the shipping estimator.

8 May 2008, 7:46 PM
#2
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Update:

The issue seems to happen when you have two shipping addresses. If you choose Address A as the shipping estimator address, it will highlight the cheapest option. If you shift to address B, it won't highlight the cheapest shipping for address B, it will keep the option that was cheapest for Address A highlighted. If I delete shipping address A, I still have to log out and back in for the cheapest rate for address B to be highlighted.

SO, perhaps its an updating issue, zen cart isn't recalculating the "Cheapest" every time? I guess this won't happen for everyone, but perhaps a guru can see what the error is.

8 May 2008, 8:21 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

I have found this true between National and International rates so far ...

I will have to play with this further ... this has been moved to Bug Reports, thanks! :smile:

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!

30 Oct 2009, 6:35 PM
#4
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

I have a similar problem and wondering if the bug has been fixed. I have enabled flat rate, now when we estimate, flat rate is always bolded even if it is not the cheapest way to ship. But I only have 1 shipping address not like the above post.

Let me know if anyone has solved this.

22 stores and counting! Ive been zenned.

30 Oct 2009, 7:14 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

What are all of the Shipping Module(s) that you are using?

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!

30 Oct 2009, 7:27 PM
#6
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Store Pickup
Flat Rate

United States Postal Service (1 x 7.18lbs) United States Postal Service

Express Mail (1 - 2 days)
Priority Mail (2 - 3 days)

United Parcel Service (1 x 7.18lbs) United Parcel Service
UPS
Next Day Air Early AM
Next Day Air Saver
2nd Day Air
3 Day Select
Ground

FedEx Ground
FedEx Home Delivery®
FedEx Express
FedEx First Overnight®
FedEx Priority Overnight®
FedEx Standard Overnight®
FedEx 2Day®
FedEx Express Saver®

Freeshipper

here is a screenshot http://www.mendweb.com/zcerror1.gif

using 1.3.7

22 stores and counting! Ive been zenned.

30 Oct 2009, 8:51 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

I will have to try to find an old v1.3.7 as I cannot recall off hand what issues there are with it on shipping ...

NOTE: You should still check that you're using the updated May 2008 USPS shipping module, referenced on the Security Patches:
http://www.zen-cart.com/forum/showthread.php?t=131115

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!

31 Oct 2009, 3:41 AM
#8
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Ok - let me know what you find. Do you think upgrading to 1.3.8a will solve the problem?

22 stores and counting! Ive been zenned.

31 Oct 2009, 4:17 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Good chance it will as I cannot reproduce this problem in v1.3.8 with all the Known Bug Fixes:
http://www.zen-cart.com/forum/showthread.php?t=82619

and Security Patches and Upgrades:
http://www.zen-cart.com/forum/showthread.php?t=131115

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!

1 Nov 2009, 6:54 AM
#10
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Just tested this in another store running 1.3.8a and the bolding issue still exists if you are not logged in.

Linda can you test while not being logged in and tell me what you get?

Anyone else have this problem and solve it?

Here is the screen shot of the 1.3.8a store with estimator bolding problem while not logged in.

Here is a screen shot http://www.mendweb.com/zcerror2.gif

Thanks

22 stores and counting! Ive been zenned.

1 Nov 2009, 3:25 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Try this, edit the file:
/includes/modules/shipping_estimator.php

Comment out the three lines:

      $selected_quote = $shipping_modules->quote($method, $module);

Find the line below them:

  $shipping=$selected_shipping;

and change to read:

      $selected_quote = $shipping_modules->quote($method, $module);
  $shipping=$selected_shipping;

Does this change your results in the shipping_estimator?

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!

2 Nov 2009, 5:12 AM
#12
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

So far it looks like this may be the solution. Thank you very much. I ran through the code and I just dont understand to logic on that error? What was happening? I can see what you did but dont understand why. I code quite a bit so I would love to understand this.

Thanks Linda.

22 stores and counting! Ive been zenned.

2 Nov 2009, 5:27 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

From what I was seeing it was repeating the code in the wrong places and catching one value and not really looking for another ...

By placing the check for cheapest after, it was able to set and reset the right "cheapest" code ...

Thanks for confirming that worked for you ... :smile:

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!

28 Nov 2009, 11:23 AM
#14
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

I didn't follow the "comment out 3 lines" portion of your change description. Here's the section of shipping_estimator.php I believe you're referring to:

    if (zen_not_null($module)){
      $selected_quote = $shipping_modules->quote($method, $module);
      if($selected_quote[0]['error'] || !zen_not_null($selected_quote[0]['methods'][0]['cost'])){
        $selected_shipping = $shipping_modules->cheapest();
        $order->info['shipping_method'] = $selected_shipping['title'];
        $order->info['shipping_cost'] = $selected_shipping['cost'];
        $order->info['total']+= $selected_shipping['cost'];
      }else{
        $order->info['shipping_method'] = $selected_quote[0]['module'].' ('.$selected_quote[0]['methods'][0]['title'].')';
        $order->info['shipping_cost'] = $selected_quote[0]['methods'][0]['cost'];
        $order->info['total']+= $selected_quote[0]['methods'][0]['cost'];
        $selected_shipping['title'] = $order->info['shipping_method'];
        $selected_shipping['cost'] = $order->info['shipping_cost'];
        $selected_shipping['id'] = $selected_quote[0]['id'].'_'.$selected_quote[0]['methods'][0]['id'];
      }
    }else{
      $selected_shipping = $shipping_modules->cheapest();
      $order->info['shipping_method'] = $selected_shipping['title'];
      $order->info['shipping_cost'] = $selected_shipping['cost'];
      $order->info['total']+= $selected_shipping['cost'];
    }

Which of these lines need be commented out?

28 Nov 2009, 4:07 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Find this code:

  // begin shipping cost
  if(!$free_shipping && $_SESSION['cart']->get_content_type() !== 'virtual'){
    if (zen_not_null($_POST['scid'])){
      list($module, $method) = explode('_', $_POST['scid']);
      $_SESSION['cart_sid'] = $_POST['scid'];
    }elseif ($_SESSION['cart_sid']){
      list($module, $method) = explode('_', $_SESSION['cart_sid']);
    }else{
      $module="";
      $method="";
    }
    if (zen_not_null($module)){
//      $selected_quote = $shipping_modules->quote($method, $module);
      if($selected_quote[0]['error'] || !zen_not_null($selected_quote[0]['methods'][0]['cost'])){
        $selected_shipping = $shipping_modules->cheapest();
        $order->info['shipping_method'] = $selected_shipping['title'];
        $order->info['shipping_cost'] = $selected_shipping['cost'];
        $order->info['total']+= $selected_shipping['cost'];
      }else{
//        $order->info['shipping_method'] = $selected_quote[0]['module'].' ('.$selected_quote[0]['methods'][0]['title'].')';
        $order->info['shipping_cost'] = $selected_quote[0]['methods'][0]['cost'];
        $order->info['total']+= $selected_quote[0]['methods'][0]['cost'];
        $selected_shipping['title'] = $order->info['shipping_method'];
        $selected_shipping['cost'] = $order->info['shipping_cost'];
        $selected_shipping['id'] = $selected_quote[0]['id'].'_'.$selected_quote[0]['methods'][0]['id'];
      }
    }else{
//      $selected_shipping = $shipping_modules->cheapest();
      $order->info['shipping_method'] = $selected_shipping['title'];
      $order->info['shipping_cost'] = $selected_shipping['cost'];
      $order->info['total']+= $selected_shipping['cost'];
    }
  }
  // virtual products need a free shipping
  if($_SESSION['cart']->get_content_type() == 'virtual') {
    $order->info['shipping_method'] = CART_SHIPPING_METHOD_FREE_TEXT . ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS;
    $order->info['shipping_cost'] = 0;
  }
  if($free_shipping) {
    $order->info['shipping_method'] = MODULE_ORDER_TOTAL_SHIPPING_TITLE;
    $order->info['shipping_cost'] = 0;
  }

      $selected_quote = $shipping_modules->quote($method, $module);
  $shipping=$selected_shipping;
  if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
    $show_in = FILENAME_POPUP_SHIPPING_ESTIMATOR;
  } else {
    $show_in = FILENAME_SHOPPING_CART;
  }

See if this helps ... :smile:

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!

29 Nov 2009, 2:20 PM
#16
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Thanks a bunch, it's all better now.

29 Nov 2009, 4:20 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Thanks for the update that this worked for you ... :smile:

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!

19 Dec 2009, 2:59 PM
#18
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Hi,
I am looking at another issue regarding the shipping estimator and notice that on a fresh install of 1.38a (with no other patches applied) the cheapest shipping method is marked in bold correctly whereas applying this patch causes no shipping method to be marked in bold at all.
On reading this thread (a bit) more carefully I am not sure if this patch IS for 1.38a?

regards

Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

15 Jan 2010, 12:15 PM
#19
elibaba avatar

elibaba

New Zenner

Join Date:
Apr 2009
Location:
Israel
Posts:
23
Plugin Contributions:
0

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Sorry to bump this thread after so long, but I just want to make something clear.
In this post : http://www.zen-cart.com/forum/showpost.php?p=205866&postcount=5

Linda wrote that storepickup won't be picked up in bold, even if it's the cheapest option.

Is this indeed true ?
if yes, how can I have 2 flat rate shipping modules ? one for my domestic zone and one for all the internationals ?

15 Jan 2010, 8:08 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: [DONE v1.3.9a] Shipping estimator not making cheapest option BOLD when logged in

Clone the Flat Rate flat shipping module ...

A search on:
clone flat
clone item

should give you examples of how to do this ...

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!