gwu777 Posted September 24, 2009 Share Posted September 24, 2009 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 More sharing options...
swguy Posted September 24, 2009 Share Posted September 24, 2009 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, $ { 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 More sharing options...
swguy Posted September 24, 2009 Share Posted September 24, 2009 If someone who is knowledgeable about Smarty could explain how to add this logic to order-carrier.tpl (or perhaps another more suitable location) that would be great! Link to comment Share on other sites More sharing options...
gwu777 Posted September 24, 2009 Author Share Posted September 24, 2009 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 More sharing options...
swguy Posted September 24, 2009 Share Posted September 24, 2009 It does use the id. You have to sort by price the way my code did - sorry it was not compatible with your files. (Are you using ps 1.2.4?) Link to comment Share on other sites More sharing options...
gwu777 Posted September 25, 2009 Author Share Posted September 25, 2009 I am using 1.2.3 but it should be the same... No worries for your code, I may try it another day! Shouldn't the option in the BO to select the default carrier takes care of this? Link to comment Share on other sites More sharing options...
swguy Posted September 25, 2009 Share Posted September 25, 2009 BO does select the default carrier (according to my testing) - it's just that the ordering is odd - I too would expect the selected item to be first, but as you noted, it's by ID.BTW, sweet code coming from me to Prestashop soon! Link to comment Share on other sites More sharing options...
Tine Chem Posted October 9, 2009 Share Posted October 9, 2009 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, $ { 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 More sharing options...
nostradamus Posted October 11, 2009 Share Posted October 11, 2009 i have the same issue in the back end i choose option 1 and in the front end it doesn't set this option as standard Link to comment Share on other sites More sharing options...
Spirutal Posted October 17, 2009 Share Posted October 17, 2009 I have same problem, i can not find solution to fix this bug Link to comment Share on other sites More sharing options...
jsherk Posted August 16, 2011 Share Posted August 16, 2011 Maybe this thread: http://www.prestashop.com/forums/topic/115765-sort-carriers-by-price/ Link to comment Share on other sites More sharing options...
noesac Posted August 16, 2011 Share Posted August 16, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now