How to load this code on function.php

Posted: asked May 18 at 21:48 - Source : stackoverflow

guys, this is my first question here, Thank you so much in advance.

I'm trying to integrate a code on every product page But it created some conflict:

function print_my_inline_script() {
  if ( wp_script_is( 'some-script-handle', 'done' ) ) {
?>
<script type="text/javascript">


<div id="BVRRContainer"></div>
<script type="text/javascript">
   $BV.ui( 'rr', 'show_reviews', {
      doShowContent : function () { 
         // If the container is hidden (such as behind a tab), put code here to make it visible 
         //(open the tab).
      }
   });
</script>


</script>
<?php
  }
}
add_action( 'woocommerce_after_single_product', 'print_my_inline_script' );

Any help ?