Version Description
- 09/04/18 =
- Feature - Option to apply price rule based on coupon applied(Pro)
- Fix - Loading issue while having large number of rules
- Fix - Compatible issue in woocommerce 2.x - for the event woocommerce_after_cart_item_quantity_update
Download this release
Release Info
Developer | flycart |
Plugin | Discount Rules for WooCommerce |
Version | 1.5.7 |
Comparing to | |
See all releases |
Code changes from version 1.5.6 to 1.5.7
- assets/css/style.css +10 -0
- assets/js/app.js +9 -1
- includes/pricing-rules.php +138 -50
- loader.php +3 -1
- readme.txt +12 -6
- view/view-pricing-rules.php +36 -0
- woo-discount-rules.php +1 -1
assets/css/style.css
CHANGED
@@ -59,4 +59,14 @@
|
|
59 |
#product_list span.select2-container{
|
60 |
min-width: 250px;
|
61 |
width: auto !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
59 |
#product_list span.select2-container{
|
60 |
min-width: 250px;
|
61 |
width: auto !important;
|
62 |
+
}
|
63 |
+
.coupons_to_apply_price_rule_con{
|
64 |
+
margin: 10px 0;
|
65 |
+
}
|
66 |
+
.woo-discount-hint{
|
67 |
+
font-size: 13px;
|
68 |
+
font-style: italic;
|
69 |
+
}
|
70 |
+
.coupons_to_apply{
|
71 |
+
max-width: 250px;
|
72 |
}
|
assets/js/app.js
CHANGED
@@ -289,13 +289,21 @@ function validateFields(){
|
|
289 |
// Manage the Customer.
|
290 |
$('#apply_customer').on('change', function () {
|
291 |
var option = $(this).val();
|
292 |
-
console.log(option);
|
293 |
if (option == 'only_given') {
|
294 |
$('#user_list').show();
|
295 |
} else {
|
296 |
$('#user_list').hide();
|
297 |
}
|
298 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
|
300 |
$(document).on('keyup', '.rule_descr', function () {
|
301 |
var value = $(this).val();
|
289 |
// Manage the Customer.
|
290 |
$('#apply_customer').on('change', function () {
|
291 |
var option = $(this).val();
|
|
|
292 |
if (option == 'only_given') {
|
293 |
$('#user_list').show();
|
294 |
} else {
|
295 |
$('#user_list').hide();
|
296 |
}
|
297 |
});
|
298 |
+
$('#coupon_option_price_rule').on('change', function () {
|
299 |
+
var option = $(this).val();
|
300 |
+
if (option == 'none') {
|
301 |
+
$('.coupons_to_apply_price_rule_con').hide();
|
302 |
+
} else {
|
303 |
+
$('.coupons_to_apply_price_rule_con').show();
|
304 |
+
}
|
305 |
+
});
|
306 |
+
$('#coupon_option_price_rule').trigger('change');
|
307 |
|
308 |
$(document).on('keyup', '.rule_descr', function () {
|
309 |
var value = $(this).val();
|
includes/pricing-rules.php
CHANGED
@@ -60,6 +60,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
60 |
|
61 |
public static $rules_loaded = 0;
|
62 |
public static $pricingRules;
|
|
|
63 |
|
64 |
/**
|
65 |
* FlycartWooDiscountRulesPricingRules constructor.
|
@@ -144,7 +145,9 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
144 |
'product_based_condition',
|
145 |
'product_based_discount',
|
146 |
'rule_order',
|
147 |
-
'product_to_exclude'
|
|
|
|
|
148 |
);
|
149 |
|
150 |
//----------------------------------------------------------------------------------------------------------
|
@@ -509,7 +512,8 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
509 |
* @param int $old_quantity
|
510 |
* @param int $cart
|
511 |
* */
|
512 |
-
public function handleBOGODiscountOnUpdateQuantity($cart_item_key, $quantity, $old_quantity, $cart){
|
|
|
513 |
if(isset($cart->cart_contents) && !empty($cart->cart_contents)){
|
514 |
foreach ($cart->cart_contents as $cart_key => $cartItem){
|
515 |
if($cart_item_key == $cart_key){
|
@@ -517,53 +521,61 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
517 |
break;
|
518 |
}
|
519 |
}
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
}
|
554 |
-
|
555 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
556 |
} else {
|
557 |
-
|
558 |
-
$product = FlycartWoocommerceProduct::wc_get_product($free_product_id);
|
559 |
-
$productParentId = FlycartWoocommerceProduct::get_parent_id($product);
|
560 |
-
if($productParentId){
|
561 |
-
FlycartWoocommerceCart::add_to_cart($productParentId, $bogo_match['count'], $free_product_id, FlycartWoocommerceProduct::get_attributes($product));
|
562 |
-
} else {
|
563 |
-
FlycartWoocommerceCart::add_to_cart($free_product_id, $bogo_match['count']);
|
564 |
-
}
|
565 |
-
add_action('woocommerce_after_cart_item_quantity_update', array($this, 'handleBOGODiscountOnUpdateQuantity'), 10, 4);
|
566 |
}
|
|
|
567 |
}
|
568 |
}
|
569 |
}
|
@@ -627,6 +639,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
627 |
// Default setup for all customers.
|
628 |
$rule_sets[$index]['allow']['users'] = 'all';
|
629 |
$rule_sets[$index]['allow']['user_role'] = true;
|
|
|
630 |
|
631 |
// For quantity based discount
|
632 |
if($rule_sets[$index]['method'] == 'qty_based'){
|
@@ -691,10 +704,15 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
691 |
if(isset($rule->user_roles_to_apply)){
|
692 |
$rule_sets[$index]['allow']['user_role'] = $this->checkWithUserRoles($rule);
|
693 |
}
|
|
|
|
|
|
|
|
|
|
|
694 |
}
|
695 |
|
696 |
// If Current Customer is not Allowed to use this discount, then it's going to be removed.
|
697 |
-
if ($rule_sets[$index]['allow']['users'] == 'no' || !$rule_sets[$index]['allow']['user_role'] || $rule_sets[$index]['allow']['purchase_history'] == 'no') {
|
698 |
unset($rule_sets[$index]);
|
699 |
}
|
700 |
|
@@ -719,6 +737,62 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
719 |
return true;
|
720 |
}
|
721 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
/**
|
723 |
* Check with users purchase history
|
724 |
* */
|
@@ -1053,7 +1127,15 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
1053 |
continue;
|
1054 |
}
|
1055 |
}
|
1056 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1057 |
if($terms){
|
1058 |
$has = 0;
|
1059 |
foreach ($terms as $term) {
|
@@ -1353,8 +1435,6 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
1353 |
*/
|
1354 |
public function isItemInCategoryList($category_list, $product)
|
1355 |
{
|
1356 |
-
$helper = new FlycartWooDiscountRulesGeneralHelper();
|
1357 |
-
$all_category = $helper->getCategoryList();
|
1358 |
if (!isset($product['product_id'])) return false;
|
1359 |
$product_category = FlycartWooDiscountRulesGeneralHelper::getCategoryByPost($product);
|
1360 |
$status = false;
|
@@ -1630,6 +1710,14 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
|
|
1630 |
$status = false;
|
1631 |
}
|
1632 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1633 |
}
|
1634 |
|
1635 |
if ($status) {
|
60 |
|
61 |
public static $rules_loaded = 0;
|
62 |
public static $pricingRules;
|
63 |
+
public static $product_categories = array();
|
64 |
|
65 |
/**
|
66 |
* FlycartWooDiscountRulesPricingRules constructor.
|
145 |
'product_based_condition',
|
146 |
'product_based_discount',
|
147 |
'rule_order',
|
148 |
+
'product_to_exclude',
|
149 |
+
'coupons_to_apply_option',
|
150 |
+
'coupons_to_apply'
|
151 |
);
|
152 |
|
153 |
//----------------------------------------------------------------------------------------------------------
|
512 |
* @param int $old_quantity
|
513 |
* @param int $cart
|
514 |
* */
|
515 |
+
public function handleBOGODiscountOnUpdateQuantity($cart_item_key, $quantity, $old_quantity, $cart = array()){
|
516 |
+
$cart_data = array();
|
517 |
if(isset($cart->cart_contents) && !empty($cart->cart_contents)){
|
518 |
foreach ($cart->cart_contents as $cart_key => $cartItem){
|
519 |
if($cart_item_key == $cart_key){
|
521 |
break;
|
522 |
}
|
523 |
}
|
524 |
+
} else {
|
525 |
+
$carts = FlycartWoocommerceCart::get_cart();
|
526 |
+
foreach ($carts as $cart_item) {
|
527 |
+
if($cart_item_key == $cart_item['key']){
|
528 |
+
$cart_data = $cart_item;
|
529 |
+
break;
|
530 |
+
}
|
531 |
+
}
|
532 |
+
}
|
533 |
+
if(!empty($cart_data)){
|
534 |
+
$carts = FlycartWoocommerceCart::get_cart();
|
535 |
+
if(!empty($carts)){
|
536 |
+
global $woocommerce;
|
537 |
+
|
538 |
+
$this->organizeRules();
|
539 |
+
|
540 |
+
// If there is no rules, then return false.
|
541 |
+
if (!isset($this->rules)) return false;
|
542 |
+
|
543 |
+
// Check point having list of checklist to apply.
|
544 |
+
if ($this->checkPoint()) return false;
|
545 |
+
|
546 |
+
// To Generate Valid Rule sets.
|
547 |
+
$this->generateRuleSets($woocommerce);
|
548 |
+
// Sort cart by price ascending
|
549 |
+
$product_id_new = $cart_data['product_id'];
|
550 |
+
if($cart_data['variation_id']) $product_id_new = $cart_data['variation_id'];
|
551 |
+
$this->bogo_matches = array();
|
552 |
+
$this->matchRules($cart_item_key, $cart_data, 1, 1);
|
553 |
+
if(!empty($this->bogo_matches)){
|
554 |
+
if(count($this->bogo_matches) > 0){
|
555 |
+
foreach ($this->bogo_matches as $free_product_id => $bogo_match){
|
556 |
+
$found = false;
|
557 |
+
foreach ($carts as $cart_item) {
|
558 |
+
$cart_product_id = $cart_item['product_id'];
|
559 |
+
if($cart_item['variation_id']) $cart_product_id = $cart_item['variation_id'];
|
560 |
+
if ($free_product_id == $cart_product_id) {
|
561 |
+
$found = true;
|
562 |
+
$quantity = $cart_item['quantity'];
|
563 |
+
$cart_item_key = $cart_item['key'];
|
564 |
+
break;
|
565 |
}
|
566 |
+
}
|
567 |
+
if ($found) {
|
568 |
+
if($quantity < $bogo_match['count']) FlycartWoocommerceCart::set_quantity($cart_item_key, $bogo_match['count']);
|
569 |
+
} else {
|
570 |
+
remove_action('woocommerce_after_cart_item_quantity_update', array($this, 'handleBOGODiscountOnUpdateQuantity'));
|
571 |
+
$product = FlycartWoocommerceProduct::wc_get_product($free_product_id);
|
572 |
+
$productParentId = FlycartWoocommerceProduct::get_parent_id($product);
|
573 |
+
if($productParentId){
|
574 |
+
FlycartWoocommerceCart::add_to_cart($productParentId, $bogo_match['count'], $free_product_id, FlycartWoocommerceProduct::get_attributes($product));
|
575 |
} else {
|
576 |
+
FlycartWoocommerceCart::add_to_cart($free_product_id, $bogo_match['count']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
}
|
578 |
+
add_action('woocommerce_after_cart_item_quantity_update', array($this, 'handleBOGODiscountOnUpdateQuantity'), 10, 4);
|
579 |
}
|
580 |
}
|
581 |
}
|
639 |
// Default setup for all customers.
|
640 |
$rule_sets[$index]['allow']['users'] = 'all';
|
641 |
$rule_sets[$index]['allow']['user_role'] = true;
|
642 |
+
$rule_sets[$index]['allow']['coupon'] = 1;
|
643 |
|
644 |
// For quantity based discount
|
645 |
if($rule_sets[$index]['method'] == 'qty_based'){
|
704 |
if(isset($rule->user_roles_to_apply)){
|
705 |
$rule_sets[$index]['allow']['user_role'] = $this->checkWithUserRoles($rule);
|
706 |
}
|
707 |
+
|
708 |
+
// check for coupon
|
709 |
+
if(isset($rule->coupons_to_apply_option)){
|
710 |
+
$rule_sets[$index]['allow']['coupon'] = $this->checkWithCouponApplied($rule);
|
711 |
+
}
|
712 |
}
|
713 |
|
714 |
// If Current Customer is not Allowed to use this discount, then it's going to be removed.
|
715 |
+
if ($rule_sets[$index]['allow']['users'] == 'no' || !$rule_sets[$index]['allow']['user_role'] || $rule_sets[$index]['allow']['purchase_history'] == 'no' || !($rule_sets[$index]['allow']['coupon'])) {
|
716 |
unset($rule_sets[$index]);
|
717 |
}
|
718 |
|
737 |
return true;
|
738 |
}
|
739 |
|
740 |
+
/**
|
741 |
+
* Check coupon applied
|
742 |
+
* */
|
743 |
+
public function checkWithCouponApplied($rule){
|
744 |
+
$allowed = 1;
|
745 |
+
if(isset($rule->coupons_to_apply_option)){
|
746 |
+
if($rule->coupons_to_apply_option == 'any_selected'){
|
747 |
+
if(isset($rule->coupons_to_apply) && $rule->coupons_to_apply != ''){
|
748 |
+
$allowed = $this->validatePriceCouponAppliedAnyOne($rule->coupons_to_apply);
|
749 |
+
}
|
750 |
+
} elseif ($rule->coupons_to_apply_option == 'all_selected'){
|
751 |
+
if(isset($rule->coupons_to_apply) && $rule->coupons_to_apply != ''){
|
752 |
+
$allowed = $this->validatePriceCouponAppliedAllSelected($rule->coupons_to_apply);
|
753 |
+
}
|
754 |
+
}
|
755 |
+
}
|
756 |
+
|
757 |
+
return $allowed;
|
758 |
+
}
|
759 |
+
|
760 |
+
/**
|
761 |
+
* check the any one of the selected coupon applied
|
762 |
+
* */
|
763 |
+
protected function validatePriceCouponAppliedAnyOne($coupons_selected){
|
764 |
+
global $woocommerce;
|
765 |
+
$allowed = 0;
|
766 |
+
$coupons = explode(',', $coupons_selected);
|
767 |
+
foreach ($coupons as $coupon){
|
768 |
+
if($woocommerce->cart->has_discount($coupon)){
|
769 |
+
$allowed = 1;
|
770 |
+
break;
|
771 |
+
}
|
772 |
+
}
|
773 |
+
|
774 |
+
return $allowed;
|
775 |
+
}
|
776 |
+
|
777 |
+
/**
|
778 |
+
* check the all the selected coupon applied
|
779 |
+
* */
|
780 |
+
protected function validatePriceCouponAppliedAllSelected($coupons_selected){
|
781 |
+
global $woocommerce;
|
782 |
+
$allowed = 0;
|
783 |
+
$coupons = explode(',', $coupons_selected);
|
784 |
+
foreach ($coupons as $coupon){
|
785 |
+
if(!$woocommerce->cart->has_discount($coupon)){
|
786 |
+
$allowed = 0;
|
787 |
+
break;
|
788 |
+
} else {
|
789 |
+
$allowed = 1;
|
790 |
+
}
|
791 |
+
}
|
792 |
+
|
793 |
+
return $allowed;
|
794 |
+
}
|
795 |
+
|
796 |
/**
|
797 |
* Check with users purchase history
|
798 |
* */
|
1127 |
continue;
|
1128 |
}
|
1129 |
}
|
1130 |
+
|
1131 |
+
$product_id_parent = $cartItem['product_id'];
|
1132 |
+
if(isset(self::$product_categories[$product_id_parent])){
|
1133 |
+
$terms = self::$product_categories[$product_id_parent];
|
1134 |
+
} else {
|
1135 |
+
$terms = get_the_terms( $product_id_parent, 'product_cat' );
|
1136 |
+
self::$product_categories[$product_id_parent] = $terms;
|
1137 |
+
}
|
1138 |
+
|
1139 |
if($terms){
|
1140 |
$has = 0;
|
1141 |
foreach ($terms as $term) {
|
1435 |
*/
|
1436 |
public function isItemInCategoryList($category_list, $product)
|
1437 |
{
|
|
|
|
|
1438 |
if (!isset($product['product_id'])) return false;
|
1439 |
$product_category = FlycartWooDiscountRulesGeneralHelper::getCategoryByPost($product);
|
1440 |
$status = false;
|
1710 |
$status = false;
|
1711 |
}
|
1712 |
}
|
1713 |
+
|
1714 |
+
// check for COUPON
|
1715 |
+
if(isset($rule->coupons_to_apply_option)){
|
1716 |
+
$statusCoupon = $this->checkWithCouponApplied($rule);
|
1717 |
+
if(!$statusCoupon){
|
1718 |
+
$status = false;
|
1719 |
+
}
|
1720 |
+
}
|
1721 |
}
|
1722 |
|
1723 |
if ($status) {
|
loader.php
CHANGED
@@ -144,12 +144,14 @@ if(!class_exists('FlycartWooDiscountRules')){
|
|
144 |
if(version_compare($woocommerce_version, '3.0', '>=')){
|
145 |
add_action('woocommerce_before_calculate_totals', array($this, 'applyDiscountRules'), 1000);
|
146 |
add_action('woocommerce_cart_loaded_from_session', array($this, 'applyCartDiscountRules'), 100);
|
|
|
147 |
} else {
|
|
|
148 |
add_action('woocommerce_cart_loaded_from_session', array($this->discountBase, 'handleDiscount'), 100);
|
149 |
}
|
150 |
|
151 |
add_action('woocommerce_add_to_cart', array($this->pricingRules, 'handleBOGODiscount'), 10, 6);
|
152 |
-
|
153 |
|
154 |
// Manually Update Line Item Name.
|
155 |
add_filter('woocommerce_cart_item_name', array($this->discountBase, 'modifyName'));
|
144 |
if(version_compare($woocommerce_version, '3.0', '>=')){
|
145 |
add_action('woocommerce_before_calculate_totals', array($this, 'applyDiscountRules'), 1000);
|
146 |
add_action('woocommerce_cart_loaded_from_session', array($this, 'applyCartDiscountRules'), 100);
|
147 |
+
add_action( 'woocommerce_after_cart_item_quantity_update', array($this->pricingRules, 'handleBOGODiscountOnUpdateQuantity'), 10, 4 );
|
148 |
} else {
|
149 |
+
add_action( 'woocommerce_after_cart_item_quantity_update', array($this->pricingRules, 'handleBOGODiscountOnUpdateQuantity'), 10, 3 );
|
150 |
add_action('woocommerce_cart_loaded_from_session', array($this->discountBase, 'handleDiscount'), 100);
|
151 |
}
|
152 |
|
153 |
add_action('woocommerce_add_to_cart', array($this->pricingRules, 'handleBOGODiscount'), 10, 6);
|
154 |
+
|
155 |
|
156 |
// Manually Update Line Item Name.
|
157 |
add_filter('woocommerce_cart_item_name', array($this->discountBase, 'modifyName'));
|
readme.txt
CHANGED
@@ -4,16 +4,16 @@ Donate link: https://flycart.org/
|
|
4 |
Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts
|
5 |
Requires at least: 4.4.1
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.5.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
-
Create simple to complex discount rules,
|
12 |
== Description ==
|
13 |
|
14 |
-
WooCommerce discount rules helps you to create any type of bulk discounts, dynamic pricing
|
15 |
|
16 |
-
You can set discounts for product and also for each product variation.
|
17 |
|
18 |
Discounts will be visible in product page, product details page, cart, checkout and in email notifications.
|
19 |
|
@@ -29,9 +29,10 @@ Display the pricing discount table beautifully on the product page. Start sellin
|
|
29 |
* Dynamic pricing and discounts for WooCommerce
|
30 |
* Option to set discounts for each variant - PRO feature
|
31 |
* Buy One and Get One Free discounts in WooCommerce (BOGO Deals) - PRO feature
|
32 |
-
* Cart discounts in WooCommerce
|
33 |
-
* User role based dynamic pricing and discounts for your WooCommerce store - PRO feature
|
34 |
* Dependant product based discounts (Buy Product A and get discount on Product B) - PRO feature
|
|
|
35 |
* Option to set discount for each product variant. - PRO feature
|
36 |
* Option to set Discount for All Products or Global Discount
|
37 |
* Display or hide the Discount table in Product Page
|
@@ -241,6 +242,11 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
|
|
241 |
|
242 |
== Changelog ==
|
243 |
|
|
|
|
|
|
|
|
|
|
|
244 |
= 1.5.6 - 26/03/18 =
|
245 |
* Feature - Option to add free quantity for BOGO rules(Pro)
|
246 |
* Fix - Display strikeout price based on shop tax in product page.
|
4 |
Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts
|
5 |
Requires at least: 4.4.1
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.5.7
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
+
Create simple to complex discount rules, dynamic pricing and discounts for your WooCommerce online store.
|
12 |
== Description ==
|
13 |
|
14 |
+
WooCommerce discount rules helps you to create any type of bulk discounts, dynamic pricing, advanced discounts for your products. Offer Product quantity based discounts, cart based discounts at a percentage or fixed amount or Buy One and Get one free (BOGO) deals. Increase your sales multifold by offering dynamic pricing and discounts based on categories, products, user roles, cart items and much more.
|
15 |
|
16 |
+
You can set discounts for product and also for each product variation. You can also create customer specific, user roles based discounts.
|
17 |
|
18 |
Discounts will be visible in product page, product details page, cart, checkout and in email notifications.
|
19 |
|
29 |
* Dynamic pricing and discounts for WooCommerce
|
30 |
* Option to set discounts for each variant - PRO feature
|
31 |
* Buy One and Get One Free discounts in WooCommerce (BOGO Deals) - PRO feature
|
32 |
+
* Cart discounts in WooCommerce (Example: Spend more than $1000, get 10% discount)
|
33 |
+
* User role based dynamic pricing and discounts for your WooCommerce store - PRO feature (Example: Wholesale customers get a discounted price)
|
34 |
* Dependant product based discounts (Buy Product A and get discount on Product B) - PRO feature
|
35 |
+
* Coupons based discount rules (The discount will apply after a coupon is entered.)
|
36 |
* Option to set discount for each product variant. - PRO feature
|
37 |
* Option to set Discount for All Products or Global Discount
|
38 |
* Display or hide the Discount table in Product Page
|
242 |
|
243 |
== Changelog ==
|
244 |
|
245 |
+
= 1.5.7 - 09/04/18 =
|
246 |
+
* Feature - Option to apply price rule based on coupon applied(Pro)
|
247 |
+
* Fix - Loading issue while having large number of rules
|
248 |
+
* Fix - Compatible issue in woocommerce 2.x - for the event woocommerce_after_cart_item_quantity_update
|
249 |
+
|
250 |
= 1.5.6 - 26/03/18 =
|
251 |
* Feature - Option to add free quantity for BOGO rules(Pro)
|
252 |
* Fix - Display strikeout price based on shop tax in product page.
|
view/view-pricing-rules.php
CHANGED
@@ -256,6 +256,42 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
|
|
256 |
</div>
|
257 |
</div>
|
258 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
<div class="form-group">
|
260 |
<div class="row">
|
261 |
<div class="col-md-3"><label><?php esc_html_e('Purchase History', 'woo-discount-rules'); ?></label></div>
|
256 |
</div>
|
257 |
</div>
|
258 |
</div>
|
259 |
+
<div class="form-group">
|
260 |
+
<div class="row">
|
261 |
+
<div class="col-md-3"><label> <?php esc_html_e('Coupon', 'woo-discount-rules') ?> </label></div>
|
262 |
+
<div class="col-md-6">
|
263 |
+
<?php
|
264 |
+
if($pro){
|
265 |
+
$coupons_to_apply_option = isset($data->coupons_to_apply_option) ? $data->coupons_to_apply_option : 'none';
|
266 |
+
$coupons_to_apply = isset($data->coupons_to_apply) ? $data->coupons_to_apply : '';
|
267 |
+
?>
|
268 |
+
<select class="selectpicker" id="coupon_option_price_rule" name="coupons_to_apply_option">
|
269 |
+
<option value="none"<?php if ($coupons_to_apply_option == 'none') { ?> selected=selected <?php } ?>><?php esc_html_e('None selected', 'woo-discount-rules'); ?></option>
|
270 |
+
<option value="any_selected"<?php if ($coupons_to_apply_option == 'any_selected') { ?> selected=selected <?php } ?>><?php esc_html_e('Apply if any one coupon applied', 'woo-discount-rules'); ?></option>
|
271 |
+
<option value="all_selected"<?php if ($coupons_to_apply_option == 'all_selected') { ?> selected=selected <?php } ?>><?php esc_html_e('Apply if all coupon applied', 'woo-discount-rules'); ?></option>
|
272 |
+
</select>
|
273 |
+
<div class="coupons_to_apply_price_rule_con">
|
274 |
+
<span class="woo-discount-hint">
|
275 |
+
<?php
|
276 |
+
esc_html_e('Enter the coupon code separated by comma(,)', 'woo-discount-rules');
|
277 |
+
?>
|
278 |
+
</span>
|
279 |
+
<input class="form-control coupons_to_apply" id="coupons_to_apply" name="coupons_to_apply" value="<?php echo $coupons_to_apply; ?>"/>
|
280 |
+
</div>
|
281 |
+
<?php
|
282 |
+
} else {
|
283 |
+
?>
|
284 |
+
<div class="woo-support-in_pro">
|
285 |
+
<?php
|
286 |
+
esc_html_e('Supported in PRO version', 'woo-discount-rules');
|
287 |
+
?>
|
288 |
+
</div>
|
289 |
+
<?php
|
290 |
+
}
|
291 |
+
?>
|
292 |
+
</div>
|
293 |
+
</div>
|
294 |
+
</div>
|
295 |
<div class="form-group">
|
296 |
<div class="row">
|
297 |
<div class="col-md-3"><label><?php esc_html_e('Purchase History', 'woo-discount-rules'); ?></label></div>
|
woo-discount-rules.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Simple Discount Rules for WooCommerce.
|
6 |
* Author: Flycart Technologies LLP
|
7 |
* Author URI: https://www.flycart.org
|
8 |
-
* Version: 1.5.
|
9 |
* Slug: woo-discount-rules
|
10 |
* Text Domain: woo-discount-rules
|
11 |
* Requires at least: 4.6.1
|
5 |
* Description: Simple Discount Rules for WooCommerce.
|
6 |
* Author: Flycart Technologies LLP
|
7 |
* Author URI: https://www.flycart.org
|
8 |
+
* Version: 1.5.7
|
9 |
* Slug: woo-discount-rules
|
10 |
* Text Domain: woo-discount-rules
|
11 |
* Requires at least: 4.6.1
|