Skip to main content

Product Price

Product Price

The product's price, in the shop's currency. Shows the struck-through price when it is on sale.

Props

PropTypeDefaultWhat it does
Price → Sizetextvar(--fe-woo-text-2xl, 1.25rem)
Price → Weighttext600
Price → Colourtextvar(--fe-woo-color, #111827)
Previous price → Strike iton / offonOff leaves it unstruck, for a shop that separates the two by colour and size alone. The element stays a either way, so a screen reader still announces it as the old price.
Previous price → Sizetext1em
Previous price → Weighttext400
Previous price → Colourtextvar(--fe-woo-muted, #6b7280)
Sale price → Sizetextvar(--fe-woo-price-size, 1.25rem)
Sale price → Weighttextvar(--fe-woo-price-weight, 600)
Sale price → Colourtext#b91c1c
Pricetext{this.fecommerce.price_formatted}Comes from the product being shown. Inside a loop it follows each product by itself when the loop’s item is called «this»; with any other name, bind it to that name.
Two priceson / off{this.fecommerce.has_price_pair}Whether there are two prices to show. Not the same as being on sale: a variable product with one discounted variation is on sale but has a range, not a pair — bind it to on_sale and its card shows two labels and no figures.
Previous pricetext{this.fecommerce.regular_price_formatted}
Sale pricetext{this.fecommerce.sale_price_formatted}
Previous price labeltext{this.fecommerce.regular_price_label}Heard, never seen: «$20.00 $18.00» read aloud is two figures with no way to tell which one is charged.
Sale price labeltext{this.fecommerce.sale_price_label}

Variables of its own

VariableDefaultWhat it controls
--fe-woo-price-sizevar(--fe-woo-text-2xl, 1.25rem)How big the price is.
--fe-woo-price-weight600Its weight.
--fe-woo-price-was-colorvar(--fe-woo-muted, #6b7280)The struck-through price of a sale.
--fe-woo-price-was-size1emHow big the struck-through price is. 1em by default: the same as the price beside it, and it follows if that one changes.
--fe-woo-price-was-weight400Its weight — lighter than the price, because it is not the one anybody pays.
--fe-woo-price-sale-color#b91c1cThe new one. Red on its own account — it is a convention, not a state, so tying it to the danger token would repaint your sale prices every time you changed «Error».
--fe-woo-price-now-sizevar(--fe-woo-price-size, 1.25rem)How big the sale price is. It follows the price above unless you say otherwise — it is what gets charged, so it has to look like a price.
--fe-woo-price-now-weightvar(--fe-woo-price-weight, 600)And its weight, which follows the same one.