Display product descriptions as HTML in checkout

This commit is contained in:
Rohan Mitchell
2012-09-13 13:05:12 +10:00
parent 8394c47064
commit 06ed2a581f
4 changed files with 15 additions and 0 deletions

View File

@@ -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.

View File

@@ -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

View 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")

View 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 => "...")