VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: Categorie's

Categorie's 31 Oct 2017 12:30 #1

Hello Reinhold,

I Bought the advenced version of Shipping by Rules.
My question is :
We sell dogg collars, leashes, Harness, cups, t-shirts and cushions it's all in differend packets.
Max. 2 collars can in a envelope, so if you have more it will be een package .
T-Shirt max 1 go in a envelope.
The rest must be a package

How can a make that possible??

Gr Rob
The administrator has disabled public write access.

Categorie's 02 Nov 2017 13:28 #2

Dear Robcom,
How do you decide (technically) what is a dog collar and what is a T-Shirt? Do you use categories or manufacturers?

In the following example, I'm assuming your dog collars are in category 1234 (or any of its subcategories) and T-Shirts are in category 2345 and subcats (I.e. all products from category 1234 and any of its subcategories will be considered dog collars!). To be eligible for an envelope, there must be at most 2 dog collars and at most 1 T-Shirt in the order. Everything else will be a package:
Name=Envelope; evaluate_for_subcategories(Articles, 1234)<=2; evaluate_for_subcategories(Articles, 2345)<=1; Shipping=1
Name=Everything else is a Package; Shipping=15

If you have multiple different rates for envelopes (e.g. depending on ZIP and/or amount), then I would store the evaluate_for_subcategories calls in a separate variable and reuse that:
Variable=IsEnvelope; Value = (evaluate_for_subcategories(Articles, 1234)<=2) AND (evaluate_for_subcategories(Articles, 2345)<=1)
Name=Envelope; Condition=IsEnvelope; Amount>100; Shipping=0
Name=Envelope; Condition=IsEnvelope; Amount<=100; Shipping=1
Name=Everything else is a Package; Shipping=15

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

Categorie's 02 Nov 2017 13:30 #3

Dear Robcom,
I saw from your other post that you appear to be running WooCommerce (you posted this in the VirtueMart section). For WooCommerce, the approach is similar, the only difference being that categories in WooCommerce are identified by their SLUG rather than their numerical ID:
Variable=IsEnvelope; Value = (evaluate_for_subcategories(Articles, "dog-collars")<=2) AND (evaluate_for_subcategories(Articles, "t-shirts")<=1)

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

Categorie's 05 Nov 2017 08:41 #4

Hello Reinhold,
I'am using categories like Halsband, Bekers, ect...
And i use subcategories by Halsband like 4x50 cm and 4x55cm, 5x50cm and so on.
Thera are different size to work with. So it's very complex i think.
The administrator has disabled public write access.

Categorie's 11 Nov 2017 17:31 #5

Dear Robcom,
From your description is seems that you have built a nice hierarchy if categories, so you can easily use the evaluate_for_subcategories function. If you want to allow at most 2 articles from the Halsband category (or any of its subcategories!), the condition is simply 'evaluate_for_subcategories(Articles, "Halsband")<=2'. You don't have to check all subcategories separately, the evaluate_for_subcategories function does this for you.

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

VM - Shopping cart

 x 

Cart empty

Login Formular