Displaying unit prices

If you sell products in quantities or measurements, then you might need to display the price per unit for certain products. When you enter a unit price for a product, the unit price is displayed on the product pages, collection pages, cart page, checkout pages, and order confirmation notifications.

Add unit prices to your product

  1. From your Shopify admin, go to Products.

  2. Click the product that you want to edit.

  3. Optional: If your product has variants, then in the Variants section, click the variant that you want to edit.

  4. In the Pricing section, select Show unit price for this product.

  5. In the Total product measurement field, enter in your product's total measurement, and then select the unit of measurement.

  6. 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 200 g, you might select a base unit of 1 kg.

  7. Click Save.

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.

If you have a vintage theme and aren't able to update it to a version that supports the unit price feature, then you can customize your theme code manually to display the unit price.

Display unit prices on a vintage theme

The steps for this customization vary depending on your theme. Click the button for your theme before following the instructions below:

Display unit prices in your order notifications

By default, the order confirmation notification displays unit prices when the feature is active.

If you have added unit prices to your product, but your unit prices aren't appearing in your order confirmation notifications, then you might need to manually update your template.

Steps:

  1. From your Shopify admin, go to Settings > Notifications.

  2. In the Orders section, click Order confirmation.

  3. Click Edit code.

  4. Add the following snippet to the template within the "order-list__item-price" class:

{%- if line_item.unit_price_measurement -%}
  <div class="order-list__unit-price">
     {{ line_item.unit_price | money }}/
     {%- if line_item.unit_price_measurement.reference_value != 1 -%}
       {{- line_item.unit_price_measurement.reference_value -}}
     {%- endif -%}
     {{ line_item.unit_price_measurement.reference_unit }}
  </div>
{%- endif -%}

Unit price code snippet highlighted in the appropriate location in the Email body (HTML) window of the Order confirmation notification.

 5. Click Save.

Can’t find the answers you’re looking for? We’re here to help.