• Resolved littlecrookedhouse2023

    (@littlecrookedhouse2023)


    Hello, I am new to WordPress and am trying to figure out the shipping options. I have looked at different codes, but its quite a complex code that I am not sure what to do to make it work for what I need. I essentially have done this.
    1. I have set up three shipping methods:
    a) flat rate standard shipping
    b) flat rate express shipping
    c) flat rate large letter
    2. I have set up a Shipping Class for the large letter rate and when adding products for this shipping class I have changed the Shipping Class from ‘Same as Parent’ to shipping class Large Letter. (I am not sure if I need to set up a Shipping Class for the other two options or not or leave them just as a shipping method).

    When I go to add the product to the cart that should go as a large letter it shows the two other shipping options, which is not what I want. Essentially I can send 10 items from the Shipping Class Large Letter at a large letter rate and then it would have to go to standard or express shipping (and hide the large letter option) or if they have a large letter item then add something not in that shipping class it would need to do the same i.e. show standard and express and hide the large letter option). Right now if an item that is not a large letter is added by itself in the cart it shows the large letter option and I may have customers pick that because its the cheapest but is not able to be shipped that way.

    I hope that makes sense. I am not sure what the point in being able to set up a shipping class if all options show. I would prefer a code if possible as most of the plugins you have to pay to do anything substantial and from what I have seen some forum members have worse shipping issues than mine and they have code :)))) Thank you in advance for your response. Robyn

Viewing 3 replies - 1 through 3 (of 3 total)
  • Saif

    (@babylon1999)

    Hello @littlecrookedhouse2023,

    Thank you for reaching out!

    There’s no conditional shipping logic in WooCommerce to hide/show shipping methods by default.

    Instead of searching for code snippets, consider checking the Conditional Shipping and Payments extension.

    There’s a dedicated section in its documentation on how to restrict shipping methods by weight: https://woocommerce.com/document/woocommerce-conditional-shipping-and-payments/#section-11


    All extensions sold on WooCommerce.com have a 30-day refund policy. If the product doesn’t work the way you need it or you think another product would work better, we are more than happy to provide a full refund.

    Hope this helps!

    Thread Starter littlecrookedhouse2023

    (@littlecrookedhouse2023)

    Hi Saif, thank you for your response. The reason I got a WordPress site was to try and reduce my costs. I currently have a pre built site. I expected that if you pick a product and assign a shipping class to it, then that would be the only option that would be displayed in the cart. It is not, so I would question the point of having it or am I missing something? I have no issue with purchasing a plugin if it was a one off cost (which is something I need to do), but purchasing one that has a monthly cost means that it will bring me ever so closer to my prebuilt site, which is what I am trying to avoid, otherwise given the time I am putting in I may as well have stayed where I was. I hope you understand. I may be able to purchase it in the future but right now I just need to find a workaround. Thanks again for trying to help, kind regards Robyn

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @littlecrookedhouse2023

    WooCommerce allows you to assign a shipping class to a product, but it doesn’t limit the shipping methods to just that class. The purpose of shipping classes is to group similar products together so you can handle them differently. For example, you might have different shipping rates for different classes, or you might only ship certain classes to certain locations.

    If you want to restrict the shipping methods available for a particular product, as explained by my colleague, you would need to use a more advanced shipping method plugin. I understand your concern about the ongoing costs of some plugins, and I can assure you there are many options out there, including some that are one-time purchases.

    However, if purchasing a plugin is not an option at this time, there are still ways to achieve what you’re looking for. One common workaround is to create a unique shipping class for each product and then set up your shipping zones so that each zone only includes the methods available for that class. This can be a bit time-consuming to set up, but it’s a one-time effort and doesn’t require any additional purchases.

    Additionally, you can use some custom code to customize the shipping options that appear in the cart, regardless of the product’s Shipping Class. This code should check if there’s a product with the ‘Large Letter’ shipping class in the cart. If there is, it will hides the ‘Standard’ and ‘Express’ shipping methods. If there isn’t, it will hides the ‘Large Letter’ shipping method.

    Unfortunately, custom coding is not something we can assist with directly. However, if you have any further questions on development or custom coding, don’t hesitate to reach out to some of our great resources available for support. Our WooCommerce community is brimming with skilled open-source developers who are active on the following channels:

    I hope this clarifies things a bit. Please don’t hesitate to ask if you have any further questions or concerns.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide Shipping Options when using a shipping class’ is closed to new replies.