• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Submit Button Notice for Product Reviews – WooCommerce

Using a code editor, copy & paste the PHP code from the view raw link in the Gist to the end of your child themes functions file or custom functionality plugin.

Review Form Hooks

Using the comment form hooks native to WordPress, these are the hooks you can use to position your text for single product reviews:

comment_form_before
comment_form_top
comment_form
comment_form_after

Hook Positioning

Shows the exact position in the comment form the hook will output.

WooCommerce Single Product Review Form Hooks

About The Code

  • Uses the comment_form_after hook to control the positioning of the text beside the submit reviews button
  • Uses the is_product() conditional tag to print the output on single product pages only
  • Uses the esc_html_e function to print translated text that has been escaped for safe use in HTML output

Text Line Height – CSS

You can then add some CSS to the end of your child themes style sheet to position your text.

@media only screen and (min-width: 600px) {

.single-product .comment-form .submit-reviews-notice {
        line-height: 2.2;
}}

And here’s the result displaying vertically inline with the submit button.

Related Code Snippets

  • Display Message on Posts With Closed Comments

WooCommerce

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.