Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping by Rules for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

1 cart - 2 rules 22 Nov 2017 12:09 #1

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
Hello

I apologise if this has been answered previously.

I have the following rules for UK Domestic Delivery.

The problem rule is the first one.

The aim is that Delivery is Free for the ONE category (134).

It works fine PROVIDED there is/are ONLY item(s) in that category in the Cart.

It fails when there are items for category 134 AND item(s) from one or more additional categories.

The failing is that Free delivery is applied to ALL the items in the Cart, irrespective of the categories.

I hope you can instruct the correct syntax so that Free delivery is applied ONLY to category 134 when there are items from other categories in the same cart.

TIA
Eddie

Name="Free Standard Shipping";UK_Area in list ("AB","AL","B","BA","BB","BD","BF","BH","BL","BN","BR","BS","BT","CA","CB","CF","CH","CM","CO","CR","CT","CV","CW","DA","DD","DE","DG","DH","DL","DN","DT","DY","E","EC","EH","EN","EX","FK","FY","G","GL","GU","GY","HA","HD","HG","HP","HR","HS","HU","HX","IG","IM","IP","IV","JE","KA","KT","KW","KY","L","LA","LD","LE","LL","LN","LS","LU","M","ME","MK","ML","N","NE","NG","NN","NP","NR","NW","OL","OX","PA","PE","PH","PL","PO","PR","RG","RH","RM","S","SA","SE","SG","SK","SL","SM","SN","SO","SP","SR","SS","ST","SW","SY","TA","TD","TF","TN","TQ","TR","TS","TW","UB","W","WA","WC","WD","WF","WN","WR","WS","WV","YO","ZE");Condition=contains_any(Categories, 134);0.00
Name="Free Shipping";UK_Area in list ("AB","AL","B","BA","BB","BD","BF","BH","BL","BN","BR","BS","BT","CA","CB","CF","CH","CM","CO","CR","CT","CV","CW","DA","DD","DE","DG","DH","DL","DN","DT","DY","E","EC","EH","EN","EX","FK","FY","G","GL","GU","GY","HA","HD","HG","HP","HR","HS","HU","HX","IG","IM","IP","IV","JE","KA","KT","KW","KY","L","LA","LD","LE","LL","LN","LS","LU","M","ME","MK","ML","N","NE","NG","NN","NP","NR","NW","OL","OX","PA","PE","PH","PL","PO","PR","RG","RH","RM","S","SA","SE","SG","SK","SL","SM","SN","SO","SP","SR","SS","ST","SW","SY","TA","TD","TF","TN","TQ","TR","TS","TW","UB","W","WA","WC","WD","WF","WN","WR","WS","WV","YO","ZE");75.00<=Amount;Condition=contains_none(Categories, 134,249);0.00
Name="First Class";UK_Area in list ("AB","AL","B","BA","BB","BD","BF","BH","BL","BN","BR","BS","BT","CA","CB","CF","CH","CM","CO","CR","CT","CV","CW","DA","DD","DE","DG","DH","DL","DN","DT","DY","E","EC","EH","EN","EX","FK","FY","G","GL","GU","GY","HA","HD","HG","HP","HR","HS","HU","HX","IG","IM","IP","IV","JE","KA","KT","KW","KY","L","LA","LD","LE","LL","LN","LS","LU","M","ME","MK","ML","N","NE","NG","NN","NP","NR","NW","OL","OX","PA","PE","PH","PL","PO","PR","RG","RH","RM","S","SA","SE","SG","SK","SL","SM","SN","SO","SP","SR","SS","ST","SW","SY","TA","TD","TF","TN","TQ","TR","TS","TW","UB","W","WA","WC","WD","WF","WN","WR","WS","WV","YO","ZE");1<=Weight<=1000;1<=Amount<=30.00;Condition=contains_none(Categories, 134,243,249);3.30
Name="First Class";UK_Area in list ("AB","AL","B","BA","BB","BD","BF","BH","BL","BN","BR","BS","BT","CA","CB","CF","CH","CM","CO","CR","CT","CV","CW","DA","DD","DE","DG","DH","DL","DN","DT","DY","E","EC","EH","EN","EX","FK","FY","G","GL","GU","GY","HA","HD","HG","HP","HR","HS","HU","HX","IG","IM","IP","IV","JE","KA","KT","KW","KY","L","LA","LD","LE","LL","LN","LS","LU","M","ME","MK","ML","N","NE","NG","NN","NP","NR","NW","OL","OX","PA","PE","PH","PL","PO","PR","RG","RH","RM","S","SA","SE","SG","SK","SL","SM","SN","SO","SP","SR","SS","ST","SW","SY","TA","TD","TF","TN","TQ","TR","TS","TW","UB","W","WA","WC","WD","WF","WN","WR","WS","WV","YO","ZE");1001<=Weight<=2000;1<=Amount<=30.00;Condition=contains_none(Categories, 134,243,249);3.90

1 cart - 2 rules 25 Nov 2017 22:51 #2

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
Will I receive a response?

1 cart - 2 rules 02 Dec 2017 17:52 #3

Dear Eddie,
Sorry to hear about your issues with the shipping plugin.
Our shipping plugin is generally designed to determine shipping costs on the cart-level, not per-product. From your description it appears to me that you want to specify shipping costs per-product, which are then summed up to the total shipping costs. In our plugin, however, when you say "shipping=0" this always applies to the whole order, not to individual products.

Having said that, there are, however, ways to implement a shipping cost structure like yours. I'll try to summarize your shipping costs as far as I understand them from your description and your rules:
  • All following conditions / requirements apply only to certain UK_Area codes
  • Shipping is based on weight and amount of the whole order, but items from category 134 should NOT be included in the weight / amount used to calculate shipping.
I'm not sure what you want to achieve with out contains_none(Categories, 134, 243, 249) restrictions...

As a side note: You are using the same, lengthy UK_Area condition in all rules. It would be much easier and better to handle if you store the check in a variable and re-use it in your rules (see below).

Here is how I would implement these shipping costs:
Variable=isValidUKArea; Value=UK_Area in list ("AB","AL","B","BA","BB","BD","BF","BH","BL","BN","BR","BS","BT","CA","CB","CF","CH","CM","CO","CR","CT","CV","CW","DA","DD","DE","DG","DH","DL","DN","DT","DY","E","EC","EH","EN","EX","FK","FY","G","GL","GU","GY","HA","HD","HG","HP","HR","HS","HU","HX","IG","IM","IP","IV","JE","KA","KT","KW","KY","L","LA","LD","LE","LL","LN","LS","LU","M","ME","MK","ML","N","NE","NG","NN","NP","NR","NW","OL","OX","PA","PE","PH","PL","PO","PR","RG","RH","RM","S","SA","SE","SG","SK","SL","SM","SN","SO","SP","SR","SS","ST","SW","SY","TA","TD","TF","TN","TQ","TR","TS","TW","UB","W","WA","WC","WD","WF","WN","WR","WS","WV","YO","ZE")
Variable=RelevantWeight; Value=Weight-evaluate_for_categories(Weight, 134)
Variable=RelevantAmount; Value=Amount-evaluate_for_categories(Amount, 134)

Name="Free Standard Shipping"; Condition=isValidUKArea; Condition=contains_only(Categories, 134);0.00
Name="Free Shipping"; Condition=isValidUKArea; 75.00<=RelevantAmount; 0.00
Name="First Class"; Condition=isValidUKArea; 1<=RelevantWeight<=1000;1<=RelevantAmount<=30.00; 3.30
Name="First Class";Condition=isValidUKArea; 1001<=RelevantWeight<=2000;1<=RelevantAmount<=30.00;3.90

The category 134 is handled in two ways: Orders with product from only category 134 explicitly get free shipping. For orders with products from category 134 and other products, we use the "normal" calculations, but instead of Amount and Weight we calculate the amount and weight of all products not belonging to category 134 (i.e. the total Weight minus the weight of the products from category 134). All shipping conditions are then based on these new / adjusted weight and amount variables.

I hope I understood your shipping cost structure correctly.
Please note that you have gap for 30<Amount<75.

Best regards,
Reinhold

1 cart - 2 rules 05 Dec 2017 02:09 #4

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
Hello Reinhold
Thanks for the comprehensive reply.
I will take in what you have suggested and respond asap.
As for the 'gap'.
There is no actual gap as the shipping method is available only for general product order amounts upto £30.
The free shipping option for orders over £75 should actually be removed as it is handled elsewhere.
Orders over £30 are handled elsewhere.
I will respond soon re your recommendations.
Best
Eddie

1 cart - 2 rules 06 Dec 2017 12:53 #5

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
Hello Reinhold

Ok, I have started to look at the new solution.

1) You said: "I'm not sure what you want to achieve with out contains_none(Categories, 134, 243, 249) restrictions..."

The product must not fall into any of the categories

2) To begin with, I replaced my rule with your proposed rule.
See screenshot Warning.

I will await your revision

Thanks

Eddie
Attachments:

1 cart - 2 rules 11 Dec 2017 18:52 #6

Dear Eddie,
You are missing a semicolon before Variable=

Best regards,
Reinhold

1 cart - 2 rules 11 Dec 2017 19:02 #7

  • 4FootyFans
  • 4FootyFans's Avatar Topic Author
Hello Reinhold

Is that every incidence of Variable= ?

So, ;Variable= in each of the 3 incidences?

Thanks

Eddie

1 cart - 2 rules 11 Dec 2017 19:08 #8

Dear Eddie,
No, the semicolon is not needed as part of "Variable=..", but it is required as a separator. The error message says that it tries to interpret a rule
Value=Weight-evaluate_for_categories(Weight, 134) Variable=RelevantAmount

In the rules, the Value=... and the Variable=.. parts need to be separated by a semicolon.
Looking a bit closer at the message, the real cause might be that you were missing a linebreak between the valuate_for_categories(Weight, 134) and the Variable=RelevantAmount...

Beest regards,
Reinhold
  • Page:
  • 1