Skip to content

Commit

Permalink
Merge pull request #151 from nebulab/mfrecchiami/move_price_under_pro…
Browse files Browse the repository at this point in the history
…duct_info

Move price under product info
  • Loading branch information
kennyadsl authored Mar 23, 2021
2 parents b9806fc + 422a33d commit 7685a28
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.product-price {
font-size: $h4-font-size;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.product-submit {
margin: 0 0 3rem;

&__title {
font-size: $h4-font-size;
}
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/spree/frontend/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
@import 'spree/frontend/components/products/product_image';
@import 'spree/frontend/components/products/product_info';
@import 'spree/frontend/components/products/product_page';
@import 'spree/frontend/components/products/product_price';
@import 'spree/frontend/components/products/product_properties';
@import 'spree/frontend/components/products/product_submit';
@import 'spree/frontend/components/products/product_taxons';
Expand Down
2 changes: 2 additions & 0 deletions app/views/spree/components/products/_product_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<%= @product.name %>
</h1>

<%= render 'spree/components/products/product_price', product: @product %>

<p class="product-info__description" itemprop="description">
<%= product_description(@product) rescue t('spree.product_has_no_description') %>
</p>
Expand Down
16 changes: 16 additions & 0 deletions app/views/spree/components/products/_product_price.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<% if @product.price_for(current_pricing_options) and [email protected]? %>
<h2 class="product-price" id="product-price">
<%= content_tag(
:span,
display_price(@product),
itemprop: 'price',
content: @product.price_for(current_pricing_options).to_d,
data: { js: 'price' }
) %>

<span
itemprop="priceCurrency"
content="<%= current_pricing_options.currency %>"
></span>
</h2>
<% end %>
16 changes: 1 addition & 15 deletions app/views/spree/components/products/_product_submit.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
<div class="product-submit" id="product-price">
<h2 class="product-submit__title">
<%= content_tag(
:span,
display_price(@product),
itemprop: 'price',
content: @product.price_for(current_pricing_options).to_d,
data: { js: 'price' }
) %>
<span
itemprop="priceCurrency"
content="<%= current_pricing_options.currency %>"
></span>
</h2>

<div class="product-submit">
<%= render 'spree/components/products/product_availability', product: @product %>

<div class="horizontal-input-group">
Expand Down

0 comments on commit 7685a28

Please sign in to comment.