Mandatory Attribute Visible on Product Page

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
    • #116079
      contatoapp
      Participant

      The vendor option for the attribute to be shown on the product page is not mandatory. How can I make it so?

    • #117369
      contatoapp
      Participant

      Hi. Does anyone have a solution for this? Thanks.

    • #118327
      WCFM Forum
      Keymaster

      HI,

      All attributes or only some specific one?

      Between, when vendors add products “Show on Product” page option by default comes with “check”. Now if vendor disabled that then it’s his/her choice.

      Thank You

    • #118512
      contatoapp
      Participant

      Hi. What I meant is that the “Show on product page” option should be mandatory so vendors are required to check it. So all the product attributes are always shown.

    • #118797
      Sushobhan
      Keymaster

      Hi,
      Kindly use the following snippet for this purpose-

      add_action( 'after_wcfm_products_manage', function() {
          ?>
          <script>
          jQuery(document).ready(function($) {
              if($('#attributes').length) {
                  $('#attributes').on('click', '[id^="attributes_is_active_"],[id^="attributes_is_visible_"]', function() {
                      $(this).closest('.wcfm_attributes_blocks').find('[id^="attributes_is_active_"],[id^="attributes_is_visible_"]').prop('checked', this.checked);
                  });
              }
          });
          </script>
          <?php
      } );

      Add this code to your child theme’s functions.php

      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

      Thanks!

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