Created
February 2, 2018 17:25
-
-
Save bappi-d-great/8ea7dc2646152d897d16bcc2535ff0e4 to your computer and use it in GitHub Desktop.
WPMU DEV marketpress - give a discount, for example 10%, to all products without updating all products price value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'mp_product/get_price', function( $price, $obj ) { | |
foreach( $price as $key => $val ) | |
{ | |
if( is_numeric( $price[ $key ] ) ) | |
{ | |
$price[ $key ] = $val * 0.9; | |
} | |
} | |
return $price; | |
}, 99, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment