Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author smallfishes

    (@smallfishes)

    Hi @qeyduey

    Did you still need some help with this?

    Thread Starter qeyduey

    (@qeyduey)

    Yes, please. =D

    Plugin Author smallfishes

    (@smallfishes)

    @qeyduey Ok no problem.

    A few questions for you.

    How are the shipping methods ordered right now, and how do you want them ordered?

    Do you have any other plugins, or WooCommerce calculating shipping quotes?

    Thread Starter qeyduey

    (@qeyduey)

    Hey @smallfishes,

    I’m not sure how they’re currently being order, but it appears to be random.

    I want them ordered by price — low to high — which I think makes more sense to the customer.

    We are also using WooCommerce Advanced Free Shipping, which puts our free shipping method below the Canada Post ones. Would be great to have the Canada Post shipping methods shown below our free “Standard Shipping” (if that’s not asking too much).

    Thanks in advance for your help.

    Plugin Author smallfishes

    (@smallfishes)

    @qeyduey

    Thanks.

    I’ve gotten the request enough that I made a small plugin for ordering the shipping methods.

    https://www.smallfishanalytics.com/sort-woocommerce-shipping-methods/

    If you want a super easy way to order them, this plugin will do it, but it does cost $9. Note I’m not 100% sure if the free will show at the top or bottom but if you decide to get this, I’ll do what needs to be done to get it working how you need.

    If you would rather edit the PHP of the Canada Post plugin, take a look at line 210 in canada-post-shipping-for-woocommerce-canada-post.php.

    Right before returning $this->rates you can add some code to sort the array. The biggest downside to this though, is that you’ll have to reapply the code change after each update to the plugin.

    Hopefully this helps. I’m heading out the door soon here, but will check back later today to see if I can help more.

    Thread Starter qeyduey

    (@qeyduey)

    Hello @smallfishes,

    Wouldn’t you agree that this would be great and logical as the default functionality of your plugin? This is always how shipping rates are displayed to me when I shop online — low to high.

    Plugin Author smallfishes

    (@smallfishes)

    @qeyduey

    I don’t disagree that it’s the normal way that shipping is displayed at all.

    The biggest reason I haven’t added sorting to this plugin is because the way shipping plugins work with WooCommerce. When the code from this plugin runs, it registers itself with WooCommerce to let WooCommerce know that it would like to run when shipping is calculated. Sometimes stores have more than one plugin (Canada Post, Purolator, Etc) and there is no guarantee in which order WooCommerce will ask this plugin for shipping costs. If this plugin runs first, then sorts the results from Canada Post from low to high, then Purolator runs and adds yet another option (which may be out of order) then it doesn’t work well.

    Does that make sense?

    In my opinion, the job of this plugin is simply get quotes from Canada Post. The sorting and display should come from either other custom code, a theme setting, or the plugin I built that specifically takes care of ordering after all shipping methods have been called by WooCommerce.

    Hopefully this all makes sense. I’ve had a lot of people ask over the years, so you’re not the only one!

    Thread Starter qeyduey

    (@qeyduey)

    Hey @smallfishes,

    Ahhhhhhhhhh! I actually did not know this, but that makes perfect sense! Thank you for the in-depth explanation.

    I will just go ahead and add some custom code as you’ve suggested then.

    Thank you for an absolutely awesome plugin, otherwise.

    Plugin Author smallfishes

    (@smallfishes)

    Thanks for your kind words! Let me know if I can help you out at all with anything else.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Order of Shipping Rates’ is closed to new replies.