Woocommerce advanced product labels with Flatsome Theme

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 3 reply threads
  • Author
    Posts
    • #77191
      Mike_H
      Participant

      I’m using Woocommerce Advanced Product Labels as per your compatibility matrix.

      I’m going to be replacing the current theme I am using with Flatsome, and on the product categories pages the label shows on the text block under the image instead of over the image as it should do.

      I wondered if you had a piece of code to sort this as you recommend both the theme and the plugin?

      If not, I’m happy to use the Flatsome “Sale Bubble” but this section does not show up in the Vendor edit product pages, do you have some code to show this section, entitled Extra in the Woocmmerce back-end?

      Thanks

    • #77472
      WCFM Forum
      Member

      Hi,

      Yeah sure, that is possible using WCFM Custom field – https://wclovers.com/knowledgebase/wcfm-custom-fields/

      You have to create such custom fields – https://ibb.co/Tkc6x9F

      And add this code to your site –

      function wcfm_flatsome_custom_field_group_data_save( $group_value, $group_name ) {
      	if( $group_name == 'wc_productdata_options' ) {
      		$group_value = array( 0 => $group_value );
      	}
      	return $group_value;
      }
      add_filter( 'wcfm_custom_field_group_data_save', 'wcfm_flatsome_custom_field_group_data_save', 50, 2 );
      
      function wcfm_flatsome_custom_field_group_data_value( $group_value, $group_name ) {
      	if( $group_name == 'wc_productdata_options' ) {
      		if( $group_value && is_array( $group_value ) && isset( $group_value[0] ) ) {
      			$group_value = $group_value[0];
      		}
      	}
      	return $group_value;
      }
      add_filter( 'wcfm_custom_field_group_data_value', 'wcfm_flatsome_custom_field_group_data_value', 50, 2 );

      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/

      Thank You

    • #82669
      Mitchell Gould
      Participant

      I’m confused. Flatsome already creates the custom tab in wp-admin on the product page. I have to recreate all those fields manually in WCFM?

    • #82903
      WCFM Forum
      Member

      If you require those fields then only create.

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