mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Display product descriptions as HTML in checkout
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -20,6 +20,7 @@ gem 'spree_heroku', :git => 'git://github.com/joneslee85/spree-heroku.git'
|
||||
gem 'haml'
|
||||
gem 'aws-s3'
|
||||
gem 'andand'
|
||||
gem 'truncate_html'
|
||||
|
||||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
|
||||
@@ -304,6 +304,7 @@ GEM
|
||||
treetop (1.4.10)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
truncate_html (0.5.5)
|
||||
turn (0.8.3)
|
||||
ansi
|
||||
tzinfo (0.3.33)
|
||||
@@ -350,6 +351,7 @@ DEPENDENCIES
|
||||
spree_last_address!
|
||||
spree_paypal_express!
|
||||
therubyracer
|
||||
truncate_html
|
||||
turn (~> 0.8.3)
|
||||
uglifier (>= 1.0.3)
|
||||
unicorn
|
||||
|
||||
4
app/overrides/cart_item_description.rb
Normal file
4
app/overrides/cart_item_description.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Deface::Override.new(:virtual_path => "spree/orders/_line_item",
|
||||
:replace => "[data-hook='cart_item_description']",
|
||||
:partial => "spree/orders/cart_item_description",
|
||||
:name => "cart_item_description")
|
||||
8
app/views/spree/orders/_cart_item_description.html.haml
Normal file
8
app/views/spree/orders/_cart_item_description.html.haml
Normal file
@@ -0,0 +1,8 @@
|
||||
%td{'data-hook' => "cart_item_description"}
|
||||
%h4= link_to variant.product.name, product_path(variant.product)
|
||||
= variant.options_text
|
||||
- if @order.insufficient_stock_lines.include? line_item
|
||||
%span.out-of-stock
|
||||
= variant.in_stock? ? t(:insufficient_stock, :on_hand => variant.on_hand) : t(:out_of_stock)
|
||||
%br/
|
||||
= truncate_html(variant.product.description, :length => 100, :omission => "...")
|
||||
Reference in New Issue
Block a user