If you’re running a WooCommerce store, you’ve probably noticed that some products have a “variation” price. This is a price that’s different from the regular price of the product, and it’s usually used to indicate that the product is on sale.
So, how do you get variation prices in WooCommerce? It’s actually pretty simple:
PRO TIP: If you are using a WooCommerce theme that does not include variation pricing by default, you will need to add the following code to your theme’s functions.php file:
add_filter( ‘woocommerce_variation_prices_price’, ‘woocommerce_variation_prices_price’, 10, 2 );
function woocommerce_variation_prices_price( $price, $product ) {
// Get the product’s price
$product_price = get_post_meta( $product->id, ‘_price’, true );
// Get the product’s sale price
$product_sale_price = get_post_meta( $product->id, ‘_sale_price’, true );
// If sale price exists, use it instead of the product’s price
if ( ! empty( $product->sale_price ) ) {
$sale = true; // We’ll use this later on to style the price differently if on sale
$price = $product->sale_price; // Price with correct formatting
} else { // Otherwise just use the product’s regular price with correct formatting. Sale tag will be removed if on sale.
- First, go to the WooCommerce tab in your WordPress dashboard and click on Products. This will take you to the Products page, where you can see all of the products in your store.
- Next, find the product that you want to add a variation price to and click on its Edit link. This will take you to the Edit Product page for that product.
- On the Edit Product page, scroll down to the Product data section. In this section, you’ll see a tab for Variations. Click on this tab.
- On the Variations tab, you’ll see a list of all the variations for that product. Find the variation that you want to add a variation price to and click on its Edit link.
- On the Edit Variation page, scroll down to the Variation details section. In this section, you’ll see a field for “Regular price”. Enter the regular price for this variation in this field.
- Scroll down a bit further and you’ll see a field for “Sale price”. This is where you enter the variation price for this product. Enter the sale price in this field and then click on the “Update” button.
That’s it! You’ve now added a variation price to your product.
As you can see, it’s pretty easy to add variation prices in WooCommerce. Just follow the steps above and you’ll be able to add them in no time.
9 Related Question Answers Found
When running a WooCommerce store, you may want to offer different prices for different variations of the same product. For example, you may want to offer a discount for a product that is available in multiple colors. In order to do this, you will need to select the variation price for each product variation that you create.
Product variation price is one of the most important aspects of selling products online. It can make or break a sale, and so it’s important to get it right. Luckily, there are a few ways to do just that in WooCommerce.
Are you selling products that come in different sizes, colors, or styles? If so, then you’ll need to set up product variations in WooCommerce. Product variations let you offer the same product in different variations, each with their own SKU, price, stock options, and image.
When it comes to setting up a WooCommerce store, one of the first decisions you’ll need to make is what type of pricing model to use. There are three main pricing models in WooCommerce: fixed, tiered, and variable. In this article, we’ll focus on the variable pricing model and how it can benefit your store.
When it comes to setting prices for products in WooCommerce, the sky’s the limit – you can charge whatever you like, and set different prices for different variations of the same product. However, there may come a time when you need to change the price of one or more variations, and this is where things can get a little confusing! In this article, we’re going to take a look at how to change the variation price in WooCommerce.
When you have products with different variations, such as sizes or colors, you may want to display the prices for each variation on your WooCommerce product pages. This can be done using the following methods. First, you can use the built-in price display options in WooCommerce.
WooCommerce allows you to set variable product prices. To do this, first add a new product price field to your product’s page. This field will be used to store the price of the product at any given time.
When it comes to eCommerce, WooCommerce is one of the most popular platforms. It’s used by millions of people around the world, and for good reason. It’s user-friendly, relatively easy to set up, and it’s highly customizable.
As a WooCommerce store owner, you may want to offer products in multiple variations, such as different sizes, colors, or styles. For example, you might sell t-shirts that come in small, medium, and large sizes, or in different colors like blue, green, and red. When you create a product in WooCommerce, you can add as many variations as you need.