If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / Pre-select highest shipping cost instead of lowest

Pre-select highest shipping cost instead of lowest

Started by mugshots on 26 Apr 2013, 8:43 PM · Views: 887

Results 1 to 3 of 3
26 Apr 2013, 8:43 PM
#1
mugshots avatar

mugshots

New Zenner

Join Date:
Jan 2013
Posts:
4
Plugin Contributions:
0

Post #1 by mugshots

Hi Everyone,

Can anyone explain how I can change the pre-selected lowest shipping rate to be the highest please?
I'm using different shipping modules in various combinations for different products:-

Freeshipper
Perweightunit
Tables (Cloned)

I'm not using the shipping modules for actual shipping purposes but for monthly fees and I want to encourage customers to choose the highest rate.

Ive seen the thread to stop any shipping methods being pre-selected here http://www.zen-cart.com/showthread.php?90218-Eliminate-pre-selecting-shipping-method but thats not what I need.

I hope someone can explain the maths needed for this to work.

Thanks

26 Apr 2013, 8:46 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

I haven't tested it, but you could try the following...

Edit /includes/classes/shipping.php
Around line 176 you'll see the following. Try changing the < to > instead:

          if ($rates[$i]['cost'] [B]<[/B] $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Apr 2013, 9:41 AM
#3
mugshots avatar

mugshots

New Zenner

Join Date:
Jan 2013
Posts:
4
Plugin Contributions:
0

Post #3 by mugshots

DrByte:

I haven't tested it, but you could try the following...

Edit /includes/classes/shipping.php
Around line 176 you'll see the following. Try changing the < to > instead:

      if ($rates[$i]['cost'] [B]<[/B] $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {

Thanks DrByte for this help and all the other posts you have made over some time.

That did the trick :smile: