Here at VIA, we have many clients that use WooCommerce, which is also our preferred eCommerce solution. Over the years, we’ve found a few helpful tips and tricks that make developing for WooCommerce a little bit easier.
Use Hooks over Template Overrides
By using hooks (actions/filters) you can keep your code changes more streamlined and relatively maintenance-free (when compared to using a template override for one small change). In our process, anytime you use a template override, you have to justify doing that over using a hook.
For example, with the Corona virus causing disruptions, you may want to display a notice on how it will affect shipping above the shipping methods section in the checkout. So instead of making a template and manually adding a paragraph tag above that section, you can use the woocommerce_review_order_before_shipping hook.
A full list of hooks can be found here.
If you do have to use a template override, make sure you make a note in the file what you are adding or removing to it. This will come in handy down the road when you are updating WooCommerce and you have to update template files – if you don’t document the template override changes, it’s way harder to apply the new changes without overriding your changes and spending time comparing the two.
If you don’t have to, don’t use a plugin. While they are super handy and save on development time, if it’s something on the simple side, go ahead and roll your own unless the plugin you are considering is high quality (trusted source, good ratings, up to date).
Recently I reviewed a site that was held together by 44 plugins, the majority being different WooCommerce related plugins and needless to say there were many conflicts and the overall performance was bad. This was a case where 75% of the plugins could have been rolled by the developer at a low cost for better performance and higher quality.