Shopping Cart Operations > Support
I want to sort shipping method options by price.
(1/1)
Alex1:
I am almost done migrating a site from a different e-commerce platform to AbanteCart 1.3.4 and I am testing the checkout page and noticed that the shipping method prices are not sorted from low to high. On this site, 99% of buyers choose the lowest-price shipping options. Therefore, I would like the lowest-priced shipping option to be listed at the top of the shipping carrier options list.
I can not find a way to sort shipping method options by price in the Admin area. I am using the USPS and UPS shipping extensions that are included with AbanteCart version 1.3.4.
Is there any way to sort the shipping method options by low to high price either in Admin settings, by changing or adding to a code file, by using an extension, or???
abolabo:
One shipping operator can offer different methods of delivery.
For example Fedex or UPS.
Usually shopping extension call their API and sorts response by price.
in the same time if you have a few enabled shipping extensions each of them can obtain their own list of methods.
Another words, methods grouping my brand and then shown as list ordered by sort_order (see extension settings page)
Alex1:
Thanks for your reply. I agree it is usual for shipping methods to be sorted from low to high prices.
The USPS and UPS shipping extensions that are included with AbanteCart version 1.3.4 do not sort shipping methods by low to high prices. They appear to sort shipping methods in ascending order according to the number at the end of their label's "for" attribute.
For example, with the UPS extension, the top shipping method is UPS Next Day Air which has a "for" attribute of "default_ups01default_ups.01". The second down shipping method is UPS Second Day Air which has a "for" attribute of "default_ups01default_ups.02". The third down shipping method is UPS Ground which has a "for" attribute of "default_ups01default_ups.03". Etc.
It is the same with the USPS extension, with the shipping methods being sorted in ascending order according to the number at the end of their label's "for" attribute.
For these UPS and USPS extensions, there is no option to change the sort order in the admin area.
I attached a screenshot showing how the shipping options are sorted.
Alex1:
I resolved this issue of the shipping options not sorting by low to high prices.
I did not want to edit the PHP files because when upgrading the the next version of AbanteCart I thought they may be replaced and the edits could be lost. So I used JavaScript to reorder the table rows on the checkout page by low to high price after the page’s DOM is fully loaded. I also updated the table rows so the shipping company name rows have a gray background and the shipping options rows have a white background. I attached a screenshot showing all of this.
I added the JavaScript to the custom.js file at storefront/view/default/javascript/. Was this a good place to add it or will this custom.js file be replaced when upgrading to a newer version of AbanteCart?
Navigation
[0] Message Index
Go to full version