Save amount product page
-
Hi
I used this code to show the saved value in each product page with an older theme I used, but now that I’m using Kadence, it doesn’t work , What can I do ?function ts_you_save() { global $product; if( $product->is_type('simple') || $product->is_type('external') || $product->is_type('grouped') ) { $regular_price = get_post_meta( $product->get_id(), '_regular_price', true ); $sale_price = get_post_meta( $product->get_id(), '_sale_price', true ); if( !empty($sale_price) ) { $amount_saved = $regular_price - $sale_price; $currency_symbol = get_woocommerce_currency_symbol(); $percentage = round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 ); ?> <p style="font-size:16px;color:black;"><b>You save: <?php echo $currency_symbol .''. number_format($amount_saved,2, '.', '')." (". number_format($percentage,0, '', '')."%)"; ?></b></p> <?php } } }
The page I need help with: [log in to see the link]
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Save amount product page’ is closed to new replies.