VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Tried so hard to filter by coupon or categories

Tried so hard to filter by coupon or categories 05 Jun 2017 13:42 #1

List function 'contains_any' requires the first argument to be lists. (Full rule: 'Name=Posten Original Box 12st 6-12kg box fee + logistic cost;Condition=contains_any(Coupons,"allsemp"); Weight>=6; Shipping=280')

above is always the warning for the incorrect results.
i tried contains_any(Categories,"") and write slug name into it, it does not filter at all and run as that line is ignored.
So i tried Coupons instead but it always tell the first arguments should be lists no matter the coupon code is in the cart or not.

what has happened?
So urgent to get help from you
Best regards!
The administrator has disabled public write access.

Tried so hard to filter by coupon or categories 05 Jun 2017 14:22 #2

Dear SeanZXC,
1. Are you using the advanced version of the plugin? The basic version does NOT provide the coupon codes in the Coupon variable. This would explain your error message.

2. Regarding your contains_any problem: You might try prepending "Condition=" to the contains_any call. If you use a slug like Condition=contains_any(Categories, "your-slug"), then that line should only match when a product from that category is in the cart. If not, that line is ignored and the next line is considered.

Best regards,
Reinhold
The administrator has disabled public write access.

Tried so hard to filter by coupon or categories 05 Jun 2017 15:09 #3

yes, i am using the advanced version for sure. This account is the one purchased the advanced version.
The administrator has disabled public write access.

Tried so hard to filter by coupon or categories 05 Jun 2017 15:10 #4

the attachment pic shows the advanced plugin screenshot in woocommerce
Attachments:
The administrator has disabled public write access.

Tried so hard to filter by coupon or categories 05 Jun 2017 15:14 #5

update credential is activated, the order number is WC-16-1030 and the password is what i suppose to write
The administrator has disabled public write access.

Tried so hard to filter by coupon or categories 05 Jun 2017 16:09 #6

Dear SeanZXC,
Thank you for the screenshot of the plugin area. It seems you are still using plugin version 1.2.1, which is known to have a bug with the coupons. The bugfix release 1.2.2 fixed this (see also our changelog: open-tools.net/documentation/advanced-sh...merce.html#changelog).

If you don't want to update to the latest version, you can manually apply the fix to your installed version of the plugin: The diff is
diff --git a/includes/rules_shipping_framework_woocommerce_advanced.php b/includes/rules_shipping_framework_woocommerce_advanced.php
index 0ec927d..77c89f3 100644
--- a/includes/rules_shipping_framework_woocommerce_advanced.php
+++ b/includes/rules_shipping_framework_woocommerce_advanced.php
@@ -42,10 +42,8 @@ class RulesShippingFrameworkWooCommerceAdvanced extends RulesShippingFrameworkWo
        }
        
        protected function addCustomCartValues ($cart, $products, $method, &$values) {
-               $data = array(
-                       'coupons'    => $cart['applied_coupons'],
-               );
-               return $data;
+               $values['coupons'] = $cart['applied_coupons'];
+               return $values;
        }
        
 

If you are not familiar with reading and applying a diff / patch like this, simply open the file includes/rules_shipping_framework_woocommerce_advanced.php, search for the function addCustomValues and replace these lines:
        protected function addCustomCartValues ($cart, $products, $method, &$values) {
               $data = array(
                       'coupons'    => $cart['applied_coupons'],
               );
               return $data;
        }
with this corrected version:
        protected function addCustomCartValues ($cart, $products, $method, &$values) {
               $values['coupons'] = $cart['applied_coupons'];
               return $values;
        }

Best regards,
Reinhold
The administrator has disabled public write access.

Tried so hard to filter by coupon or categories 05 Jun 2017 16:38 #7

Fantastic, it works pretty well!
Thank you a lot for your updating services. Really appreciate your plugins.
The administrator has disabled public write access.

[SOLVED] Tried so hard to filter by coupon or categories 05 Jun 2017 16:38 #8

Problem solved.
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular