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_footer', function () { | |
if(is_page( 'sale-products-copy' )){ | |
?> | |
<script> | |
jQuery(document).on('change', '[name="quantity"]', function (){ | |
var awdr_qty_object = jQuery(this); | |
setTimeout(function(){ | |
var $qty = awdr_qty_object.val(); | |
var $product_id = 0; |
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_dequeue_jquery_ui_datepicker_script', '__return_false'); |
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
<?php | |
if (!defined('ABSPATH')) { | |
exit; // Exit if accessed directly | |
} | |
//override path: yourtheme/woo-discount-rules-pro/buy-x-get-y-select-auto-add-variant.php | |
?> | |
<div class="awdr-select-free-variant-product-toggle"><?php _e('Change Variant', 'woo-discount-rules-pro') ?></div> | |
<div class="awdr-select-variant-product"> | |
<?php | |
foreach ($available_products as $available_product) { //parent_id |
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){ | |
//'array(23,24)' - give rule id as you needed | |
if(in_array($rule->getId(),array(23)) && class_exists('\Wdr\App\Helpers\Woocommerce')){ | |
$rule_filter = $rule->getFilter(); | |
$product_id = \Wdr\App\Helpers\Woocommerce::getProductId($product); | |
$categories = \Wdr\App\Helpers\Woocommerce::getProductCategories($product); | |
$category_id = array(); | |
$is_product_in_category = false; | |
if($rule_filter){ | |
foreach($rule_filter as $filter){ |
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
if(class_exists('\Wdr\App\Router')){ | |
remove_filter('woocommerce_order_formatted_line_subtotal', array(\Wdr\App\Router::$manage_discount, 'orderSubTotalDiscountDetails'),1000); | |
remove_action('woocommerce_after_order_itemmeta', array(\Wdr\App\Router::$manage_discount, 'orderItemMetaDiscountDetails'),1000); | |
remove_action('woocommerce_get_formatted_order_total', array(\Wdr\App\Router::$manage_discount, 'displayTotalSavingsInOrderAfterOrderTotal'), 10); | |
remove_action('woocommerce_admin_order_totals_after_total', array(\Wdr\App\Router::$manage_discount, 'displayTotalSavingsThroughDiscountInOrder'), 10); | |
} |
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_sku_filter', function($product_sku, $product, $operation_values, $operation_method, $sale_badge){ | |
if(class_exists('\Wdr\App\Helpers\Woocommerce')){ | |
$parent_id = \Wdr\App\Helpers\Woocommerce::getProductParentId($product); | |
$result = false; | |
if(!empty($parent_id)){ | |
$parent_product = \Wdr\App\Helpers\Woocommerce::getProduct($parent_id); | |
$parant_product_sku = \Wdr\App\Helpers\Woocommerce::getProductSku($parent_product); | |
if ('in_list' === $operation_method) { |
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_footer', function () {?> | |
<script type="application/javascript"> | |
function compatiblePriceStrikeOut() { | |
var $form = jQuery('form.cart').first(); | |
var $targets = jQuery('.pewc-total-field'); //Target div selector for change product price. You can get this target on response event advanced_woo_discount_rules_on_get_response_for_dynamic_discount | |
var option = { | |
custom_price: jQuery('#pewc_total_calc_price').val(), //get current product price | |
original_price:jQuery('#pewc_total_calc_price').val() | |
}; |
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
function remove_filter_price_class( $class ) { | |
$class = str_replace("pewc-main-price","",$class); | |
return $class ; | |
} | |
add_filter( 'woocommerce_product_price_class', 'remove_filter_price_class', 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('advanced_woo_discount_rules_modify_price_html', function($result, $price_html, $product, $quantity){ | |
// is_page( 'cart' ) -> cart is a page slug | |
if ( is_page( 'cart' ) || is_cart() ) { | |
return false; | |
} | |
$result; | |
}, 10, 4); |
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, $product_table){ | |
if( class_exists('\Wdr\App\Helpers\Woocommerce')){ | |
$product_id = \Wdr\App\Helpers\Woocommerce::getProductId($product); | |
if(in_array($product_id, array(1, 2, 3 ))){ // 1,2,3 is given product id | |
return false; | |
} | |
} | |
return $filter_passed; | |
}, 10, 5); |