EduardET

Untitled

Jul 2nd, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         function customPrice( el ) {
  5.             if ( $( 'body' ).hasClass( 'single-product' ) ) {
  6.                 var price = el.text(),
  7.                     currency = price.substr( price.length - 1 ),
  8.                     inter_price = price.slice( 0, -1 ).split( ',' );
  9.                 new_price = inter_price[ 0 ] + '<span class="wpc-decimal">' + currency + inter_price[ 1 ] + '</span>';
  10.                 el.html( new_price )
  11.             }
  12.         }
  13.         customPrice($( '.wpc-custom-price .price ins .woocommerce-Price-amount.amount' ) );
  14.     } );
  15. } )( jQuery );
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment