Tell me: in the file single-product.js there is such code:

// Star ratings for comments .on( 'init', '#rating', function() { $( '#rating' ).hide().before( '<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>' ); }) 

This code hides the select list and instead of a list of stars in the new block.

How can I undo this action? Those. so that the select list does not hide, and the new block is not created.

This js handler is in the folder with the woocommerce plugin. It can not be rewritten so that when updating the plug-in nothing is broken.
The <select> list that is hidden by the js handler looks like this:

 <select name="rating" id="rating" aria-required="true" required style="display: none;"> 

Or tell me, how can I replace the block that the js-handler inserts ( <p class="stars">... )? Ie, how to insert <p class="stars"... instead <p class="stars"... another block, but in order to take into account product ratings remain workable?

How to correctly replace the feedback code with your own code and your own design? All code is in the comment_form () function, which passes parameters. It turns out you need to completely override this function?

  • remove id="rating" ? - teran
  • @teran is not, you need to cancel hiding the <select> list. as a result of the above js-script, the select list looks like this: (PSthere is the way to put a transfer to another line here?) <select name="rating" id="rating" aria-required="true" required="" style="display: none;"> - word
  • I basically understood how the code of your select looks. How critical it is for him to have id="rating" , because only because of this attribute does he hide and add asterisks. If you delete this part, the list will remain original - teran
  • @teran and if critical? - word
  • then add him the class="no-stars" , and in the handler, exclude it on('init', '#rating:not(.no-stars)', .. - teran

0