[Developer] - Adding a Custom Condition
This documentation is for the WooCommerce Advanced Shipping plugin.
By default WooCommerce Advanced Shipping will fit many needs. With its conditional logic a countless amount of combinations of shipping rates can be setup. There are however still cases where those default conditions will not fit all needs. WooCommerce Advanced Shipping has been created to be easily extendable and thus conditions can be added easily. There are already a couple more-used scripts available so you can always get in touch via http://jeroensormani.com/woocommerce-advanced-shipping/support/ to check if your needed script is available.
Adding a custom condition
Adding a new custom conditions consists out of 3 required functions, and 1 optional.
1) Adding the condition
The first thing you need to do is add a new condition in the drop down list. In the code snippet below we're adding a 'Date' condition to the drop down.
2) Adding the value field
There are two possible value fields, 1) a regular text field, 2) a drop down field. In the code snippet below a regular text field is used, but a example for a drop down is also included in a commented out section.
3) Adding the matching condition
In this step we're adding the functionality to see if the customer matches the variable the store owner has setup. In the code snippet below you can see the matching functions in action. This particular function can be compared to all operators (some condition only require the 'equal to' and 'not equal to' operators).
4) Adding the condition description (optional)
Via the code snippet below you can add a description that will show up when someone hovers over the question mark on the right side of the condition. When not used the question mark will not show up.
Custom condition done for you
It could be that you cannot figure things out or that you're simply not a developer. If you want me to custom code your custom condition you can hire me. For a normal (meaning no hugely weird/complicated stuff) custom condition I charge €150,-. If you're interested, you can reach out to me via the following contact form http://jeroensormani.com/woocommerce-advanced-shipping/support/, please mention that you're interested in a custom condition.