:::: MENU ::::
Browsing posts in: WooCommerce

WooCommere remove tax for product

Today we talk about WooCommerce remove tax for product. Sometime in the scenario, you have to remove the tax bases on some condition. In the below example, I will explain how can you achieve this functionality.

add_filter( 'woocommerce_product_is_taxable' , 'product_product_custom_tax_status' , 10 , 2);
function product_product_custom_tax_status( $product_status , $product ){
    //return true to enable Tax and false to disable tax
    if( '20' == $product->get_id() ){
        return false;
    }else {
       return true;
Author: Qaisar Satti
Category: WooCommerce
Last Modified: September 30, 2020

WooCommerce apply discount programmatically

Today we talk about how WooCommerce apply discount programmatically. Sometimes you need to add the discount bases on some condition. Follow is the snippets how can you achieve the functionality.

Simple Product

To apply the discount on simple products use the following code.

add_filter( 'woocommerce_product_get_price' , 'products_custom_price' , 5, 2 );
function products_custom_price( $price, $product ){
      $discount = 10;
      $product_id = $product->get_id();
      if( $product_id == '20' ){
          return $price - $discount;

Variable Product

To apply the discount on variable products use the following code.

add_filter( 'woocommerce_product_variation_get_price' , 'variation_custom_price' , 99, 2 );
function variation_custom_price( $price, $variation ){
        //Apply Discount by matching the parent Product
       $product = wc_get_product($variation->get_parent_id());
       if( '20' == $product->get_id() ){
             return $price - $discount;
       //Apply Discount by matching the Product Variation
       if( '20' == $variation->get_id() ){
             return $price - $discount;
Author: Qaisar Satti
Category: WooCommerce
Last Modified: September 29, 2020

WooCommerce remove price html

Today we talk about how WooCommerce remove product price HTML.It will remove the price from all the listing pages, product pages, and all other pages too. So let’s start with our example.

add_filter( 'woocommerce_get_price_html' ,  'remove_woocommerce_price_html' , 10, 2 );
function remove_woocommerce_price_html( $price_html ){
          $price_html = "";
          return $price_html;
Author: Qaisar Satti
Category: WooCommerce
Last Modified: September 29, 2020

WooCommerce remove add to cart

Today we talk about WooCommerce remove to add to cart to different places. Like listing page, product page. So let’s start with an example.

Lisitng Page

You have to remove the following action to do the trick.

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');

Product Page

You have to remove the following action to do the trick.

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');

For the simple product use the following code.

remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );

Remove add to cart for variable products without removing the variation selectors
Note: It will remove only the add to cart button and the Quantity box.

remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 );
Author: Qaisar Satti
Category: WooCommerce
Last Modified: September 29, 2020

Top 10 woocommerce plugins

In this article, I will share Top 10 woocommerce plugins you must have. I have already written an article about woocommerce and also about plugins.You can read that here Must have woocommerce plugins.Also, there are a number of plugins available to enhance your store’s functionalities and performance. We will discuss few hands picked plugins here too.

Having that said, let’s take a look at the best free WooCommerce plugins for WordPress.

1. OptinMonster
OptinMonster is the most powerful conversion optimization software in the market. It helps you convert abandoning website visitors into subscribers and customers.
You can use it on your eCommerce website to reduce cart abandonment, increase sales conversion, grow your email list, show targeted website messages, onsite retargeting, and more.
If you’re serious about growing your email list and boosting sales, then you need this conversion optimization toolkit.

2. YITH WooCommerce Wishlist

YITH WooCommerce Wishlist plugin allows your customers to save products to their wishlist. They can use the wishlist to make the purchase later or share their wishlist with friends and family.

This is a perfect addon for your online store during busy holiday seasons when people are making their shopping lists and purchasing gifts.

3. WooCommerce Multilingual
Non-English WordPress websites surpassed the English WordPress websites in 2014. Since then more WooCommerce stores are created in languages other than English. WooCommerce Multilingual adds compatibility layer with the popular WPML WordPress multilingual plugin.

This allows you to translate your product and other WooCommerce pages in multiple languages. Your customers can choose to browse your website in their preferred language.

4. WooCommerce Products Slider
WooCommerce Products Slider allows you to easily create beautiful product sliders and carousels and add them anywhere on your WooCommerce store.

5. WooCommerce Customizer

WooCommerce Customizer provides an easy user-interface to use built-in WooCommerce filters. These filters allow you to customize things like button text, labels, fields, and much more.

Normally, you would have to write PHP code to use these filters. With WooCommerce customizer, you can easily use those filters from a simple settings page (no coding necessary).

6. WooCommerce EU VAT Compliance

As the name suggests, this simple plugin makes your WooCommerce shop compliant with the new EU VAT. It will automatically detect your customer’s location and will display prices with correct VAT from the first page.

7. Order Delivery Date for WooCommerce

This plugin allows users to choose a delivery date for products during the checkout. WooCommerce store owners can see the desired delivery date on their orders page in the admin area.

8. YITH WooCommerce Quick View

WooCommerce Quick View allows your customers to peek into product details by simply taking their mouse over a button. This enables customers to quickly get the product information without leaving the product listings or shop page.
Users will be able to see a larger product image, product description, and an add to cart button in a lightbox popup.

9. WooCommerce PDF Invoices & Packing Slips
This nifty plugin allows you to send PDF invoices and packing slips to customers via email. Users can also download their invoices and slips from their account area. As a site admin, you can also bulk generate invoices, download them, and email them to users from an admin area.

10. YITH WooCommerce Compare
As the name suggests, this plugin allows your customers to compare two or more WooCommerce products side by side. You can choose which fields users will see in the comparison table and reorder them as needed.

Similarly, there are many other extensions available. I tried to list a few. I hope this tutorial helps you in any way.
Please feel free to drop any suggestions or queries in the comments section. It will be highly appreciated.

Author: Qaisar Satti
Category: WooCommerce
Last Modified: August 1, 2019

Must Have WooCommerce Plugins

This is an introductory article about Must have woocommerce plugins. I have already written an article about woocommerce.If you are not familiar with woocommerce, you can read the article here Woocommerce introduction. So if you are a product-based business and want to sell your products online domestically or internationally, then woo-commerce online store could be your optimum choice. Because of its high flexibility and efficiency. Also, there are a number of plugins available to enhance your store’s functionalities and performance. We will discuss a few amazing plugins here.

In this article, I will discuss the free available woo-commerce extensions and plugins. Which can help you enhance your woo-commerce store’s functionality? Let’s start with listing the names.

  • Metrilo WooCommerce Analytics
  • YITH WooCommerce Zoom Magnifier
  • YITH WooCommerce Ajax Product Filter
  • WooCommerce Multilingual – run WooCommerce with WPML
  • Beeketing for WooCommerce
  • WooCommerce Checkout Manager
  • Stripe Payment Gateway
  • WooCommerce Menu Cart
  • Woocommerce CSV Importer
  • Genesis Connect for WooCommerce

Let’s have a brief look at the descriptions of these plugins.

1. Metrilo WooCommerce Analytics, CRM, and Email Automation

It’s true you have some data about your customers and orders in the WP admin panel, but it’s not enough to run your whole marketing on it. A plugin like Metrilo can help you monitor your store’s performance and optimize your marketing spend.
How Metrilo helps your marketing:

  • Tracks all important ecommerce KPIs and people’s actions on site
  • Displays sales, traffic, campaign, product and other reports in an understandable way
  • Easily compares ROI of marketing channels
  • Retention analysis shows you the journey of your customers so you can win their loyalty
  • Customer profiles allow segmentation and personalized marketing
  • Emails are always timely and relevant to email automation
  • Product correlations help create the perfect bundles and promotions

2. YITH WooCommerce Zoom Magnifier

Although many plugins enable the zoom feature on your WooCommerce store, I prefer YITH WooCommerce Zoom Magnifier Plugin, because of its easy customization options. it can be easily customized. Here is comprehensive coverage of the zoom feature.

Several important features of YITH WooCommerce Zoom Magnifier are:

  • Mouse over will show a bigger size product image.
  • Zoom area can be customized
  • You can easily enable/ disable zoom on the mobile devices
  • Add a slider of product image thumbnails
  • You can also customize the slider behavior

3.YITH WooCommerce Ajax Product Filter

WooCommerce product filter and widget apply the visitors to apply various filters. The users could use any combination of admin-defined criteria for product filters.

WooCommerce Multilingual – run WooCommerce with WPML

Do you want to translate your WooCommerce store into multiple languages? Using this plugin, you can translate everything from WooCommerce offers, products, variations, categories, fields, and attributes.

5. Beeketing for WooCommerce:

Upsell & Cross-sell, Email Marketing, Discount & Free Gifts Promotions, Countdown
Beeketing for WooCommerce plugin brings many marketing and sales solutions into one package, making a complete Marketing Automation suite for WooCommerce business owners. It is built by Beeketing – a Marketing Automation platform specifically for eCommerce websites.

Within the plugin, you will see a list of different apps, each has a distinctive set of features that focus on lifting up conversion rates at different stages in the sales funnel.

Here are what you can do with Beeketing for WooCommerce:

  • Curate stylish email coupon popups to convert visitors into email subscribers or social followers
    Run exit-intent popups to prevent site/cart abandonment
  • Upsell & Cross-sell relevant products based on customer’s cart, bundle products in combo and sell at a total discount price
  • Last-step Upsell at cart page or Post-purchase Upsell after customers complete order
  • Quick View popups that also recommend related items
  • Generate personalized product recommendation sliders: Best Sellers Of Store, Recently Viewed, Who Bought This Also Bought, Hand-picked Products Just For You, Cart Recommendations
  • Display free gift/discount code / free shipping promotions to customers who are about to check out and encourage them to share your products on Facebook/Twitter to receive the offer
  • Create countdown timer offer to create the sense of urgency for your offer
  • Sales and Stock Countdown widgets to promote the promotion and popularity of your products
  • Notify customers of recent orders by displaying live sales notifications to create brand trust and motivate visitors to add items to cart
  • Social proof widgets that show how many people have viewed, added to cart, and purchased a specific product
  • Automated email marketing: a much more affordable MailChimp alternative that helps you create a full personalized follow-up email and newsletters triggered by customers’ behavior and interests
  • Facebook live chat widget on the store so customers can contact and chat directly with you via Messenger
  • Tools to optimize the mobile web conversion such as fixed CTA bar on top or bottom of the mobile screen, and gallery full-screen view of product images

More features added on a regular quarterly basis.
6. WooCommerce Checkout Manager

Using WooCommerce Checkout Manager you can easily customize and manage the fields on the WooCommerce checkout page.

This plugin allows you to:

  • Easily add and reorder new fields on the checkout page
  • Make checkout fields optional
  • Add and remove required fields
  • Hide or show fields for specific user roles
  • Upload files to the checkout page
  • Export orders by field name
  • Create Conditional Fields

7. Stripe Payment Gateway

In the beginning, WooCommerce only supported PayPal Standard. However, today, the official WooCommerce Stripe Payment Gateway is available, completely free of charge.

Previously, you had to download and install this extension like any other WordPress plugin. However, now you can install Stripe gateway during the WooCommerce setup.

8. WooCommerce Menu Cart

WooCommerce Menu Cart adds a shopping cart button in the navigation bar of the store. The feature set of WooCommerce Menu Cart includes:
Selective visibility of the shopping cart icon, depending on the price, items and/or the content of the shopping cart
Floating position
Custom CSS

9. Woocommerce CSV Importer

This plugin allows you to import data from your WooCommerce store in CSV format. Using this plugin, you could import attributes, variable products, premium, taxonomies and custom fields.

10. Genesis Connect for WooCommerce
Genesis Connect for WooCommerce preserves customizations so that no issues arise when the module is updated. In addition, you can put copies of the templates in child theme’s WooCommerce folder and customize these copies as per your requirements.

Similarly, there are many other extensions available. I tried to list a few. I hope this tutorial helps you in any way.

Please feel free to drop any suggestions or queries in the comments section. It will be highly appreciated.

Author: Qaisar Satti
Category: WooCommerce
Last Modified: August 1, 2019

Create WooCommerce custom plugin

I have thought to put together a mini series covering the basics and day to day task solving tips and tricks of WooCommerce.For now, this first article will cover the basics of creating a custom plugin for your WooCommerce site or how to create a plugin in woocommerce, and provide you with a plugin skeleton to download and use as a starting point. I assume you are familiar with basic WordPress plugin development, and you are moving forward to learn Woocommerce plugins. So, let’s get going!

WooCommerce is a fabulous ecommerce solution, but creating a website or shop is a very personal endeavor, and you are likely to want to change some functionality or behavior of the stock WooCommerce plugin. We often look for simple solutions, and therefore we can be drawn to editing the core files.Honestly, we should avoid this urge. Fortunately, though not as flexible as Magento, WooCommerce provides a lot of action hooks, filters, template files and “template functions” to allow for customizations. Writing a plugin allows us to cleanly separate and keep track of our custom code, and renders WooCommerce upgrades a relatively painless process.

What is an action?

An action in WordPress allows you to execute code triggered at a specific point in the page response process, for instance upon displaying a comment.

What is a filter?

Similar conceptually to an action, filters allow you to modify data at specific points in the WordPress page response process, for instance removing profanity from a comment.

What is a template?

A template is a file that contains a mix of HTML and PHP code and renders a page, a part of a page, or an email. Templates can be overridden by creating a file of the same name in a special location within your theme or child theme.

What is a template function?

A “template function” is a function that begins with if ( ! function_exists( ‘function_name’ ) {… If your plugin defines this function first it will be called in place of the default function and allow you to override its behavior with your own.

Writing a custom plugin largely allows you to alter the functionality and behavior of WooCommerce; to customize the look and feel the preferred method is to create a custom child theme.

The Plugin Skeleton

Name your WooCommerce custom plugin as you will, i am naming it as woocommerce-company-name. Although not strictly necessary with a self-authored plugin, it’s good practice to check if WooCommerce is active, and also perform a check to ensure a class with the same name as your plugin doesn’t already exist:

if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
  if ( ! class_exists( 'WC_Helloworld' ) ) {

Next, it’s again good practice though not necessary, to load any translated strings for the plugin. Doing so allows you to use the various translate functions such as __( ‘Some text’, ‘wc_helloworld’ ) and easily provide translation files at some future date.

   load_plugin_textdomain( 'wc_helloworld', false, dirname( plugin_basename( __FILE__ ) ) . '/' );

I prefer to define the bulk of my plugin functions within a class, which effectively scopes the functions you write and keeps you from having to worry about function name clashes with all the other WordPress core and plugin functions. There are a few commonly used lifecycle action hooks which will be included in our skeleton plugin class. Finally, the plugin class will be instantiated, assuming that WooCommerce is active, and the class name isn’t already taken.

class WC_Helloworld {

      public function __construct() {
        // called just before the woocommerce template functions are included
        add_action( 'init', array( $this, 'include_template_functions' ), 20 );

        // called only after woocommerce has finished loading
        add_action( 'woocommerce_init', array( $this, 'woocommerce_loaded' ) );

        // called after all plugins have loaded
        add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );

        // indicates we are running the admin
        if ( is_admin() ) {
          // ...

        // indicates we are being served over ssl
        if ( is_ssl() ) {
          // ...

        // take care of anything else that needs to be done immediately upon plugin instantiation, here in the constructor

       * Override any of the template functions from woocommerce/woocommerce-template.php
       * with our own template functions file

      public function include_template_functions() {
        include( 'woocommerce-template.php' );

       * Take care of anything that needs woocommerce to be loaded.
       * For instance, if you need access to the $woocommerce global

      public function woocommerce_loaded() {
        // ...

       * Take care of anything that needs all plugins to be loaded

      public function plugins_loaded() {
        // ...

    // finally instantiate our plugin class and add it to the set of globals

    $GLOBALS['wc_helloworld'] = new WC_Helloworld();

Furthermore, if you were already familiar with WordPress/WooCommerce development there probably wasn’t much new for you here, but hopefully, if you’re new to the game then the above explanations and techniques will prove helpful in getting you started. Either way, the best way to learn the multitude of WooCommerce actions and filters available for customization is to browse the source code. Also remember that in addition to hooking into actions/filters and adding functionality, you can just as easily unhook existing actions/filters to remove plugin behavior, or change it wholesale. The trick is to perform the remove_action()/remove_filter() calls after the target action is hooked to (for instance within our woocommerce_loaded() function above), and to always remember to provide all the arguments to the remove functions that were passed in the add functions, optional parameters and all.

That’s it from this article. I strongly believe there is always room for improvement. So I am open to any suggestion and feedback. Please feel free to leave what you are thinking in the comments section below. Cheers.

Author: Qaisar Satti
Category: WooCommerce
Last Modified: August 1, 2019