• Resolved choutin

    (@choutin)


    Hi, I need some help to hide the shipping field when local pick up is select. I use this snippet to hide the shipping field.
    https://businessbloomer.com/woocommerce-hide-shipping-local-pickup-selected/
    It works on original woocommerce form_checkout.php which col2 is the shipping field. or I can replace with .woocommerce_shipping_field.
    But I can’t figured out which should I replace the shipping field in the snippet when this multi step checkout plugin actived. Anyone can tell me how to achieve this to hide the shipping when shipping method is local pick. Thanks for any help.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    If you’re using the linked tutorial, then you don’t need to change anything in the form_checkout.php file. You can add the snippet anywhere in your code, for example in the child theme’s functions.php file or by using a plugin like Code Snippets. With the snippet it should work automatically with the WooCommerce Multi-Step Checkout plugin.

    If you insist on changing the form_checkout.php file, then you’ll need to change within the /wp-content/plugins/wp-multi-step-checkout/includes/form-checkout.php file. The plugin overwrites the original WooCommerce form_checkout.php file.

    Thread Starter choutin

    (@choutin)

    I didn’t mean to modify the form checkout. php
    The form checkout.php im your plugin is different from original woocommerce checkout form. In the snippet .col-2 is shipping field. It is not work if I activate the multistep check out. here is some code from the snippet. I can replace .col-2 to .woocommerce-shipping-fields and that still work as the .col-2 hide the notes too.
    jQuery(‘#customer_details .col-2’).fadeOut();
    } else {
    jQuery(‘#customer_details .col-2’).fadeIn();
    }
    });
    so I need something to replce the .col-2 in the snippet as the. col-2 is not shipping field in your plugin form checkout.php
    Thank you.

    Plugin Author SilkyPress

    (@diana_burduja)

    You can try replacing the ‘#customer_details .col-2’ with ‘.woocommerce-shipping-fields, .woocommerce-additional-fields’, like this:

    if (val.match("^local_pickup")) {
         jQuery('.woocommerce-shipping-fields, .woocommerce-additional-fields').fadeOut();
     } else {
         jQuery('.woocommerce-shipping-fields, .woocommerce-additional-fields').fadeIn();
     }
    Thread Starter choutin

    (@choutin)

    Already try that but doesn’t work. Any other idea what to replace that field. Thank you.

    Plugin Author SilkyPress

    (@diana_burduja)

    And if you deactivate the multi-step checkout plugin the snippet works alright? Is the issue dependent on this multi-step checkout plugin?

    Thread Starter choutin

    (@choutin)

    yes. the snippet working if not using this multi step check out. so the problem is this plugin cause the snippet not working.

    Plugin Author SilkyPress

    (@diana_burduja)

    Try jQuery('#customer_details .col-2, .woocommerce-shipping-fields, .woocommerce-additional-fields') instead of jQuery('#customer_details .col-2'), but in all three places where it shows up, not only in two.

    Thread Starter choutin

    (@choutin)

    I did. I just post those 2 code for example. All 3 place are change to. but not work.

    Plugin Author SilkyPress

    (@diana_burduja)

    On my test site it works with the code above. Probably there is something else wrong. Maybe a link would be helpful.

    Thread Starter choutin

    (@choutin)

    https://myhomeshops.onlinewebshop.net
    here is the link and user: testing pass:testing. Thank you.

    Thread Starter choutin

    (@choutin)

    use the front end to login. and after that click anywhere on the admin to the backend. /wp-admin link is not working somehow.

    Plugin Author SilkyPress

    (@diana_burduja)

    I don’t see any multi step checkout plugin installed on your website.

    Thread Starter choutin

    (@choutin)

    I did not activate it yet. It is been activated now. Please take a look again. Thank you.

    Plugin Author SilkyPress

    (@diana_burduja)

    You left out a comma after the “#customer_details .col-2”. Please copy/paste exactly the code I gave you.

    It should be jQuery('#customer_details .col-2, .woocommerce-shipping-fields, .woocommerce-additional-fields') and not jQuery('#customer_details .col-2 .woocommerce-shipping-fields, .woocommerce-additional-fields'), as you have it now on the website.

    Thread Starter choutin

    (@choutin)

    It’s working now. thank you

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘how to hide shipping detail when local pick is selected anden this plugin enable’ is closed to new replies.