Posts

7 Things You Should Never Do With Your WooCommerce Store

Image
If you are a WooCommerce Developer then you must have to agree with me about these “7 things you should never do with your WooCommerce store” . A store that loads slow, definitely loses prospective customers.   I have seen people with passion of starting online store fail due to insufficient information about the current trends. In recent years the web has been totally changed, it was a different thing 5 years ago. Now to stay within the competition, you have to know everything to be successful. Below are the list of 7 things you should never do with your WooCommerce store, I’ll go briefly on each of them. Never customize core WooCommerce plugin files Never use heavy theme Never use extra plugins Never use slow hosting Never use heavy product images Never customize theme core files Never hire cheap unskilled WooCommerce developer 1. Never customize core WooCommerce plugin files WooCommerce is a flexible eCommerce system. But to customize its core files you need good understanding o...

WooCommerce Checkout Page Fields

Image
In this post I’ll show you how to handle WooCommerce checkout page fields customization. The Checkout page is an eCommerce term that refers to pages shown to a customer during the step-by-step checkout process. WooCommerce Checkout Customization – Shipping or Billing Form Fields The shipping address is where you want products to be shipped, while the billing address is where you live or Where your bills are to be delivered. The eCommerce shipping is a service through which seller ships their products to buyers. A shipping form collects the shipping details of a customer. It must contain all required shipping fields.   Add WooCommerce Custom Shipping Field WooCommerce is a very flexible eCommerce system. We can easily customize the checkout page, it provides all the necessary hooks. Below are the three steps to add a custom field to WooCommerce checkout shipping form. Add the required field array() data and hook it to woocommerce_checkout_fields Field validation to check it must c...

Update WooCommerce Checkout Total with Postcode Field

Image
Sometime you want to update the checkout total based on a specific field. e.g how to update WooCommerce checkout total with postcode field. Enter the value in billing_postcode field and as you blur. The jQuery( ‘body’ ).trigger( ‘update_checkout’ ); will be triggered and the checkout total will be updated. Use the following code snippet within theme functions.php   Custom WooCommerce Plugin Development   Flatsome Theme Customization   WooCommerce Checkout Page Fields   Checkout Field Editor  

Send Additional WooCommerce Email

Image
Sometime you want to send additional WooCommerce email to certain address or to third party. To send such emails is not quite hard, if you know the right hooks. We need to hook our function when action is triggered and order is set to cancelled. We use hook woocommerce_order_status_processing_to_cancelled_notification It is triggered when order status changed from processing to cancelled. The hook accepts 1 parameter which is the $order_id. You can use this hook when orders are cancelled in case of some issues occurs e.g Payment Failed. The WooCommerce mailer class is loaded e.g WC()->mailer(); It has following parameters. $recipient: Email address of the person to notify. $subject: Subject of your email. $content: Content of Email. The ci_get_cancelled_notification_content() functions fetches our email contents. $headers: Tells mailer its HTML email. The wc_get_template_html() is a WooCommerce function that loads email template with contents passed in array. Add the following cod...

Display WooCommerce Discount to Customer

Image
In this post I am going to show you how to display WooCommerce discount to customer for product on sale. Sometime when a product is on sale, you want to show total discount to customer on Cart & Checkout pages. Product Price or Regular Price or Retail Price all are the actual price of the product. The Sale price is a temporary price when a specific product is on sale. The below image “You Saved” section displays the total discount amount. WooCommerce get_cart() function holds all the data of products added to cart. Call get_cart() function and loop through it to get individual product details. The get_sale_price() function fetches product sale price and get_regular_price() fetches product actual price. Add the below code to child theme functions.php file, it displays discount on cart and checkout pages for product on sale.   Flatsome Theme Customization   Custom WooCommerce Plugin Development   WooCommerce Hooks Actions & Filters   Discount Rules for WooComm...

WooCommerce Auto Update Cart When Quantity Changes

Image
Do you want WooCommerce auto update cart when quantity changes. Yes, with a simple php function with two lines of JQuery and the result is great! When you change the product quantity this JQuery code will update your cart data jQuery(“[name=’update_cart’]”).trigger(“click”); Use one of two code snippet within theme functions.php   Custom WooCommerce Plugin Development   7 Things You Should Never Do With Your WooCommerce Store   Flatsome Theme Customization   WooHero WooCommerce Store Customizer  

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