This file contains 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
add_filter('advanced_woo_discount_rules_check_purchase_first_order_status', function ($order_statuses) { | |
unset($order_statuses['wc-checkout-draft']); | |
return $order_statuses; | |
},10,1); |
This file contains 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
add_filter('advanced_woo_discount_rules_filter_passed', function($filter_passed, $rule, $product, $sale_badge){ | |
$coupon_applied = in_array('your_coupon_code', WC()->cart->get_applied_coupons()); | |
//'array(1,2)' - give rule id as you needed | |
if(in_array($rule->getId(), array(1, 2)) && $coupon_applied){ | |
// Add your additional condition here if required | |
// Your custom logics enter here and return true or false | |
// true -> Run rule | |
// false -> Do not run rule | |
return true; |
This file contains 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
add_action('advanced_woo_discount_rules_after_initialize', function() { | |
if(class_exists('\Wdr\App\Router')){ | |
remove_action('woocommerce_before_calculate_totals', array(\Wdr\App\Router::$manage_discount, 'applyCartProductDiscount'), 1000); | |
add_action('woocommerce_before_calculate_totals', array(\Wdr\App\Router::$manage_discount, 'applyCartProductDiscount'), 10000); | |
} | |
}); | |
add_action('plugins_loaded', function() { | |
if(class_exists('\Wdr\App\Router')){ | |
remove_all_filters('advanced_woo_discount_rules_cart_strikeout_price_html'); |
This file contains 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
add_action('admin_footer', function() { | |
?> | |
<style> | |
.wc-orders-list-table span .awdr-you-saved-text { | |
display: none !important; | |
} | |
</style> | |
<?php | |
}); |
This file contains 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
// Cart page add the woocommerce you saved amount | |
add_filter('wdr_add_woocommerce_amount_saved_text', '__return_true'); | |
// Thankyou and Order page add the woocommerce you saved text | |
add_filter('wdr_add_woocommerce_amount_saved_text_order_page', '__return_true'); | |
This file contains 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
add_action('wp_loaded', function() { | |
remove_all_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price'); | |
},10); | |
add_action('wp_loaded', function() { | |
if (!function_exists('advanced_woo_discount_rules_get_add_on_price_with_discount')) { | |
function advanced_woo_discount_rules_get_add_on_price_with_discount($product_price, $product, $quantity, $cart_item, $calculate_discount_from) { | |
if(isset($cart_item['wapf_item_price']) && !empty($cart_item['wapf_item_price'])){ | |
if(isset($cart_item['wapf_item_price']['options_total']) && isset($cart_item['wapf_item_price']['base'])){ | |
$product_price = $cart_item['wapf_item_price']['options_total']+$cart_item['wapf_item_price']['base']; | |
} |
This file contains 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
add_action('wp_loaded', function() { | |
if (class_exists('\WDRPro\App\Rules\FreeShipping')) { | |
remove_all_filters('woocommerce_shipping_chosen_method'); | |
remove_all_filters('woocommerce_package_rates'); | |
add_filter('woocommerce_shipping_chosen_method', array('\WDRPro\App\Rules\FreeShipping', 'reset_default_shipping_method_woo_discount'), 100, 2); | |
add_filter('woocommerce_package_rates', array('\WDRPro\App\Rules\FreeShipping', 'wdrHideShippingWhenFreeIsAvailable'),100); | |
} | |
}); |
This file contains 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
add_filter('cuw_templates', function ($templates) { | |
$templates['products/custom-template-1'] = [ | |
'template' => 'custom-template-1', | |
'title' => 'You may also like…', | |
'cta_text' => 'Buy now', | |
'styles' => [ | |
'template' => ['border-width' => '0', 'border-style' => 'solid', 'border-color' => '#000000', 'background-color' => '', 'padding' => '0'], | |
'image' => ['size' => '180'], | |
'title' => ['font-size' => '', 'color' => ''], | |
'cta' => ['font-size' => '', 'color' => '', 'background-color' => ''], |
This file contains 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
add_filter('advanced_woo_discount_rules_recalculate_shipping_package', '__return_false'); |