How add character limit to 'short description'

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 How add character limit to 'short description'

Viewing 7 reply threads
  • Author
    Posts
    • #53380
      acauaferreira
      Participant

      Hi ninja staff.

      I would like to add character limit to ‘short description’
      (this character limit will be added inside product manager , so the vendors cant write more than 50 words)
      Max 50 words.

    • #53555
      WCFM Forum
      Member

      HI,

      Please use this code snippet –

      add_filter( 'wcfm_product_manage_fields_content', function( $content_fields, $product_id, $product_type ) {
      	if( isset( $content_fields['excerpt'] ) ) {
      		$content_fields['excerpt']['type'] = 'textarea';
      		$content_fields['excerpt']['class'] = 'wcfm-textarea wcfm_ele wcfm_full_ele simple variable external grouped booking';
      		$content_fields['excerpt']['attributes'] = array( 'maxlength' => 50 );
      	}
      	return $content_fields;
      }, 50, 3 );

      Thank You

    • #81111
      xola
      Participant

      Hi, can you please guide me on how to add character limit for Product TITLE?

    • #81700
      WCFM Forum
      Member

      Hi,

      Please use this code snippet –

      add_filter( 'wcfm_product_manage_fields_general', function( $general_fields, $product_id, $product_type ) {
      	if( isset( $general_fields['pro_title'] ) ) {
      		$general_fields['pro_title']['attributes'] = array( 'maxlength' => 10 );
      	}
      	return $general_fields;
      }, 50, 3 );

      You may change “maxlenght” value as per your requirement.

      Thank You

    • #82701
      r_guayaquil
      Participant

      Hi,

      Is there a way for the product title to look like “Televisor Samsung 4k de 55 pulagadas…”, including the dots?

      I want in the homepage and shop page the title look like that, but the vendors can add as many characters in the product title as the want.

      Example:
      The vendor adds the product title as “Televisor Samsung 4k de 55 pulagadas netflix youtube integrados”, but in the homepage and shop page the title looks like “Televisor Samsung 4k de 55 pulagadas…”

      Thanks for the help!

    • #82910
      WCFM Forum
      Member

      Hi,

      Well, these displays are form theme template.

      Please talk to your theme support for this, hope they have some option for this!

      Thank You

    • #83144
      zoltan.b.feher
      Participant

      Hi,

      Shorten the excerpt snippet works well, however it puts a trailing <p> tag to the short description which overwrite the .product .box-excerpt IDs. When I edit it the short description I can delete the p tag, but when I edit later the product the <p> tag inserted again, which breaks the style. Do you have idea how to preserve the .product .box-excerpt selector?

    • #83346
      WCFM Forum
      Member

      Hi,

      Can you please show me screenshot for this?

      Did you disabled “Rich Editor” for vendors?

      Thank You

Viewing 7 reply threads
  • The topic ‘How add character limit to 'short description'’ is closed to new replies.