Posts

Add Custom Admin Product Search Field in WooCommerce

Image
In this post I’m going to show you how to add custom admin product search field in WooCommerce. This post is based on our Custom WooCommerce Plugin Development tutorial. If you are not novice and are an experienced WooCommerce developer no need to go through manufacturer plugin post. Or you can just download the plugin and install it to work with below code. Download Link: WooCommerce Manufacturer Plugin Admin Products Listing Page The image shows the search field added on the WooCommerce products listing page. This field will search the products related to chosen manufacturer. The code below will add a dropdown that will populate the Titles from Manufacturer Custom Post Type. The Action Hook restrict_manage_posts will add the search dropdown. The Filter Hook parse_query will attach our search field submitted data to the database query. Use the following code to child theme functions.php file or you can create it as WordPress plugin to add custom admin product search field in WooCo...

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...