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:

Rule to exclude amount of a category 27 Mar 2015 14:14 #1

  • r.spierings
  • r.spierings's Avatar Topic Author
Investigating if this shipment plugin is capable to my needs

cat1 category with packaging deposits
cat2 category with products
cat3 category with products
etc.

Shipment costs has to be determined over total amount cart without amount cat1. Amount cart (without amount cat1) below 50 then 7.50 costs, above 50 free shipping

Used rule:
Name="Shipping under 50"; Categories!=list(15);amount < 50; Shipping=7.50
Name="Free shipping above 50"; Categories!=list(15);amount >= 50; Shipping=0

this is not functioning. Can't figure out how to set the correct rule or maybe not possible?

Regards,
Ronald

Rule to exclude amount of a category 29 Mar 2015 13:28 #2

Dear Ronald,
If I understand you correctly, you want to base your shipping costs only onthe weight of all products except those from cat1. The shipping cost is a fixed cost, independent from the quantity of articles or the categories (except cat1)? What if produts from cat1 are ordered? Do you not want to provide shipping at all in this case, or does is simply not influence the shipping cost, i.e. is the shipping the same whether a product from cat1 is in the cart or not? In the following, I'm using the second case (cat1 products are simply free to ship).

In this case, I would use a rule set like the following (defining a custom variable for convenience), where 42 is the ID of your cat1 (change it to your actual category ID of cat1):
Variable=AmountExCat1; Value = Amount - evaluate_for_categories(Amount, 42)
Name=Shipping under 50; AmountExCat1 < 50; Shipping=7.50
Name=Free shipping above 50; AmountExCat1 >=50; Shipping=0

The logic is as follows: As you shipping depends only on the total amount of all products minus the amount of products from cat1, we first calculate this and store it in separate variable for convenience.

In the following rules, you can then use this custom variable "AmountExCat1" just like any other variable. In these rules, you don't need any category checks any more, because the only place where the category is important is in the definition of AmountExCat1...

Best regards,
Reinhold

Rule to exclude amount of a category 31 Mar 2015 02:29 #3

  • r.spierings
  • r.spierings's Avatar Topic Author
Hello reinhold,

Thx for the solution, but....

Tried the suggested rule at your demo site. This wil generate an error:
Unknown function 'calculate_for_categories' encountered during evaluation of rule 'Variable=AmountExCat1; Value = Amount - calculate_for_categories(Amount, 15)'.

Rule is not working

How to proceed?

Regards,
Ronald

Rule to exclude amount of a category 31 Mar 2015 02:32 #4

Hi Ronald,
Sorry, that function should be evaluate_for_categories... Sorry for the typo.

Best regards,
Reinhold

Rule to exclude amount of a category 31 Mar 2015 02:43 #5

  • r.spierings
  • r.spierings's Avatar Topic Author
Thx for the quick reply. Sorry to say still not working using your own demo site:
Shipping method: Shipping without packaging deposit (id = 167)
using cat id 15 for exluding costs
Using testarticle from cat 15 (id = 68)
After adding testarticles over total amount of 50 shipping goes to free shipping. Should still be 7.50 according rule that costs of cat 15 are excluded

Regards,
Ronald

Rule to exclude amount of a category 01 Apr 2015 08:37 #6

  • r.spierings
  • r.spierings's Avatar Topic Author
Trying to implement the rule suggested but right now i get an error:

Fatal error: Call to protected method plgVmShipmentRules_Shipping_Base::getCartValues() from context '' in /public/sites/....../plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 283

Who knows why this error is present? Using a simple rule no problem but when using the expression evaluate_for_categories i get a white page with above error.

Regards,
Ronald

---edit---
Using Joomla 3.4.1 and VirtueMart 3.0.6.4. It seems that Advanganged Shipping rules for Virtuemart version 5.3 is not compatible.

Rule to exclude amount of a category 01 Apr 2015 23:58 #7

  • r.spierings
  • r.spierings's Avatar Topic Author
Found another post "Blank page after modifying the shipping rules". Seems the same problem with the function evaluate_for_categories.

Is this a bug? When so, could this be checked and solved?

Regards,
Ronald

Rule to exclude amount of a category 02 Apr 2015 15:11 #8

Sent an updated test version via private mail. Please let me know whether that version fixes your issue.


If it does not fix the issue, could you please try and enable full error reporting in Joomla (Menu "System" => "Global Configuration" => Tab "Server" => set "Error Reporting" to "Development"). This will print out the php errors with a nice table (with backtrace information) into the html page rather than only into the webserver log. That error message should then give use more hints what's wrong.

Best regards,
Reinhold

Rule to exclude amount of a category 02 Apr 2015 21:34 #9

  • r.spierings
  • r.spierings's Avatar Topic Author
Hello Reinhold,

I installed the updated test version. This solved the problem and the evaluate_for_categories function is working correct.

Thx for this fix.

Regards,
Ronald

[SOLVED] Rule to exclude amount of a category 02 Apr 2015 21:35 #10

  • r.spierings
  • r.spierings's Avatar Topic Author
Problem solved.
  • Page:
  • 1