Looking for a script that applies a discount to every product in my woocommerce store
So every product no variables, just 10% off everything.
And it shows the regular price, then the sale price with the sale badge
add_filter('woocommerce_product_get_price', 'assign_tier_pricing', 90, 2 );
add_filter('woocommerce_product_get_regular_price', 'assign_tier_pricing', 90, 2 );
function assign_tier_pricing( $price, $product ) {
$price *= 0.5; // Set all prices for simple products to 50% off.
return $price;
}
the above code does nothing when added to functions file.