Advertisement
designbymerovingi

WooCommerce Price + Point Price

Aug 6th, 2014
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. /**
  2.  * Show Cost in Points
  3.  * Show the cost of a product in points next to the regular price.
  4.  * @version 1.0
  5.  */
  6. add_filter( 'woocommerce_get_price_html', 'mycred_pro_adjust_price', 10, 2 );
  7. function mycred_pro_adjust_price( $price, $Woo_Product ) {
  8.     if ( $Woo_Product->price > 0 ) {
  9.         $mycred = mycred();
  10.         return '<span class="amount">$ ' . $mycred->format_number( $Woo_Product->price ) . '</span><small>( ' . $mycred->format_creds( $Woo_Product->price*100 ) . ' )</small>';
  11.     }
  12.  
  13.     return $price;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement