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

WordPress and WooCommerce expert

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 […]

WooCommerce is_catalog() function

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

WooCommerce has some great conditional tags. But sometimes, you might need to run your code on all the catalog pages. Catalog page is basically any page where WooCommerce shows products in a loop. These could be : There is no such function in WooCommerce but we can easily create on like this: When to call […]

How does URL rewriting work internally in WordPress?

Posted on Updated January 12, 2020May 5, 2019 by Pramod Jodhani

I personally feel understanding how WordPress handles permalinks and how the URLs are translated to show the correct templates and posts explains a great deal about how WordPress works. When I initially started learning WordPress development, I had experience in building PHP applications, still, I got very confused learning WP because of the abstraction involved. […]

How to pass a JSON string in Command line with PHP

Posted on Updated April 23, 2019April 23, 2019 by Pramod Jodhani

If you try to pass a JSON string as a command line argument in the Terminal like this: It is expected to that $argv[1] will contain the JSON string. But unfortunately, it gets chunked. This is what you get when you do a print_r : This is not desired. We want the whole JSON string […]

How to build a Gutenberg Block with HTM

Posted on Updated February 22, 2019February 1, 2019 by Pramod Jodhani

I love HTM for it’s simplicity. HTM allows you to write JSX like syntax but without Webpack, and other complexities. The great thing about HTM is that it’s just 700 bytes. That’s right. When you setup a Webpack environment it’s very easy to reach 200MB+. Webpack might be good for complex applications but I wouldn’t […]

Posts navigation

Page 1 Page 2 Next page
© 2023 Pramod Jodhani