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产品.

  2. Click the product that you want to edit.

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

  4. In thePricingsection, selectShow unit price for this product.

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

  6. Optional: In theBase measurefield, add your base measure, and then select the unit of measurement. For example, for a product weighing 1 kg, you might select a base unit of 100 g.

  7. ClickSave.

Show unit prices on your online store

所有Online Store 2.0 themeshave the unit price feature already available. No action is required to display unit prices on your online store.

If you have avintage themeand 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.

Show 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:

Show 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 toSettings>Notifications.

  2. In theOrderssection, clickOrder confirmation.

  3. ClickEdit code.

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

{%-ifline_item.unit_price_measurement-%}
{{line_item.unit_price|money}}/{%-ifline_item.unit_price_measurement.reference_value!=1-%}{{-line_item.unit_price_measurement.reference_value-}}{%-endif-%}{{line_item.unit_price_measurement.reference_unit}}
{%-endif-%}

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

5.ClickSave.

Shopify准备OB欧宝娱乐APP开始销售?Try it free