Skip to content
Pramod Jodhani
  • Menu Item
  • Menu Item
  • Menu Item
  • About
  • Contact
Night Mode
Text Size

WordPress and WooCommerce expert

Uncategorized

How to use % character within sprintf in PHP

Posted on Updated November 23, 2023November 23, 2023 by Pramod Jodhani

When using the sprintf function in PHP to concatenate strings or variables, you may encounter an error when trying to include a % character in the string itself. This can be problematic if you want to display a percentage or use the % character for formatting purposes. For example, let’s say you have the following […]

How to Disable Dark Mode for Chrome and Any App on macOS

Posted on Updated November 9, 2023November 9, 2023 by Pramod Jodhani

Dark mode has gained popularity among macOS users for its sleek and visually appealing interface. However, there might be instances where you prefer to disable dark mode for specific applications like Chrome or other apps on your Mac. In this guide, I will walk you through the steps to disable dark mode for Chrome and […]

How to send custom emails using the WooCommerce template

Posted on Updated May 30, 2023May 30, 2023 by Pramod Jodhani

I used to believe that if you have to send custom emails within WooCommerce, then the only way possible is by creating a custom Email which extends WC_Email class. That process is tedious and honestly very few would need that. I recently stumbled upon a code within WooCommerce which uses the WC()->mailer->wrap_message() function to send […]

Function to Check if given Array of Product IDs are present in the Cart

Posted on Updated October 20, 2023May 25, 2023 by Pramod Jodhani

In this blog post, we will discuss a useful function that allows you to check whether a given array of product IDs is present in the WooCommerce cart. This function can come in handy when you need to perform specific actions based on the presence of certain products in the customer’s cart. I will provide […]

WooCommerce Tips: Conditionally Hiding Order Notes for Virtual Products

Posted on Updated February 17, 2023February 17, 2023 by Pramod Jodhani

Order notes are a convenient feature in WooCommerce that allows customers to add additional comments or instructions for the order during the checkout process. However, in some cases, you may want to hide this field when all products in the cart are virtual products, as they may not require any additional information. You can use […]

WooCommerce – How to maintain the state of “Ship to a different address” Checkbox

Posted on Updated February 17, 2023September 22, 2022 by Pramod Jodhani

On WooCommerce checkout page if you tick the “Ship to a different address” checkbox, then redirect to some other page maybe to add some more products to the cart, and then come back again to the checkout page, you would notice that “Ship to a different address” checkbox resets to its default state. You can […]

WooCommerce – How to offer a free product with the purchase of certain products

Posted on Updated February 17, 2023August 2, 2020 by Pramod Jodhani

Let’s say you running an offer where you want to give away a free product when a certain product or set of products is added to the cart. Given how flexible and customizable WooCommerce is, everything is possible. Let’s see how we can accomplish this task. You need to add this code to the functions.php […]

WooCommerce – How to calculate sum of all the sales ever done on the store?

Posted on Updated February 17, 2023June 7, 2020 by Pramod Jodhani

How to set minimum and maximum purchasable quantity for a WooCommerce product without any plugin.

Posted on Updated February 17, 2023June 7, 2020 by Pramod Jodhani

One of the best things about WooCommerce which makes it so widely adapted e-commerce platform is it’s customizability. With this little peice of code we can limit the minumun purchasable quantity for all products in the site If you want to add this restriction for only a certain product then you only need to make […]

Basic Rate-limiting in WooCommerce with native class

Posted on Updated February 17, 2023June 4, 2020 by Pramod Jodhani

WC_Rate_Limiter is a great little utility class in WooCommerce codebase which is not very popular but could be very helpful at times. I accidentally stumbled upon it while reading the source code of WooCommerce and thought of sharing it on my blog. You would want to use rate-limiting to prevent user from performing an action […]

Posts navigation

Page 1 Page 2 Next page
© 2023 Pramod Jodhani