Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Forum

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:

Need some help 22 Aug 2015 10:11 #1

  • dirkfranz
  • dirkfranz's Avatar Topic Author
Hi guys ... would need some help to get the formula right. (J3 VM3.9.4 Plugin v.5.5)

I basically have a mix of conditions.

Basic shipping is 15.-

except ...

Categories (1,3,14,13) which cost 29.-
Products (gutschein10,gutschein20,gutschein50,10er-abo) with free shipping.

Below is my formula and as you can see, it´s not working as intended. I was going through the posts, and understand why, but have not found something that would help me to resolve it myself. Not really good with formulas, math ...

The Plugin goes from top to bottom and goes for the 1st condition it finds ... (example) the moment it finds shipping "0" the basic shipping is not applied anymore. If I move basic shipping up, it´s not applying the shipping "0" correctly either.

How could I do that without having to go and apply to all left categories and product individual shipping costs, that would be overkill I guess. Help or hints into the right direction would be greatly appreciated.

formula
Name="Lieferung gekühlt"; 1 in Categories; Shipping=29
Name="Lieferung gekühlt"; 3 in Categories; Shipping=29
Name="Lieferung gekühlt"; 14 in Categories; Shipping=29
Name="Lieferung gekühlt"; 13 in Categories; Shipping=29
Name="Freie Lieferung Gutschein 10”; "gutschein10" in SKUs; Shipping=0
Name="Freie Lieferung Gutschein 20”; "gutschein20" in SKUs; Shipping=0
Name="Freie Lieferung Gutschein 50”; "gutschein50" in SKUs; Shipping=0
Name="Freie Lieferung Eier Abo”; "10er-abo" in SKUs; Shipping=0
Name="Lieferung normal"; Shipping=15

Need some help 30 Aug 2015 15:18 #2

Dear Dirk Franz,
The proper rules heavily depend on the very details of your shipping cost structure.

When you say "Basic shipping is 15,-", so you mean the shipping for the whole package is 15€, except if categories 1, 3, 13 or 14 are in the cart, in which case shipping is 29€ for the whole order?

In that case, your rules should work as expected, but they can be simplified to (the vouchers cannot be simplified, because you apparently want a different name displayed):
Name="Lieferung gekühlt"; contains_any(Categories, 1, 3, 13, 14); Shipping=29
Name="Freie Lieferung Gutschein 10”; "gutschein10" in SKUs; Shipping=0
Name="Freie Lieferung Gutschein 20”; "gutschein20" in SKUs; Shipping=0
Name="Freie Lieferung Gutschein 50”; "gutschein50" in SKUs; Shipping=0
Name="Freie Lieferung Eier Abo”; "10er-abo" in SKUs; Shipping=0
Name="Lieferung normal"; Shipping=15

Or do you mean that EACH PRODUCT costs 15,- to ship, except products from categories 1, 3, 13 and 14 (shipping cost of 29 for each article) and except for the vouchers, which are free? In that case, you need to know that the plugin is actually NOT designed to calculate per-product shipping. There are, however, some workarounds to achieve what you want:
Variable=GekühltArticleCount; Value=evaluate_for_categories(articles, 1, 3, 13, 14)
Variable=NormalShippingArticleCount; Value=articles - GekühltArticleCount - evaluate_for_skus(articles, "gutschein10", "gutschein20", "gutschein50", "10er-abo")
Shipping=29*GekühltArticleCount + 15*NormalShippingArticleCount
This first calculates how many articles get shipping costs of 29 (the number of articles from categories 1,3,13 and 14), and then calculates hoe many carticles get normal shipping costs (the total number of articles in the order, except the free-shipping articles and the articles with cost 29, so we need to subtract theh number of those articles from the total number of articles).

Or do you rather want to have the following logic:
1. If at least one article from categories 1, 3, 13 or 14 is purchased, shipping costs for the total order are 29€
2. Otherwise, if ONLY vouchers or "10er-abo" are ordered, then the shipping cost is 0€
3. In all other cases, shipping is 15

This can be implemented via the following rules:
Name="Lieferung gekühlt"; contains_any(Categories, 1, 3, 13, 14); Shipping=29
Name="Freie Lieferung Gutscheine und Eiser Abo”; contains_only(SKUs, "gutschein10", "gutschein20",  "gutschein50", "10er-abo"); Shipping=0
Name="Lieferung normal"; Shipping=15

As you can see, depending on what you mean exactly, the rules look quite different (but all three possible interpretations can be implemented using the advanced version of the plugin).

Best regards,
Reinhold
  • Page:
  • 1