Jump to content

Wrong first choice of delivery


gwu777

Recommended Posts

Hi there,

I have the choice between 2 means of delivery, a cheap slow one and a fast expensive one. I made the cheap slow one the default one in the BO.

However when I place and order, it is always the expensive one that comes first, why is it and how can I change that?

Link to comment
Share on other sites

In order.php right above where wrapping fees are set (line 357 in 1.2.4), you can sort $resultsArray where the carriers are stored:

function pricesort($a, $B) { if ($a['price'] == $b['price']) return 0; return ($a['price'] < $b['price'])? -1 : 1; }
usort($resultsArray, "pricesort");

I'm trying to figure out a way to do this where you don't modify core files but I haven't gotten that far into it yet.

Link to comment
Share on other sites

Hi swguy,

Welcome to PS, I have used some module for a previous OsC, Quantity Discounts for osCommerce 2.2 - Thank you very much for your hard work.

Thank you for helping me again...

I have tried the above in the order.php, it didn't work. However, as the "chose the default transporter" doesn't work, I have edited las the cheap delivery option and saved the non-changes, it gave an id higer than the expensive one and now it is the option selected by default in the shop. Although it appears under the expensive one which I don't find logical... Apparently it organises the delivery option based only on the id of the option.

Anyone else with this problem, or is it just a bug on my shop?

Link to comment
Share on other sites

  • 2 weeks later...
In order.php right above where wrapping fees are set (line 357 in 1.2.4), you can sort $resultsArray where the carriers are stored:

function pricesort($a, $B) { if ($a['price'] == $b['price']) return 0; return ($a['price'] < $b['price'])? -1 : 1; }
usort($resultsArray, "pricesort");

I'm trying to figure out a way to do this where you don't modify core files but I haven't gotten that far into it yet.



Hi, itried to implement your solution, but it didn't work. can you describe in more details how to fix "radio button" issue in order.php.

what exactly do I have to change, any oter solutions etc...
Link to comment
Share on other sites

  • 1 year later...

I have come across this same problem many times, and I found a work-around solution.

 

Edit the option you want in order. Every time you edit a record, it is pushed down because for some reason it is ordered based on last change date.

 

You don't need to really edit it, just put a space at the end of the name for example. This is how I do it.

Link to comment
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
×
×
  • Create New...