Hi,
I need to be able to offer free shipping for certain categories, only if all products of those categories are in cart. In case of mixed products, the standard rate should be applied. Out of the box the plugin works with "if ANY product in cart in a certain category".
I've checked the code in weight_countries.php and in line 320 there is this comment:
//if all products in a certain category, display the shipment
but I don't see any code right after it.
Any insights on how to change the logic of this plugin (it's the standard plugin coming with VM aio)?
Hello
You have three choices:
- Hack the shipment plugin
- Make an override
- Create a copy of the plugin under new name and add your new functions
Option nr 3 is probably the best, but nr 2 could work.
regards
Jörgen @ Kreativ Fotografi
I was looking for some kind of tinkering, but I don't know what to change in the code in order to switch "ANY" to "ALL".
That's what I was hoping to find in here actually..
See https://shop.st42.fr/en/tools/shipment-rules.htm
You have many way to filter, not only inlcuding/excluding categories. Eg; customfield, SKU ... so with this plugin you can solve your problem
Thank You Patrick
Didn´t think about that You might have one that would work.
regards
Jörgen @ Kreativ Fotografi
You could also look at this "Shipping by Rules" plugin by Open Tools, we use it on our site and find it quite flexible with the rules you can implement.
https://open-tools.net/component/content/article/22-virtuemart-2-extensions/46-rules-examples-for-shipping-by-rules.html (https://open-tools.net/component/content/article/22-virtuemart-2-extensions/46-rules-examples-for-shipping-by-rules.html)
Ok, I''ve written a script to hide a certain shipping method in One Page Checkout, but I do not know which file to put it in. I know it must have something to do with AJAX, since this is how the cart is recalculated after each change in shipping or payment method..