About Toolset with variable product question

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate About Toolset with variable product question

Viewing 23 reply threads
  • Author
    Posts
    • #27448
      MOHO
      Participant

      I try to use toolset plugin, ans i see it display at product custom field area.

      But could all my custom fields of “Toolset” move to each variable option?

      By moho

      Attachments:
      You must be logged in to view attached files.
    • #27455
      MOHO
      Participant

      I have solved this problem, i should use Taxonomy.

      You could closed this entry, thanks.

    • #27557
      WCFM Forum
      Member

      OK, that’s fine πŸ™‚

    • #27573
      MOHO
      Participant

      Toolset could add custom fields at variable options of product?

      Attachments:
      You must be logged in to view attached files.
    • #27588
      WCFM Forum
      Member

      Hi,

      It’s not possible, Toolset or WooCommerce none of them support this.

      If you really want to have custom field for variations then we have to develop this custom, no third plugin can be helpful here.

      Thank You

    • #27634
      MOHO
      Participant

      Yes i need “custom field for variations”
      I need three number fields as follows:
      1. Wholesale Price
      2. Cost Price (Required)
      3. Maximum Points Discount

      I make our custom point reward system, so i need “custom field for variations”.

      Thanks.

      Attachments:
      You must be logged in to view attached files.
    • #27713
      WCFM Forum
      Member

      Hi,

      OK, I understand your requirement.

      Kindly know me, are you using any plugin for the purpose?

      Thank You

    • #27718
      MOHO
      Participant

      No plugin could add field at variations option, right?

      I need three number fields at each variation options as follows:
      1. Wholesale Price ( meta:_wc_wholesale_price ) –> i custom field
      2. Cost Price “Required field” ( meta:_wc_cost_price ) –> i custom field
      3. Maximum Points Discount ( meta:_wc_points_max_discount ) –> this woo point plugin field

      Could you custom it for me?

      Attachments:
      You must be logged in to view attached files.
    • #27751
      MOHO
      Participant

      i need add one more field: “Enable Wholesale Price” option field (yes|no) (meta:_wc_enable_wholesale_price)
      If vendor choose “yes”, then display ” Wholesale Price” field
      If vendor choose “no”, then hide ” Wholesale Price” field

      Maximum Points Discount field default value = “0”

      About translate custom field
      Enable Wholesale Price β†’ ε•Ÿη”¨ηΆ“ιŠ·εƒΉ (yes|no β†’ 是|否)
      Wholesale Price β†’ ηΆ“ιŠ·εƒΉ
      Cost Price β†’ 出貨價
      Maximum Points Discount β†’ ζŠ΅η”¨ι‡‘ζœ€ι«˜δΈŠι™

      If
      Wholesale Price < Cost Price
      Cost Price < Maximum Points Discount
      then display error message

    • #27767
      WCFM Forum
      Member

      Hi,

      Kindly know me which plugin you are using for the purpose!

      Thank You

    • #27805
      MOHO
      Participant
      This reply has been marked as private.
    • #27870
      WCFM Forum
      Member

      HI,

      We are going to make compatible WCFM with this wholesale plugin – https://wordpress.org/plugins/wholesale-market/

      Do you ever tried this?

      Thank You

    • #27881
      MOHO
      Participant

      I try it, but now i no need Wholesale Price.

      I use my custom plugin for point count, so i only need variable option add extra two field, can save my meta field:
      1. Cost Price β†’ 出貨價 (number field)
      2. Maximum Points Discount β†’ ζŠ΅η”¨ι‡‘ζœ€ι«˜δΈŠι™ (number field)

    • #27885
      WCFM Forum
      Member

      Hi,

      PFA, a code snippet which help you to add-save custom field for simple and variable products.

      Please try this.

      thank you

      Attachments:
      You must be logged in to view attached files.
    • #27898
      MOHO
      Participant

      sorry it not work.
      I didn’t see extra any custom field at simple and variable product
      and HTTP ERROR 500 at wp-admin

      I only need add in variable product option, simple product no need, thanks.

      Attachments:
      You must be logged in to view attached files.
    • #27901
      WCFM Forum
      Member

      Hi,

      Just add this code then, it will add a new variation field “MRP Price” –

      // Adding variation field
      function wcfm_product_manage_fields_variations_mpr( $variation_fileds, $variations, $variation_shipping_option_array, $variation_tax_classes_options ) {
      	global $WCFM, $WCFMu;
      	
      	$mrp_price_fields = array(  
      													"mrp_price" => array('label' => __('MRP Price', 'wc-frontend-manager-ultimate') , 'type' => 'text', 'class' => 'wcfm-text wcfm_ele variable', 'label_class' => 'wcfm_title wcfm_ele variable' ),
      													);
      	$variation_fileds = array_merge( $variation_fileds, $mrp_price_fields);
      	
      	return $variation_fileds;
      }
      add_filter( 'wcfm_product_manage_fields_variations', 'wcfm_product_manage_fields_variations_mpr', 100, 4 );
      
      // Adding variation field data
      function wcfm_product_data_variations_mrp( $variations, $variation_id, $variation_id_key ) {
      	global $WCFM, $WCFMu;
      	
      	if( $variation_id  ) {
      		$variations[$variation_id_key]['mrp_price'] = get_post_meta( $variation_id, 'mrp_price', true );
      	}
      	
      	return $variations;
      }
      add_filter( 'wcfm_variation_edit_data', 'wcfm_product_data_variations_mrp', 100, 3 );
      
      // Saving variation field data
      function wcfm_product_variation_save_mrp( $wcfm_variation_data, $new_product_id, $variation_id, $variations, $wcfm_products_manage_form_data ) {
      	global $WCFM, $WCFMu;
      	
      	if( $variation_id  ) {
      		update_post_meta( $variation_id, 'mrp_price', $variations[ 'mrp_price' ] );
      	}
      	
      	return $wcfm_variation_data;
      }
      add_filter( 'wcfm_product_variation_data_factory', 'wcfm_product_variation_save_mrp', 100, 5 );

      Thank You

    • #27905
      MOHO
      Participant

      Could i remove my custom fields under the price area?

      Attachments:
      You must be logged in to view attached files.
    • #27907
      WCFM Forum
      Member

      Hi,

      This is also possible, then you have to tweak this code a bit and add field at particular position.

      Can you do this? OR should I write that code for you?

      Thank You

    • #27908
      MOHO
      Participant

      Thanks your help

      I want to move my custom field after price and before SKU, thanks.

      Attachments:
      You must be logged in to view attached files.
    • #27921
      MOHO
      Participant

      and how could make field required?

    • #27954
      MOHO
      Participant

      Hi i think no need move custom field position, just “make field required”, thanks.

    • #28042
      WCFM Forum
      Member

      Hi,

      OK, for this kindly update this line –

      $mrp_price_fields = array(  
      													"mrp_price" => array('label' => __('MRP Price', 'wc-frontend-manager-ultimate') , 'type' => 'text', 'class' => 'wcfm-text wcfm_ele variable', 'label_class' => 'wcfm_title wcfm_ele variable' ),
      													);
      

      with this –

      $mrp_price_fields = array(  
      													"mrp_price" => array('label' => __('MRP Price', 'wc-frontend-manager-ultimate') , 'custom_attributes' => array( 'required' => true ), 'type' => 'text', 'class' => 'wcfm-text wcfm_ele variable', 'label_class' => 'wcfm_title wcfm_ele variable' ),
      													);
      

      I have added a new element in array – ‘custom_attributes’ => array( ‘required’ => true )

      In WCFM if you add this to any field then it will become “Required” and validation automatically start working.

      Hope this will helpful for you πŸ™‚

      Thank You

    • #28063
      MOHO
      Participant

      thanks, it work now!
      please close it.

    • #28065
      WCFM Forum
      Member

      Great πŸ™‚

Viewing 23 reply threads
  • The topic ‘About Toolset with variable product question’ is closed to new replies.