Add information text to product description boxes

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!

Tagged: 

Viewing 6 reply threads
  • Author
    Posts
    • #93772
      tech2
      Participant

      Hey,

      I haven’t found this during a search so I wanted to ask. How can I Add information text to product description boxes?

      What i would like is to add “Please do not add outside links to your product pages. This is not allowed”

      Thank you in advance for your time and help

      Cheers

    • #94051
      WCFM Forum
      Keymaster

      HI,

      Please add this code to your site for the purpose-

      add_filter( 'wcfm_product_manage_fields_content', function( $content_fields, $product_id, $product_type ) {
      	if( isset( $content_fields['excerpt'] ) ) {
      		$content_fields['excerpt']['desc'] = 'Please do not add outside links to your product pages. This is not allowed!';
      	}
      	if( isset( $content_fields['description'] ) ) {
      		$content_fields['description']['desc'] = 'Please do not add outside links to your product pages. This is not allowed!';
      	}
      	return $content_fields;
      }, 50, 3 );

      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

    • #94333
      tech2
      Participant

      Hey mate,

      Thank you for getting back to me. The code returned this error:

      Don’t Panic
      The code snippet you are trying to save produced a fatal error on line 0:

      Exception thrown without a stack frame
      The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

      Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.

    • #94763
      tech2
      Participant
    • #96456
      WCFM Forum
      Keymaster

      Well, this is PHP code. Hope you didn’t add this under CSS file by mistake!

    • #96470
      tech2
      Participant

      I posted using the plugin you recommended. This is actually now working so thank you for your help

    • #96691
      WCFM Forum
      Keymaster

      Great … thanks for the update 🙂

Viewing 6 reply threads
  • The topic ‘Add information text to product description boxes’ is closed to new replies.