Sorting Custom Shipping Endpoints - by ID or other

I noticed when I use a custom shipping endpoint that the returned shipping endpoints are automatically sorted by price. ordinarily this would probably be fine, but in my customers case we need a custom method that allows customers to ship using their own account. so one of my return methods will be

array('id'=>99999, 0, 'Ship Using My Account')

if the customer chooses this option then I'll show them a few more fields to fill in their own shipping account info.

The only problem I see so far is in the sorting of these methods because this one always comes in first (not ideal) and should be shown last in the list.

it would be ideal if I could sort by service_id, or even by the index key order in which the methods are originally sent over?

otherwise do you have any suggestions?

I suppose another possibility would be to override the utils.inc.twig file and hard code this method below the ones dynamcally returned?

thx
Comments
  • freshjonesfreshjones Member
    edited January 26
    ok I was able to get what I needed by overriding the shipping_results macro, basically I used 2 for loops, the first loop accepts all methods except the method the the service_id of 99999, the second for loop only accepts the service_id of 99999.

    inefficient of course so if there's a better way please let me know

    thx
  • fc_adamfc_adam FoxyCart Team
    @freshjones,

    Your solution sounds like a good workaround for this issue - I'm glad you were able to find something there.
Sign In or Register to comment.