How to display a message after submitting the review in woocommerce?

by hal.littel , in category: PHP CMS , a year ago

How to display a message after submitting the review in woocommerce?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by brandy , a year ago

@hal.littel 

To display a message after submitting the review in WooCommerce, you can use a simple jQuery script in your theme's functions.php file. Here's how you can do it:

  1. Open your theme's functions.php file.
  2. Add the following code at the bottom of the file:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
function display_review_submission_message() {
    ?>
    <script type="text/javascript">
    jQuery(document).ready(function($) {
        $('form.woocommerce-comments-review-form').on('submit', function() {
            alert('Your review has been submitted successfully!');
        });
    });
    </script>
    <?php
}
add_action('wp_footer', 'display_review_submission_message');


  1. Save the file and refresh your website.


Now, whenever a user submits a review on your WooCommerce product page, they will see an alert message saying "Your review has been submitted successfully!". You can customize the message or the display method according to your preferences by modifying the script.

Related Threads:

How to display required message in laravel?
How to change payment checkout message in woocommerce?
How to display pagination for woocommerce products?
How to resize the display size of woocommerce products?
How to cancel dispatched message in symfony 5?
How to display only child categories and products in woocommerce?