Home Forums WoodMart support forum how to remove “coupon code” from CART Reply To: how to remove “coupon code” from CART

#562803

kamilskawinski97
Participant

also, i have remove all the code becuase it was slowying the website by a lot, like 7-15 seconds. but not i have this left on the “shop” page and is not going away. i turned the plugins off but nothing

this is the code a removed:
add_filter( ‘woocommerce_get_price_html’, ‘change_displayed_sale_price_html’, 10, 2 );
function change_displayed_sale_price_html( $price, $product ) {
// Only on sale products on frontend and excluding min/max price on variable products
if( $product->is_on_sale() && ! is_admin() && ! $product->is_type(‘variable’)){
// Get product prices
$regular_price = (float) $product->get_regular_price(); // Regular price
$sale_price = (float) $product->get_price(); // Active price (the “Sale price” when on-sale)

// Calculate the saving percentage
$saving_percentage = round( 100 – ( $sale_price / $regular_price * 100 ), 1 );

// Calculate the amount of money saved
$amount_saved = $regular_price – $sale_price;

// Format the saving percentage and amount saved
$saving_percentage_text = sprintf( __(‘%.1f%%’, ‘woocommerce’), $saving_percentage );
$amount_saved_text = wc_price( $amount_saved );

// Append to the formatted HTML price
$price .= sprintf( __(‘<p class=”saved-sale”>You Save: %s (<span class=”amount2″>%s</span>)</p>’, ‘woocommerce’ ), $saving_percentage_text, $amount_saved_text );
}
return $price;
}

you see the price? it should only say the price and that is it

Attachments:
You must be logged in to view attached files.