Hello everyone. This is my first post here so I apologize if I do not do it correctly. I am using Woocommerce Advanced Shipping plugin on a winery website to programmatically offer penny (0.01USD) shipping for orders with 6 or more bottles (as it is efficient to ship in multiples of 6). However, this client offers products that include 2 or 3 bottles. The quantity condition does not work for me because a three-bottle product counts as a single product when calculated for quantity.
I have begun trying to write a custom condition function as the guide here explains: http://docs.shopplugins.com/article/41-developer-adding-a-custom-condition
I feel like I am getting close, but it still does not work. Here is my code: http://pastebin.com/1ZMj4W7F
I am very familiar with developing for WordPress but not so much Woocommerce. I have been emailing back and forth with the plugin creator but I don’t know if he wants to support custom code (at least without charging). Can anyone take a look at my code and help me out?
Here’s what I’ve done:
- Set up custom attributes called ‘bottles’ on every product. On products with three bottles, the value is 3, and so on.
- Created the custom functions listed in my pastebin.
- Created the custom conditional statement within the Woocommerce Advanced Shipping plugin settings page.
Any help is gratefully appreciated. Thanks all!