Commemorating the Holi Week GOOD FRIDAY SALE - Upto 20% OFF on all addons.

Claim Offer
00Day 19Hr 10Min 24Sec

Visible on the 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 5 reply threads
  • Author
    Posts
    • #18929
      Alice
      Guest

      Is there a way to make all attributes have the Visible on the product page clicked by default – as many vendors wont think to click it.

      Or even better, remove the option to have a click box and have it to default that all attributes are visible if they are active?

      Thanks

    • #18950
      WCFM Forum
      Member

      HI,

      Both are possible to achieve using this filter – product_simple_fields_custom_attributes

      Please know me if you required any further assistance in this.

      Thank You

    • #19042
      Alice
      Guest
      This reply has been marked as private.
    • #19051
      WCFM Forum
      Member

      Ok, I will send you code for the purpose and you just have to add your child theme’s functions.php

      Thank You

    • #19146
      Alice
      Guest
      This reply has been marked as private.
    • #19147
      WCFM Forum
      Member

      Hi,

      Here is the code for your purpose –

      function product_simple_fields_custom_attributes_manipulate( $select_attributes ) {
      	if( isset( $select_attributes['select_attributes'] ) && isset( $select_attributes['select_attributes']['value'] ) ) {
      	  $attribute_values = $select_attributes['select_attributes']['value'];
      	  $attribute_custom_values = array();
      	  if( !empty( $attribute_values ) ) {
      	  	foreach( $attribute_values as $key => $attribute_value ) {
      	  		$attribute_value['is_active'] = 'enable';
      	  		$attribute_custom_values[$key] = $attribute_value;
      	  	}
      	  }
      	   $select_attributes['select_attributes']['value'] = $attribute_custom_values;
      	}
      	return $select_attributes;
      }
      add_filter( 'product_simple_fields_custom_attributes', 'product_simple_fields_custom_attributes_manipulate' );

      Thank You

Viewing 5 reply threads
  • The topic ‘Visible on the product page’ is closed to new replies.