v0.0.2
Demos (demo panel, opens in a new tab)

Price

The product's price; for a product on sale, the old price struck through beside it.

zb:shop.price zubazar/ui-pro

PRO

This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →

On a card

On a card: view
BLADE

The default small size is the product card's price; the preview shows a product on sale and one at full price.

blade
<zb:shop.price :product="$product" />

On the product page

On the product page: view
BLADE

size="lg" is the large price under the product page's title.

blade
<zb:shop.price :product="$product" size="lg" />

Amounts and currency

PHP

Prices are integers in the currency's minor unit (cents, kuruş); the currency sign comes from the currency_symbol setting.

php
// config/zubazar-ui-pro.php (commerce)
'currency_symbol' => '₺',

// The product's data: a price of 2,499 and an old price of 2,999
Product::fromArray([..., 'price' => 249900, 'old_price' => 299900]);
PropValues
249900₺2,499 (₺2.499 on a Turkish page)
7990₺79.90 (₺79,90 on a Turkish page)

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
product— — The product whose price is shown; required
size—smsm: a card · lg: the product page

Developer notes

Events, hooks and details
  • The old price (old_price) only shows when it is higher than the price; screen readers read the two amounts as "Price" and "Old price".
  • The amount is formatted for the page's language, always with two decimals (₺2,499.00, ₺79.90).
Zubazar UI · ZubazarDesigned for people.