Forums / Built-in Shipping and Payment Modules / default shipping method

default shipping method

Locked

Started by 100asa on 7 Aug 2007, 9:55 AM · Views: 3,145

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
7 Aug 2007, 9:55 AM
#1
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

default shipping method

I've 3 shipping method; I want setup express courier as default shipping method, so when customer go to checkout_shipping page, the radio button is already cecked on express courier.
At this time is the store pickup shipping method already cecked.
Thank you

7 Aug 2007, 3:28 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: default shipping method

The default is the lowest price ...

Store Pickup would only be the default if that is cached as Store Pickup is coded to not default ...

To customize this you would need to change the shipping.php class and customize the code for:

      $cheapest = false;
      $size = sizeof($rates);
      for ($i=0; $i<$size; $i++) {
        if (is_array($cheapest)) {
          // never quote storepickup as lowest - needs to be configured in shipping module
          if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
            $cheapest = $rates[$i];
          }
        } else {
          if ($rates[$i]['module'] != 'storepickup') {
            $cheapest = $rates[$i];
          }
        }
      }

      return $cheapest;

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!

7 Aug 2007, 3:37 PM
#3
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: default shipping method

Thank's a lot!
I've done:

  $cheapest = false;
      $size = sizeof($rates);
      for ($i=0; $i<$size; $i++) {
        if (is_array($cheapest)) {
          // never quote storepickup as lowest - needs to be configured in shipping module
          if ($rates[$i]['cost'] < $cheapest['cost'] and ($rates[$i]['module'] != 'storepickup') and ($rates[$i]['module'] != 'assegnato')) {
            $cheapest = $rates[$i];
          }
        } else {
          if ($rates[$i]['module'] != 'storepickup') {
            $cheapest = $rates[$i];
          }
        }
      }