Sha256: d1b3a427497cd97162036eaf17e280f0a25381915831b69dc137429da9199ca0
Contents?: true
Size: 1.94 KB
Versions: 3
Compression:
Stored size: 1.94 KB
Contents
<% @page_title = @product.title %> <h1>TbCommerce::Products#show</h1> <p>Find me in app/views/tb_commerce/products/show.html.erb</p> <%= form_for TbCommerce::CartItem.new, :url => tb_commerce_api_cart_items_path, :html => {:class => 'product-add-to-cart'}, :data => {:product_id => @product.id, :success => tb_commerce_cart_path}, :remote => true do |f| %> <% @product.option_sets.each do |option_set| %> <div class="form-group"> <%= label_tag "product_option_set_#{option_set.id}", option_set.name %> <%= select_tag "product_option_set_#{option_set.id}", options_from_collection_for_select(option_set.options, :id, :value), :include_blank => "Select #{option_set.name}", :class => 'form-control product-sku-option', :data => {:required => true} %> </div> <% end %> <% @product.customizations.each do |customization| %> <div class="form-group"> <% custom_input_name = "tb_commerce_cart_item[configuration][#{customization.title}]" %> <%= label_tag custom_input_name, customization.title %> <% if customization.input_type == 'list' %> <%= select_tag custom_input_name, options_for_select(customization.options), :include_blank => "Select #{customization.title}", :class => 'form-control product-sku-customization', :data => {:required => customization.is_required?} %> <% else %> <%= text_field_tag custom_input_name, '', :placeholder => "Enter #{customization.title}", :class => 'form-control product-sku-customization', :maxlength => 255, :data => {:required => customization.is_required?} %> <% end %> </div> <% end %> <div class="form-group"> <%= f.label :quantity %> <%= f.number_field :quantity, :min => 1, :step => 1, :class => 'form-control' %> </div> <%= f.hidden_field :tb_commerce_product_sku_id %> <p class="product-add-to-cart-info-text"></p> <%= f.submit 'Add to Cart', :class => 'btn btn-primary', :disabled => true %> <% end %> <pre> <%= @product.to_yaml %> </pre>
Version data entries
3 entries across 3 versions & 1 rubygems