Remove all Shipping State Blocks at once?

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 4 reply threads
  • Author
    Posts
    • #111656
      Janneke
      Participant

      Hi,

      In Vendor Shipping OPtions I don’t want options voor State rates but only Country.

      I succesfully removed one Shipping State Block in CSS >

      div#wcfmmp_shipping_rates_wcfmmp_shipping_state_rates_0 {
          display: none;
      }

      But as soon the vendor wants to add another country then a second Shipping State Block appears.
      To remove that second Block I have to add in CSS >

      div#wcfmmp_shipping_rates_wcfmmp_shipping_state_rates_2 {
          display: none;

      Ans so on for every new added country so if vendor ships to 100 countries I have to put 100 codes in CSS(?)

      Is here another way to hide or remove this Shipping State Blocks at once?

      Please see attachment.

      Thank you.

      Attachments:
      You must be logged in to view attached files.
    • #112125
      Sushobhan
      Keymaster

      Hi,
      Kindly use the following snippet –

      function remove_state_option($shipping_fields) {
          if(isset($shipping_fields['wcfmmp_shipping_rates']['options']['wcfmmp_shipping_state_rates']))
              unset($shipping_fields['wcfmmp_shipping_rates']['options']['wcfmmp_shipping_state_rates']);
          return $shipping_fields;
      }
      add_filter( 'wcfmmp_settings_fields_shipping_rates_by_country', 'remove_state_option' );

      Add this code to your child theme’s functions.php file and let me know how this goes.
      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
      Thanks!

    • #113248
      Janneke
      Participant

      Sorry for my late reply.
      This didn’t work. After uploading the functions.php file I could not login to wp-admin anymore.
      After deleting the code and upload the file again it was fine.

    • #113831
      Sushobhan
      Keymaster

      Hi Janneke,
      It seems, there might be some copy pasting issue in your last attempt. Also I would suggest using https://wordpress.org/plugins/code-snippets/ plugin for code snippets.
      If the problem persists, then I’ll require a temporary access of your site to further debug.
      Thanks!

    • #113833
      Janneke
      Participant

      Thank you I will try the plugin.
      Meanwhile would you please be so kind to answer to my other topic as well?
      I really love Multivendor Marketplace but I need Mollie iDEAL to work in it.
      It would be very sad that I can’t use WCFM because of that.

      Thank you very much.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.