Skip to content

Commit

Permalink
Merge pull request #12897 from rioug/12891-product-preview-fix-price
Browse files Browse the repository at this point in the history
[Product Preview] Fix price currency display
  • Loading branch information
drummer83 authored Oct 12, 2024
2 parents 52c1491 + 5b8e0d7 commit 7211b0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/admin/products_v3/product_preview.turbo_stream.haml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@
.variant-unit
= variant.unit_to_display
.small-4.medium-3.columns.variant-price
= number_to_currency(variant.price)
= Spree::Money.new(variant.price)
.unit-price.variant-unit-price
= render AdminTooltipComponent.new(text: t("js.shopfront.unit_price_tooltip"), link_text: "", placement: "top", link_class: "question-mark-icon")
- # TODO use an helper
- unit_price = UnitPrice.new(variant)
- price_per_unit = variant.price / (unit_price.denominator || 1)
= "#{number_to_currency(price_per_unit)} / #{unit_price.unit}".html_safe
= "#{Spree::Money.new(price_per_unit)} / #{unit_price.unit}".html_safe


.medium-3.columns.total-price
%span
= number_to_currency(0.00)
= Spree::Money.new(0.00)
.small-5.medium-3.large-3.columns.variant-quantity-column.text-right
.variant-quantity-inputs
%button.add-variant
Expand Down

0 comments on commit 7211b0d

Please sign in to comment.