Displaying unit prices for products
If you sell products in quantities or measurements, then you can display the price per unit for certain products. This is a common practice in some industries and regions to help customers compare prices of different-sized packages or similar products from different brands.
For example, suppose you sell bags of coffee beans from different suppliers that range from $15 USD to $30 USD depending on the brand's smallest bag size, which ranges from 500g to 1kg. You can display the unit price per gram for each of your coffee bean bags which can help your customers make a more informed decision about what products are more or less expensive when placing an order, despite different package sizing and pricing.
When you enter a unit price for a product, the unit price is displayed automatically on the product pages, collection pages, cart page, and checkout pages of any Online Store 2.0 theme. If you have a vintage theme, then you can manually customize your theme code to display unit prices. The default order confirmation notifications also display unit prices automatically, but if you have a customized notification template, then you can manually update your template to include unit prices.
On this page
- Considerations for displaying unit prices on products
- How unit prices are calculated
- Add unit prices to your product
- Edit a product's unit price
- Delete a product's unit price
- Updating your products' unit pricing in bulk
- Display unit prices on your online store
- Display unit prices in your order notifications
Considerations for displaying unit prices on products
Before you add unit prices to your products, review the following considerations:
- Displaying the price per unit is a legal requirement in some regions. You need to determine whether your business is subject to this requirement.
- You can use metric or imperial units for unit pricing, but the units that display as options when adding a unit price to a product are determined by the current Unit system setting that you select in General settings of your Shopify admin. To use both metric and imperial units for different products in the same store, you need to change your store's default unit system before adding unit prices to products in the other unit system. Learn more about setting or changing your store's default weight unit.
- Unit pricing displays the same unit type across all markets. For example, you can't display a product as $1.50/12ft in the United States and €1.30/4yd in the European Union.
- Including unit pricing is optional for all products. There is no requirement or prompt in the Shopify admin to include unit pricing when creating a product with a specific product category that might typically include unit pricing.
- Some unit types, such as tons (t), centigrams (cg), or stones (st), aren't included as options for unit pricing.
How unit prices are calculated
The unit price of a product is determined by the product price and the total amount and base measure values that you set. The unit price is calculated based on the price for the product's total units divided by the units it contains, and then multiplied by the base measurement.
For example, if you have a product that's $30 USD and weighs 600g, and you want to display the unit price for the product per 1kg because that's the standard for the product type, then the unit price is calculated based on the following values:
- Product price: $30.00 USD
- Total weight: 600g
- Base weight: 1kg
With these values, the unit price is automatically calculated as $50.00/kg. This is because for a $30 USD product that weighs 600g, the product is $0.05 per gram ($30/600g = 0.05), and if the desired base measurement is 1kg (or 1000g), then the unit price is 0.05g x 1000g and is displayed as $50.00/kg.
If you want to display the unit price per 500g instead, then the unit price is calculated based on the following values:
- Product price: $30.00 USD
- Total weight: 600g
- Base weight: 500g
The price per gram is the same $0.05/g as before, but as the base measurement is now 500g, the unit price is 0.05g x 500g and is displayed as $25.00/500g.
Unit prices update dynamically based on changes to the Price field. If you change the price of your product, then the unit price updates based on your existing total and base measurements.
Add unit prices to your product
You can add a unit price to your products or variants in your Shopify admin. Each product or variant can have only 1 unit price associated with it.
Steps:
Desktop
From your Shopify admin, go to Products.
Click the product that you want to edit.
Optional: If your product has variants, then in the Variants section, click the variant that you want to edit.
In the Pricing section, click Unit price to configure your unit price values:
- In the Total amount field, enter your product's total measurement, and then select the unit of measurement.
- Optional: If you want to change the default base measure, then in the Base measure field, add your new base measure, and then select a unit of measurement. For example, for a product weighing 200g, you might select a base unit of 1kg.
- Click Done.
Click Save.
Mobile
- From the Shopify app, tap the
icon .
- Tap the product that you want to edit.
- Tap your product price area.
- Tap Show unit price, and then configure your unit price values:
- In the Total product measurement field, enter your product's total measurement, and then select the unit of measurement.
- Optional: If you want to change the default base measure, then in the Base measurement field, add your new base measure, and then select a unit of measurement. For example, for a product weighing 200g, you might select a base unit of 1kg.
- Tap Done.
- Tap Save or ✓.
Edit a product's unit price
You can update a product's unit price at any time by updating the total and base measurements and units of measurement.
Unit prices update dynamically based on changes to the Price field. If you change the price of your product, then the unit price updates based on your existing total and base measurements.
Steps:
From your Shopify admin, go to Products.
Click the product with the unit price that you want to edit.
Optional: If your product has variants, then in the Variants section, click the variant that you want to edit.
In the Pricing section, click Unit price to open the existing unit price values.
Update the unit price values, and then click Done.
Click Save.
Delete a product's unit price
You can delete a product's unit price at any time. You can manually add a new unit price later.
Steps:
From your Shopify admin, go to Products.
Click the product with the unit price that you want to delete.
Optional: If your product has variants, then in the Variants section, click the variant that you want to edit.
In the Pricing section, click Unit price, and then click Clear.
Click Save.
Updating your products' unit pricing in bulk
You can update your products' unit pricing in bulk by using the bulk editor or importing a product CSV file with updated unit price values. These options are available only when using a desktop device.
If you use the bulk editor to update your unit prices, then you need to add the Unit price column to display unit prices as cells in the editor. You can then click the cell in the editor to update the product's unit pricing values, including Total measure and Base measure values and units. Learn more about using the bulk editor.
If you use a product CSV to update your unit prices, then you need to include values in the following columns in your CSV file:
- Unit price total measure
- Unit price total measure unit
- Unit price base measure
- Unit price base measure unit
The values of all of these columns in the CSV are then used to calculate the product's unit price. Learn more about importing products with a CSV file and the descriptions of columns in the product CSV file.
Display unit prices on your online store
All Online Store 2.0 themes have the unit price feature already available. No action is required to display unit prices on your online store. Unit prices display to all markets when a unit price is included on a product.
If you have a vintage theme and you can't update it to a version that supports the unit price feature, then you can customize your theme code manually to display the unit price. If you need help customizing your vintage theme, then you can hire a Shopify Partner. Learn more about hiring a Shopify Partner.
Display unit prices in your order notifications
By default, the order confirmation notification displays unit prices when the feature is active.
If you add unit prices to your product, but your unit prices aren't displaying in your order confirmation notifications, then you might need to manually update your template. This can happen when the notification template has been customized, as customizations can override updates to the default template.
If you've previously manually added unit pricing code to your order notification emails, then you need to replace the previous code with the updated code, outlined in this section. The affected "order-list__item-price" class might appear multiple times in the same notification template, so be sure to update the code in all relevant locations.
Steps:
From your Shopify admin, go to Settings > Notifications.
In the Orders section, click Order confirmation.
Click Edit code.
Add the following snippet to the template within the
"order-list__item-price"class every time that the class appears in the template:
{% if line.unit_price_measurement %}
<div class="order-list__unit-price">
{{- line.unit_price | unit_price_with_measurement: line.unit_price_measurement -}}
</div>
{% endif %}5. Click Save.