Hello guys,

first at all i hope u have all a great day :)

So i have some Questions about the cart views (edit.html.erb so on). I just
want add to the line_item a column with the variant option and value (e.g.
Small S). But i get only a error when i try it via
variant.option_values.presentation for example.

My Question is : Is it possible to get the variant details on the cart view?

And 2nd is a problem/issue with the little delete icon. when i click on it,
it doesnt delete the line_item.

This is my _line_item.html.erb file, maybe i forgot something or there is a
logical mistake.

<% variant = line_item.variant -%>
<%= order_form.fields_for :line_items, line_item do |item_form| -%>
   <tr class="<%= cycle('', 'alt') %> line-item" style="text-align: center;">

     <td style="width:120px;" class="cart-item-image" data-hook=
"cart_item_image">
       <% if variant.images.length == 0 %>
         <%= link_to small_image(variant.product), variant.product %>
       <% else %>
         <%= link_to image_tag(variant.images.first.attachment.url(:small)),variant
.product %>
       <% end %>
     </td>

     <td style="width:120px;" class="cart-item-description" data-hook=
"cart_item_description">
       <h4><%= link_to variant.product.name, product_path(variant.product) %>
</h4>
     </td>

     <td style="width:120px;" data-hook="cart_item_variant"><!-- variante
option anzeigen -->
     <%= variant.name %>
     </td>

     <td class="cart-item-price" data-hook="cart_item_price">
       <%= line_item.single_money.to_html %>
     </td>

     <td class="cart-item-quantity" data-hook="cart_item_quantity">
       <%= item_form.number_field :quantity, :min => 0, :class =>
"line_item_quantity", :size => 5 %>
     </td>

     <td class="cart-item-total" data-hook="cart_item_total">
       <%= line_item.display_amount.to_html unless line_item.quantity.nil? %>
     </td>

     <td class="cart-item-delete" data-hook="cart_item_delete">
       <%= link_to image_tag('icons/delete.png'), '#', :class => 'delete', :id
=> "delete_#{dom_id(line_item)}" %>
     </td>

  </tr>
<% end -%>


Thanks for your attention and any usefull tips for me :)

Greetings
Danny

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedOct 6, '13 at 12:51p
activeOct 6, '13 at 12:51p
posts1
users1
websitespreecommerce.com
irc#RubyOnRails

1 user in discussion

Danny: 1 post

People

Translate

site design / logo © 2022 Grokbase