• Resolved pavel.larkin

    (@pavellarkin)


    Hello.

    I’m trying to customize available shipping methods, that would be available for customers.

    Now i’m stuck at trying to find out, how to disable shipping ‘sub-methods’ on shipping method “advanced_free_shipping”.
    I can disable whole shipping method “advanced_free_shipping” using in functions.php the following code:
    unset($rates[‘advanced_free_shipping’]);

    But how to disable specific sub-method in a “advanced_free_shipping” method I don’t understand.

    Can you advise? Thank you!

    (also – very nice plugin, beautiful style of coding! ?? )

    https://www.ads-software.com/plugins/woocommerce-advanced-free-shipping/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    First, thank you for your compliment, means a lot as that is something I work hard on ??

    On a separate note, what you call ‘sub-method’, is actually called a shipping ‘rate’ in WooCommerce ?? (may help you in searching stuff)

    I do believe every rate gets a separate rate that can be unset, though not really sure at the moment where I have seen that.

    Could you explain what you are trying to do? There might be a other (easier/better) way ??

    Cheers,
    Jeroen

    Thread Starter pavel.larkin

    (@pavellarkin)

    Hi ??

    My ultimate goal here – to be able to manage more conditions, than your WAS plugin can offer. For example, my client’s cart always have a lot of products (always more than 1), so all the conditions for product “weight”, “height” and so one – just irrelevant for me.
    But:
    I need condition “cart contains category”
    i need condition “cart does not contain category”
    even better if it would be “cart does not contain shipping class”
    and so on.

    And 100% by your comment, I’ve managed to solve it by creating a lot of shipping methods, and then disabling unnecessary by:
    unset( $rates['1944'] );
    where 1944 is a standard WP post id (somehow i found it accidentally ?? ).

    But, sure, i like plugins more than digging into functions.php because of their GUI ??
    So, your plugin WAFS was good for me, and i’m pleased that i’ve bought your WAS. It helped me create a solid base for a 5+ shipping methods, which i then manipulate with functions.php.
    I just hope that may be someday you put these features above in your plugin, then i’d be completely happy ??
    I mark this topic as resolved, thank you!

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Glad you found + solved it ??

    Re ‘does not contain category / shipping class’, this should actually be possible, by setting the operator (middle condition column) to ‘not equal to’.

    Re ‘cart contains category’, I’ve actually got a extension script for this ?? it adds a condition for that. I had to make this decision when developing the plugin, putting them both in would be bloating it a bit, and making it waaaay more confusion for a lot of people ??

    So if you want this, you can mail me via https://jeroensormani.com/contact so I can send it over. The script is pretty easy, and maybe also usefull for you to modify and add your own conditions, instead of unsetting specific rates (which are break-sensitive ;-), more GUI! ??

    Cheers!
    Jeroen Sormani

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to unset specific sub-method in your shipping method’ is closed to new replies.