WooCommerce: Set Product Price Based On Other Products!

I’m Italian and I love exclamation marks! I also love WooCommerce customization, as you may know. This time I want to show you how I programmatically define the price of my WooCommerce Mini-Plugin All-Access-Bundle product… based on other products.

The backstory: as of today, I sell 18 WooCommerce plugins, and soon I should reach the 400 mark if all goes well. So, I came up with the idea of creating a bundle, and let customers gain access to all of them within a single, discounted purchase.

Yes, I could have purchased a Product Bundle plugin… but I wanted to see if I could create a bundle out of a Simple product.

The only requirements were: set the regular price based on the total price of the plugins, set its sale price based on a percentage discount, automate this so I don’t need to manually update the bundle price every time I add a new product, and add all plugin products to the order upon bundle purchase (we will see this in another snippet). Enjoy!

Continue reading WooCommerce: Set Product Price Based On Other Products!

WooCommerce: Allow Customers To Define the Product Price

This is a great customization for those WooCommerce store owners who are willing to accept donations, custom amounts, or need anyway that the customer enters a custom price on the product page for paying an invoice or a bill.

This is as simple as creating a simple product with $0 price, and after that using the snippet below to display an input field on the single product page, where customers can enter their custom amount. Enjoy!

Continue reading WooCommerce: Allow Customers To Define the Product Price

WooCommerce: Replace Variable Price With Active Variation Price

Surprisingly enough, variable products with a price range display two prices: at the top right you find the “parent” product price, displayed as a range; but once you select a variation, a second price appear just above the variation add to cart. Somewhat confusing.

In today’s solution, we’ll see once and for all how to replace the top right variable product price with the one of the current variation, while also hiding the variation price. Therefore, you’ll see a single price on the single product page for variable products. Enjoy!

Continue reading WooCommerce: Replace Variable Price With Active Variation Price

WooCommerce: Display Prices Inc + Ex Tax

The WooCommerce settings allow you to show prices including OR excluding tax. But what if we want to show both at the same time e.g. “$100 inc. tax – $89 ex. tax”?

Well, by combining the snippet below with the snippet I already coded for variable products price range, or by installing our Mini/Plugin, you can achieve exactly that.

Yes, in theory you could add a WooCommerce suffix via the settings, but unfortunately WooCommerce wraps such suffix in a “small” HTML tag and therefore the whole content is smaller in size, including the second price.

In this tutorial, we’ll see how to add a suffix via PHP instead, and specifically at how to add the price including tax if your store displays prices excluding tax. Enjoy!

Continue reading WooCommerce: Display Prices Inc + Ex Tax

WooCommerce: How to Sell Craft Beer Online

If you sell craft beer, one of the things you can do to increase your sales is setting up an online store where you can sell your beers. Through an online store, you can easily meet the demands of your customers and even deliver the beer to their doorsteps.

When the COVID-19 pandemic struck, many businesses including craft beer businesses could not meet their targets with regards to sales. Their selling activities were affected because they could not deliver beers to restaurants and pubs (they closed down), could not sell to their customers directly, and most shops and stores were closed down.

Selling online and making sure that customers get their beers was the only way left for them. Even though the world has opened up, online shops have picked up and every business needs them for success. So, how do you get started?

Continue reading WooCommerce: How to Sell Craft Beer Online

WooCommerce: Hide Price If Product Out of Stock @ Frontend

Sometimes, the nature of ecommerce businesses requires some extra features. Thankfully, WooCommerce allows to customize pretty much everything based on whatever condition.

Today, we’ll see how to hide prices for out of stock items, on the shop, categories, archives, loops and single product page.

Think of an art gallery which sells unique art pieces, and doesn’t want to let users know for what price sold an item. Or maybe an online business that often runs discounts – why reveal at which price sold an item that is now out of stock? Of course, there are way more case scenarios – I’d be curious if you shared yours in the comment area.

But for now, copy and paste the snippet and that’s it, you’re good to go. Enjoy!

Continue reading WooCommerce: Hide Price If Product Out of Stock @ Frontend

WooCommerce: Product Category Price Range

WooCommerce variable products display a price range by default, which goes something like this: $MIN-$MAX. Now, wouldn’t it be nice, on the Shop page or Category Widget, to show the price range for each category?

Well, as usual this is a customization that can apply to certain online businesses only, so hopefully you’re one of them. Either way, this is yet another chance for you to learn PHP applied to WooCommerce. Enjoy!

Continue reading WooCommerce: Product Category Price Range

WooCommerce: Hide Product Price & Stock From Google

The WooCommerce Plugin is also developed with SEO in mind and provides your website with the schema markup for products (as well as other microdata useful for search engines).

This means by default your products are going to show on Google together with other data such as review stars, stock status, number of reviews and – you saw that coming – the product price.

In certain case scenario, however, you may want to hide WooCommerce product prices from Google search results (and all the other search engines of course). For example, because your prices are only visible to logged in users; or maybe because you don’t want to display your prices until potential customers go to your website and read all the product benefits as opposed to having them make a price-only decision.

Either way, let’s see how it’s done. And once again, it’s one line of code. Enjoy!

Continue reading WooCommerce: Hide Product Price & Stock From Google

WooCommerce Wholesale Prices: Plugins, Setup, Tips and Snippets

If you’re setting up a wholesale store for your business or for your clients, WooCommerce is a great choice! It’s free, open-source, powerful, and growing in popularity.

However, many important wholesale functions are missing, and that’s particularly important when it comes to wholesale pricing. Let’s explore how we can set up complex pricing in WooCommerce, and in detail:

  • Setting up different prices for different users
  • Tiered pricing and pricing table
  • Bulk pricing and discounts
  • Discounts by quantity or order value

Each functionality can be added via a free or premium plugin or, if you’re familiar with PHP, even by code. Either way, this article will feature one of the many options available.

Continue reading WooCommerce Wholesale Prices: Plugins, Setup, Tips and Snippets

WooCommerce: How to Create Custom Logs

Logs or log files are a must for WooCommerce developers and store managers. Log files are basically an automatically generated collection of events that happen on a given store, based on certain logging criteria. For example, WooCommerce already creates a “fatal error” log for you, that you can easily access and read within the WordPress dashboard (WooCommerce > Status > Logs).

If you’re familiar with WordPress troubleshooting, you will know how important the debug.log file is while trying to identify website weaknesses, PHP errors or white screen of death. Well, today I’m going to teach you how to create your own log, so that you can record whatever event happens on your WooCommerce website and easily check the logs for troubleshooting purposes.

Specifically, I’ll show you how to create a log every time there is a customer failed order and every time there is a product price change made by the admin. Easy peasy – enjoy!

Continue reading WooCommerce: How to Create Custom Logs

WooCommerce B2B: How to Set Up a Wholesale Store

The ecommerce sector is seeing incredible growth, year after year, with no foreseeable end in sight. The same is true for B2B ecommerce, yet there aren’t many good platform choices available for small-to-medium businesses that want to sell wholesale. There are several SaaS solutions on the market, but these are costly, closed-source, and mostly oriented towards larger businesses.

If you are a business owner or developer, WooCommerce is a solution that’s free, versatile and powerful. 

Continue reading WooCommerce B2B: How to Set Up a Wholesale Store

WooCommerce: Calculate Subtotal On Quantity Increment @ Single Product

From a UX point of view, ecommerce customers may enjoy a little improvement on the WooCommerce single product page. As soon as they increase the add to cart quantity, it’d be nice if product price could be recalculated or maybe if a “TOTAL” line could appear so that users always know how much they are about to add to cart.

Honestly, this is hard to explain it this way, so the best is if you look at the screenshot. Enjoy!

Continue reading WooCommerce: Calculate Subtotal On Quantity Increment @ Single Product

WooCommerce: Set / Override Product Price Programmatically

There are times when the edit product page settings are not enough. Yes, you usually set regular and sale price via the price fields under “Product Data”; however sometimes you may have to override those prices via code, because you’re running a special promotion, you don’t want to manually change thousands of prices or maybe you need to show different values to logged in customers only.

Either way, “setting” the product price programmatically consists of two distinct operations. First, you need to change the “display” of the product price on single and loop pages; second, you actually need to set a “cart item” price, because the previous code does not really alter price values.

As usual, easier coded than said, so let’s see how it’s done. Enjoy!

Continue reading WooCommerce: Set / Override Product Price Programmatically

WooCommerce: How to Calculate Product Prices with Custom Formulas

WooCommerce is a powerful and feature-rich WordPress plugin. But despite the fact it’s got many features, there is always something missing for custom ecommerce businesses.

The problem with “all-you-can-do plugins” is the same as “all-in-one WordPress themes“: the more custom functionalities a piece of software has, the worse its performance gets.

Therefore, there is no need to pack every imaginable functionality into WooCommerce as it is easily expandable with other plugins.

For example, one particular feature is not available in WooCommerce out of the box: the possibility to use math formulas to calculate product prices.

This functionality is crucial for specific industries such as digital printing, custom-sized furniture, curtains, tiles, rollers and so on.

Curious to know how this can be implemented?

Continue reading WooCommerce: How to Calculate Product Prices with Custom Formulas

WooCommerce: Set Min Purchase Amount for Specific Product

We already studied how to set min/max WooCommerce add to cart quantity programmatically. That was an easy one. This time, I want to expand on the topic, and define a “minimum order amount on a per-product basis”.

Which, translated in plain English, would be something along the lines of “set the minimum purchase amount for product XYZ to $50”. And once we do that, I expect that the add to cart quantity does non start from 1 – instead it defaults to “$50 divided by product price”. If product price is $10, I would want to set the minimum add to cart quantity to “5” on the single product and cart pages.

Makes sense? Great – here’s how it’s done.

Continue reading WooCommerce: Set Min Purchase Amount for Specific Product

WooCommerce: Bulk Dynamic Pricing (Without Plugins)

In today’s competitive retail landscape, offering the right price at the right time is crucial for driving sales and maximizing profits. But what if your pricing strategy could adapt automatically, rewarding customers who buy in bulk?

Enter bulk dynamic pricing, a powerful tool that allows you to create tiered discounts based on quantity.

We’re here looking to assign different product prices based on the quantity added to Cart, for example from quantity 1-100 price is $5, from 101-1000 price is $4.90 and from 1001 the price becomes $4.75.

This blog post will be your one-stop guide to setting up bulk dynamic pricing for your WooCommerce store – enjoy!

Continue reading WooCommerce: Bulk Dynamic Pricing (Without Plugins)

WooCommerce: Always Show Single Variation Price @ Single Product

When a variable product has the same price for all variations, a unique price is shown to website users i.e. the one at the top of the page. However, this behaves differently when each variation has its own unique price – in this case the single variation price shows after a variation is selected.

Now, this can be good or this can be bad – it depends. So in this snippet we’ll see a quick fix to make this behavior consistent i.e. showing the variation price after selection every time, no matter the conditions.

Thankfully, it’s literally one line of PHP. Enjoy!

Continue reading WooCommerce: Always Show Single Variation Price @ Single Product

WooCommerce: How to Enable Catalog Mode?

One of the most common WooCommerce questions is: can I use WooCommerce to build a catalog of products (without add to cart, price… basically a product gallery)? Using WooCommerce for this case scenario is indeed very helpful – you can make the most of all the inbuilt features such as single product gallery and carousel, image zoom, product description tabs, attributes, categories, tags and related products. Basically a much better version than a standard image gallery.

Another question might be: can I disable the WooCommerce add to cart / cart / checkout functionality until the time I am able to sell my products? This is another common scenario that many WooCommerce store owners require.

Besides, certain products in your WooCommerce website might be for sale and others might not. In this case, you’d want to disable the add to cart functionality from specific categories or products.

Finally, you might want to restrict the cart / checkout functions to logged in, registered users only. This is if you run a wholesale business for example, and wish to hide your prices to the public.

Either way, when the “Add to Cart” button gets hidden, a contact form might be required – this is what I call a “Product Inquiry” form.

Good news is there are snippets and plugins that can make your life easier, your admin time more efficient and your product management simpler. And today we’re taking a look at the best options.

Continue reading WooCommerce: How to Enable Catalog Mode?

WooCommerce: Display Prices as “Was $$$ – Now $$$ – Save $$$”

Many retailers use this price tag strategy quite successfully. And displaying the amount of savings can increase your ecommerce store conversion rate as well 🙂

So, turning simple product default pricing from “$30 $20″ to “Was $30 – Now $20 – Save $10” is quite easy. With a little CSS you can also style the display and customize it according to your brand guidelines! Continue reading WooCommerce: Display Prices as “Was $$$ – Now $$$ – Save $$$”

WooCommerce: How to Edit Product Prices in Bulk?

I’m pretty sure that during one of those Black Friday sales all you wanted to do was to apply a bulk discount to your WooCommerce products without having to generate a coupon code.

Let’s not forget that despite coupons are trackable and you can assess your marketing efforts with their usage statistics, requiring the user to take one additional step at checkout (entering the correct coupon code) reduces your sales conversion rate (the same applies with useless checkout fields by the way – less work to do, higher conversion rate).

In today’s post, we’ll see what are the 3 options I recommend in order to apply bulk store discounts. It pretty much depends on your product types (simple vs variable for example) and whether you want to do this via the settings or with a little bit of PHP.

Continue reading WooCommerce: How to Edit Product Prices in Bulk?