Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function king_custom_price() {
- global $product;
- if ($product->is_on_sale() && is_shop()){
- $regular_price = get_post_meta( $product->get_id(), '_regular_price', true );
- $sale_price = get_post_meta( $product->get_id(), '_sale_price', true );
- return '<del>from '.$regular_price.'</del><ins> '.$sale_price.'</ins>';
- }
- }
- add_filter( 'woocommerce_format_sale_price', 'king_custom_price', 10, 2 );
Add Comment
Please, Sign In to add comment