Posts

Product Tabs in WooCommerce

Image
In this post I am going to show you how to handle product tabs in WooCommerce. By default WooCommerce have ‘Description’, ‘Reviews’ and ‘Additional Information’ tabs. We will add custom tabs, remove & rename existing one’s and other stuff with WooCommerce product tabs. Add Custom Product Data Tab Use the following code snippet will add a custom product tab. Add Custom Physical Product Data Tab Use the following code snippet will add a custom product tab but it will only be displayed for physical products. Rename Product Data Tab Use the following code snippet will rename a product tab. Reorder Product Data Tab Use the following code snippet will reorder the product tabs. Remove Product Data Tab Use the following code snippet will remove a product tab. Customize Product Description Data Tab Use the following code snippet will customize the product description tab. There are some plugins available that can add product tabs. Before using always check the star rating for that plugin. ...

Best WooCommerce Customization Practices

Image
In this post I am going to share the best WooCommerce customization practices. The greatest benefits of WooCommerce is its flexibility, code and content can be changed to suit the store. There are hundreds of plugins available to add new functionalities. Never edit the core WooCommerce plugin code, when a new plugin update is available. After updating you will lose all the customization done. There are two best WooCommerce customization practices to follow when making site tweaks. Theme Plugin Using a Child Theme If you want to modify the CSS, then the best option is to use a child theme to preserve customizations against future WooCommerce updates. There are two ways with which you can customize. WooCommerce Template in child Theme:- Create “woocommerce” directory within child theme and add same directory structure as in WooCommerce Core. Add template file to it and do required customization. This will override the core template and any modification after plugin update will not effe...

WooCommerce Hooks Actions & Filters

Image
In this post I’m going to show how to use WooCommerce Hooks actions & filters for core plugin customization.  Hooks are of two types Action and Filter. Hooks are snippets of code that can be placed into your WordPress theme’s functions.php file or even added into a custom plugin. Action Hooks Action hooks are triggered when an event takes place, such as a user logged in or a custom action that you define in your theme or plugin.   We can create our own custom action hooks within plugin or theme using do_action() function. The function hooked to that action will run at that point in the code.   Filter Hooks Filter Hooks are used to modify data at runtime. The main difference between Action and Filter hook is, Filter Hook always returns a modified data value while Action Hook just triggers the code at that point in the code.   The apply_filter() functions apply filter to the the existing code. Later we can modify that code via add_filter() function. For WooCommerc...