Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** ticket 113379 */
- if ( class_exists( 'YITH_WC_Points_Rewards_Redemption' ) ) {
- add_filter( 'ywpar_calculate_rewards_discount_max_discount', 'ywpar_calculate_rewards_discount_max_discount' );
- function ywpar_calculate_rewards_discount_max_discount( $max_discount ) {
- return floatval( intval( $max_discount ) );
- }
- add_filter( 'ywpar_calculate_rewards_discount_max_points', 'ywpar_calculate_rewards_discount_max_points', 10, 3 );
- function ywpar_calculate_rewards_discount_max_points( $max_points, $obj, $conversion ) {
- if( $obj->get_conversion_method() == 'fixed')
- $max_points = ( $obj->get_max_discount() * $conversion['points'] ) / $conversion['money'];
- return floatval( intval( $max_points ) );
- }
- }
Add Comment
Please, Sign In to add comment