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_discounted_price_of_cart_item', function($price, $cart_item, $cart_object, $calculated_cart_item_discount){ | |
$add_on_price = 0; | |
if(isset($cart_item) && isset($cart_item['product_extras']) && !empty($cart_item['product_extras'])){ | |
$price_with_extras = isset($cart_item['product_extras']['price_with_extras']) ? $cart_item['product_extras']['price_with_extras'] : 0; | |
$original_price = isset($cart_item['product_extras']['original_price']) ? $cart_item['product_extras']['original_price'] : 0; | |
$add_on_price = $price_with_extras - $original_price; | |
$price = $price + $add_on_price; | |
} | |
return $price; |
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 | |
// override path: your theme/advanced_woo_discount_rules/discount_table.php | |
if (!defined('ABSPATH')) exit; // Exit if accessed directly | |
if (!empty($ranges) && !empty($woocommerce)) { | |
if ($ranges['layout']['type'] == 'advanced') { | |
$i=0; | |
$existing_rule_id = 0; | |
$tag_opened = 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
if ( class_exists('\Wdr\App\Controllers\ManageDiscount')) { | |
$manage_discount = new \Wdr\App\Controllers\ManageDiscount(); | |
$rules = $manage_discount->getDiscountRules(); | |
foreach ($rules as $rule){ | |
//loop | |
//$rule->getRuleDiscountType() ->it will return discount type | |
//array(1,2) -> change your rule id instead of 1,2 |
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 | |
//Over ride path: Past this code in your theme path-> Yourtheme/advanced_woo_discount_rules/discount_table.php | |
if (!defined('ABSPATH')) exit; // Exit if accessed directly | |
if (!empty($ranges) && !empty($woocommerce)) { | |
if ($ranges['layout']['type'] == 'advanced') { | |
$i=0; | |
$existing_rule_id = 0; | |
$tag_opened = 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
if ( class_exists('\WDRPro\App\Rules\FreeShipping')) { | |
// below method return true when wdr free shipping enabled | |
$wdr_free_shiiping = \WDRPro\App\Rules\FreeShipping::cartHasFreeShipping(); | |
} |
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 () { | |
$currency_code = '$'; | |
if(function_exists('get_woocommerce_currency_symbol')){ | |
$currency_code = html_entity_decode(get_woocommerce_currency_symbol()); | |
} | |
?> | |
<script type="application/javascript"> | |
function compatiblePriceStrikeOut() { | |
var $form = jQuery('form.cart').first(); |
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_product_original_price_on_before_calculate_discount', function($product_price, $product, $quantity, $cart_item, $calculate_discount_from){ | |
if ( class_exists('\Wdr\App\Helpers\Woocommerce')) { | |
$product_id = \Wdr\App\Helpers\Woocommerce::getProductId($product); | |
if($calculate_discount_from == "regular_price"){ | |
$product_price = get_post_meta( $product_id, '_regular_price', true); | |
}else{ | |
$product_price = get_post_meta( $product_id, '_price', true); | |
} | |
} | |
return $product_price; |
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_notice_on_remove_coupon_while_having_a_discount', function( $msg, $coupon_code){ | |
return sprintf(__('Sorry, it is not possible to apply coupon "%s" as you already have a discount applied in cart.', 'woo-discount-rules'), $coupon_code); | |
},10, 2); |
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_product_original_price_on_before_calculate_discount', function($product_price, $product, $quantity, $cart_item, $calculate_discount_from){ | |
if ( class_exists('\Wdr\App\Helpers\Woocommerce')) { | |
$product_id = \Wdr\App\Helpers\Woocommerce::getProductId($product); | |
if($calculate_discount_from == "regular_price"){ | |
$product_price = get_post_meta( $product_id, '_regular_price', true); | |
}else{ | |
$product_price = get_post_meta( $product_id, '_price', true); | |
} | |
} | |
return $product_price; |
NewerOlder