https://img.shields.io/badge/-Deprecated-redhttps://img.shields.io/badge/-Deprecated-red

⚠️

Warning

The Product Price block has been deprecated in favor of the Product Price app. Although support for this block is still granted, we strongly recommend you to update your store theme with the Product Price's blocks in order to keep up with the component's evolution.

The product-price component is responsible for displaying the price of a given product.

imageimage

Configuration

  1. Import the vtex.store-components app to your theme's dependencies in the manifest.json file as in the following example:
  "dependencies": {
    "vtex.store-components": "3.x"
  }
  1. Add the product-price block to any child of the store.product template (Product Details Page template). For example:
  "store.product": {
    "children": [
      "flex-layout.row#product",
    ]
  },
  "flex-layout.row#product": {
    "children": [
+     "product-price"
    ]
  },
  1. Then, declare the product-price block using the props stated in the Props table. For example:
   "product-price": {
    "props": {
      "showSavings": true,
      "showListPrice": false
    }
  },

Props

Prop nameTypeDescriptionDefault value
blockClassStringThe set value functions as a customization identifier for any CSS specified in the blocknull
labelListPriceStringProduct list price labelnull
labelSellingPriceStringProduct selling price labelnull
sellingPricesArrayProduct list of selling prices[]
showInstallmentsBooleanSet visibility of installmentsfalse
showLabelsBooleanSet visibility of labelstrue
showListPriceBooleanSet visibility of list pricetrue
showListPriceRangeBooleanSet visibility of list price rangefalse
showSavingsBooleanSet visibility of savingsfalse
showSellingPriceRangeBooleanSet visibility of selling price rangefalse

Customization

To apply CSS customizations in this and other blocks, follow the Using CSS handles for store customization guide.

CSS Handles
price_className
price_installment
price_installmentContainer
price_interestRate
price_listPrice
price_listPriceContainer
price_listPriceLabel
price_listPriceRange
price_loader
price_savings
price_savingsContainer
price_sellingPrice
price_sellingPriceContainer
price_sellingPriceLabel
price_sellingPriceRange

Did this page help you?