Add custom fields

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 41 reply threads
  • Author
    Posts
    • #65011
      r_guayaquil
      Participant

      Hi,

      I just bought the ultimate version. I was trying to add some costum fields reviewing the documentation.

      But when i go to add nuew productthis is what i get. image attached.

      Also, how can i change the text in the emails a vendor recieves when they register.

      Please help!

      Attachments:
      You must be logged in to view attached files.
    • #65062
      r_guayaquil
      Participant

      Hi,

      The info doesnt show in the product detail page. Am i doing somwthing wrong? Also, i would like to show the custom fields not only in the product page.

      Please see the images attached.

      Thank you!

      Attachments:
      You must be logged in to view attached files.
    • #65293
      macnomo
      Participant

      Hola,
      intenta nombrar >Agrupar Campos > por ejemplo: precio_final

    • #65294
      WCFM Forum
      Keymaster

      HI,

      Field Name and Group Name is not right.

      Those are only for storing fields in database. Do not use any special character or space in those.

      You may specify any type “Label”.

      Set names like this – https://ibb.co/Dk1c36k

      Thank You

    • #65314
      r_guayaquil
      Participant

      Thanks for the help!

      Is there a way i can show the custom fields in the quick view of the product?

    • #65400
      WCFM Forum
      Keymaster

      Hi,

      It’s possible to show up, but depend upon theme’s quick view template.

      Which theme you are using for the site, we will take a look at it!

      Thank You

    • #65755
      r_guayaquil
      Participant

      Hi,

      I am using flatsome theme.

      Thanks!

    • #65831
      WCFM Forum
      Keymaster

      OK, we will take care of this in next update.

    • #65892
      r_guayaquil
      Participant

      Hi,

      Thanks for the help! If it is not too much to ask, can you also make the update to show the custom fields as the image attached.

      I would really appreciate it.

      Thank you!

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

      HI,

      Well, we do not want to add this in core.

      If you want, I can help you in this.

      Between, how many custom fields you have? Do you want to show all of them here!

      Thank You

    • #66084
      r_guayaquil
      Participant

      Hi,

      I have in total 4 custom fields, but i only want 2 of them to show there. I would like to show how the image attached looks like.

      Also, how can i get rid of the vendors logo in that section?

      Thank you so much!

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

      Hi,

      Please add this line of code to your site for the purpose –

      add_filter( 'wcfmmp_is_allow_sold_by_logo', '__return_false' );

      Thank You

    • #66325
      macnomo
      Participant

      Hi,

      I was about to ask for something similar.

      I will like not to show the Field’s name on product page, because we already have a Tag for that field to show, in my case is the shipping methode i want to show and that is like duplicatting the info. Redundan!

      Name of field should be only shown/visible to vendor in vendor’s panel, not on product page.

      Attachments:
      You must be logged in to view attached files.
    • #66336
      r_guayaquil
      Participant

      Hi,

      Thanks for the code!Can you help me showing the 2 custom fields i mentioned?

      Thanks!

    • #66837
      WCFM Forum
      Keymaster

      Hi,

      Please show me your custom fields screenshot and know me which 2 fields you want to show.

      Thank You

    • #67010
      r_guayaquil
      Participant

      Hi,

      i attached the screenshot. The 2 fields i want to show are “Precio con envío” and “Tiempo de entrega”

      Also, as macocifuentes said above, how can i not show the block name of the fields as it is redundant.

      Thank you!

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

      Hi,

      Thanks, please send me these two fields names and group name you have added there.

      Between, you are using “Flatsome” theme, right?

      Thank You

    • #67468
      r_guayaquil
      Participant

      Hi,

      The 2 field names are:

      – Precio_con_envio
      – Tiempo_de_entrega

      Group name:
      – datos_adicionales

      Yes, i am using the flatsome theme.

      Thank you!

    • #68420
      r_guayaquil
      Participant

      Hi,

      In another topic i started you guys told me not to create custom fields as group but as simple. https://wclovers.com/forums/topic/add-costum-fields-using-a-csv-file/#post-68416

      I dont know if thi is going to cause any trouble with you guys helping with the things i need help with mentioned above.

      This is what i have:

      Block name: Datos Adicionales
      Fields as Group: Unchecked
      Fields:
      Precio_con_envio
      Tiempo_de_entrega
      Formas_de_pago
      Garantía

      Thanks you guys for the help!

    • #68928
      WCFM Forum
      Keymaster

      Hi,

      This setting is fine. I will give you code for this.

      Thanks for the details.

    • #68985
      r_guayaquil
      Participant

      Hi,

      Thanks a lot!

    • #69676
      r_guayaquil
      Participant

      Hi,

      In the last update did you add the feature to show the custom fields in the quick view?

      Also, in the quick view also appears two times the name of the vendor. Please image 1

      I am using flatsome.

      Thanks!

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

      HI,

      Please keep custom visibility setting => “Before Product Meta” or “After Product Meta” – https://ibb.co/BB5CF31

      It will be visible in Quick View as well.

      Also, in the quick view also appears two times the name of the vendor. Please image 1
      – We have resolved this in WCFM Marketplace 3.1.1

      Thank You

    • #69792
      r_guayaquil
      Participant

      Hi,

      Thanks for the help!Is there a way i can increase the size of the text in the cutom fields. right now the text es very small.

      Also, you helped with a code to hide the logo of the vendor, but can you please help to hide the “Store” text?

      Thank you!

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

      Hi,

      Well, you can increase display size easily using CSS. Can you do this, or I will give you CSS for this?

      Also, you helped with a code to hide the logo of the vendor, but can you please help to hide the “Store” text?

      – Add this line –

      add_filter( 'wcfmmp_is_allow_sold_by_label', '__return_false' );

      Thank You

    • #69829
      r_guayaquil
      Participant

      Hi,

      Can you please help me with the CSS!

      Thanks for everything!

    • #69932
      WCFM Forum
      Keymaster

      Hi,

      You are welcome 🙂

      Please use this CSS –

      .product-lightbox-inner .product_meta .wcfm_custom_field_display {
          font-size: 1.3em;
      }

      Thank You

    • #70599
      r_guayaquil
      Participant

      Hi,

      This setting is fine. I will give you code for this.

      Please dont forget to help me qith the code.

      Thanks 🙂

    • #70946
      WCFM Forum
      Keymaster

      Hi,

      Sorry, code for what ?

      Custom fields are already visible at product quick view, right ?

      Thank You

    • #71078
      r_guayaquil
      Participant

      Hi,

      Yes, they are visible in the quick view, but you also said you were going to help with a code to show custom fields as image attached.

      I have 4 in total but I only want to show 2 custom fields:

      Precio_con_envio
      Tiempo_de_entrega

      Thanks for the help!

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

      Please give me this page url.

    • #71596
      r_guayaquil
      Participant

      Hi,

      What do you mean? You want the url of my website?

    • #72230
      WCFM Forum
      Keymaster

      HI,

      https://wclovers.com/wp-content/uploads/2019/07/Sin-t%C3%ADtulo.jpg – which page is this? Home page or shop page? I need this page URL.

      Thank You

    • #72231
      WCFM Forum
      Keymaster

      Actually, I have to check which element you have used for setting up this page!

    • #72477
      r_guayaquil
      Participant

      Hi,

      I want to show in the home page and shop page. Here are the links.

      https://www.todomerca.ec/
      https://www.todomerca.ec/tienda/

      Thanks!

    • #72690
      WCFM Forum
      Keymaster

      Hi,

      Here is your code for the purpose –

      add_action('woocommerce_after_shop_loop_item_title', function() {
      	global $WCFM, $WCFMmp, $product;
      		
      	if( !$product ) return;
      		
      	$product_id = $product->get_id();
      	
      	if( $product_id ) {
      		$wcfm_product_custom_fields = get_option( 'wcfm_product_custom_fields', array() );
      		if( $wcfm_product_custom_fields && is_array( $wcfm_product_custom_fields ) && !empty( $wcfm_product_custom_fields ) ) {
      			foreach( $wcfm_product_custom_fields as $wpcf_index => $wcfm_product_custom_field ) {
      				if( !isset( $wcfm_product_custom_field['enable'] ) ) continue;
      				
      				$block_name = !empty( $wcfm_product_custom_field['block_name'] ) ? $wcfm_product_custom_field['block_name'] : '';
      				$wcfm_product_custom_block_fields = $wcfm_product_custom_field['wcfm_product_custom_block_fields'];
      				
      				$display_data = '';
      				foreach( $wcfm_product_custom_block_fields as $wcfm_product_custom_block_field ) {
      					if( !$wcfm_product_custom_block_field['name'] ) continue;
      					$field_name = $wcfm_product_custom_block_field['name'];
      					if( !in_array( $field_name, array( 'Precio_con_envio', 'Tiempo_de_entrega' ) ) ) continue;
      					
      					$field_value = get_post_meta( $product_id, $field_name, true );
      					if( $field_value ) {
      						$display_data .= "<label class='wcfm_custom_field_display_label' style='display:inline-block;'>" . wcfm_removeslashes( __( $wcfm_product_custom_block_field['label'], 'wc-frontend-manager') ) . ":&nbsp;</label>";
      						$display_data .= "<span class='wcfm_custom_field_display_value'>" . $field_value . "</span><br />";
      					}
      				}
      				
      				if( $display_data ) {
      					echo '<div class="wcfm_custom_field_display wcfm_custom_field_display_'.sanitize_title($block_name).'">';
      					echo $display_data;
      					echo '</div><div class="wcfm-clearfix"></div><br />';
      				}
      			}
      		}
      	}
      }, 45 );

      Thank You

    • #72695
      r_guayaquil
      Participant

      Hi,

      Thanks a lot! You guys are THE BEST 🙂

      I dont know how to code and sorry to bother you a lot, but how can i get rid of th space between the custom field “Tiempo de Entrega” and the vendors name?

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

      HI,

      Please remove this last “br” from the code – https://ibb.co/Y7pfDz0

      Thank You

    • #72859
      r_guayaquil
      Participant

      Hi,

      Thank you! 🙂

    • #72917
      r_guayaquil
      Participant

      Hi,

      You helped me with the following code to increase the size text of the custom fields in the quick view:

      .product-lightbox-inner .product_meta .wcfm_custom_field_display {
      font-size: 1.3em;
      }

      Can you also help me to increase it in the product detail page?

      Thank you!

    • #72918
      r_guayaquil
      Participant

      I just figured it out how to do it.

      Thanks 🙂

    • #72952
      WCFM Forum
      Keymaster

      Great … thanks for the update 🙂

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