workarea-wish_lists 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.eslintignore +2 -0
  4. data/.eslintrc +24 -0
  5. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  6. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  7. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  8. data/.gitignore +15 -0
  9. data/.scss-lint.yml +188 -0
  10. data/.yardopts +1 -0
  11. data/CHANGELOG.md +610 -0
  12. data/CODE_OF_CONDUCT.md +3 -0
  13. data/CONTRIBUTING.md +3 -0
  14. data/Gemfile +6 -0
  15. data/LICENSE +52 -0
  16. data/README.md +58 -0
  17. data/Rakefile +53 -0
  18. data/app/assets/javascripts/workarea/storefront/wish_lists/modules/wish_list_button.js +35 -0
  19. data/app/assets/javascripts/workarea/storefront/wish_lists/modules/wish_list_public_quantity_fields.js +42 -0
  20. data/app/assets/javascripts/workarea/storefront/wish_lists/templates/hidden_input.jst.ejs +1 -0
  21. data/app/assets/stylesheets/workarea/storefront/wish_lists/components/_wish_list_button.scss +6 -0
  22. data/app/assets/stylesheets/workarea/storefront/wish_lists/components/_wish_lists.scss +24 -0
  23. data/app/controllers/workarea/admin/users_controller.decorator +20 -0
  24. data/app/controllers/workarea/storefront/users/wish_lists_controller.rb +128 -0
  25. data/app/controllers/workarea/storefront/wish_lists_controller.rb +22 -0
  26. data/app/models/workarea/wish_list.rb +212 -0
  27. data/app/models/workarea/wish_list/item.rb +76 -0
  28. data/app/models/workarea/wish_list/pricing.rb +14 -0
  29. data/app/models/workarea/wish_list/pricing/calculators/totals_calculator.rb +26 -0
  30. data/app/models/workarea/wish_list/public_search.rb +34 -0
  31. data/app/models/workarea/wish_list/request.rb +36 -0
  32. data/app/seeds/workarea/wish_list_seeds.rb +24 -0
  33. data/app/services/workarea/set_wish_list_details.rb +49 -0
  34. data/app/services/workarea/wish_list_session.rb +53 -0
  35. data/app/view_models/workarea/admin/user_view_model.decorator +12 -0
  36. data/app/view_models/workarea/storefront/user_view_model.decorator +31 -0
  37. data/app/view_models/workarea/storefront/wish_list_item_view_model.rb +35 -0
  38. data/app/view_models/workarea/storefront/wish_list_view_model.rb +75 -0
  39. data/app/views/layouts/workarea/storefront/_wish_lists_link.html.haml +6 -0
  40. data/app/views/workarea/admin/users/_wish_list_card.html.haml +24 -0
  41. data/app/views/workarea/admin/users/_wish_list_item_summary.html.haml +8 -0
  42. data/app/views/workarea/admin/users/wish_list.html.haml +26 -0
  43. data/app/views/workarea/storefront/carts/_move_to_wish_list.html.haml +4 -0
  44. data/app/views/workarea/storefront/products/_add_to_wish_list.html.haml +4 -0
  45. data/app/views/workarea/storefront/style_guides/_wish_lists_product_list_docs.html.haml +158 -0
  46. data/app/views/workarea/storefront/users/accounts/_wish_list_summary.html.haml +15 -0
  47. data/app/views/workarea/storefront/users/wish_lists/show.html.haml +125 -0
  48. data/app/views/workarea/storefront/wish_lists/_wish_lists_link.html.haml +4 -0
  49. data/app/views/workarea/storefront/wish_lists/index.html.haml +32 -0
  50. data/app/views/workarea/storefront/wish_lists/show.html.haml +97 -0
  51. data/app/workers/workarea/mark_wish_list_items_purchased.rb +18 -0
  52. data/app/workers/workarea/update_wish_list_details.rb +19 -0
  53. data/bin/rails +18 -0
  54. data/config/initializers/append_points.rb +46 -0
  55. data/config/initializers/configuration.rb +10 -0
  56. data/config/locales/en.yml +60 -0
  57. data/config/routes.rb +23 -0
  58. data/lib/workarea/testing/factories/wish_lists.rb +22 -0
  59. data/lib/workarea/wish_lists.rb +13 -0
  60. data/lib/workarea/wish_lists/engine.rb +15 -0
  61. data/lib/workarea/wish_lists/version.rb +5 -0
  62. data/test/dummy/Rakefile +6 -0
  63. data/test/dummy/app/assets/config/manifest.js +4 -0
  64. data/test/dummy/app/assets/images/.keep +0 -0
  65. data/test/dummy/app/assets/javascripts/application.js +13 -0
  66. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  67. data/test/dummy/app/controllers/application_controller.rb +3 -0
  68. data/test/dummy/app/controllers/concerns/.keep +0 -0
  69. data/test/dummy/app/helpers/application_helper.rb +2 -0
  70. data/test/dummy/app/jobs/application_job.rb +2 -0
  71. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  72. data/test/dummy/app/models/concerns/.keep +0 -0
  73. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  74. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  75. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  76. data/test/dummy/bin/bundle +3 -0
  77. data/test/dummy/bin/rails +4 -0
  78. data/test/dummy/bin/rake +4 -0
  79. data/test/dummy/bin/setup +34 -0
  80. data/test/dummy/bin/update +29 -0
  81. data/test/dummy/config.ru +5 -0
  82. data/test/dummy/config/application.rb +24 -0
  83. data/test/dummy/config/boot.rb +5 -0
  84. data/test/dummy/config/cable.yml +9 -0
  85. data/test/dummy/config/environment.rb +5 -0
  86. data/test/dummy/config/environments/development.rb +54 -0
  87. data/test/dummy/config/environments/production.rb +86 -0
  88. data/test/dummy/config/environments/test.rb +43 -0
  89. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  90. data/test/dummy/config/initializers/assets.rb +11 -0
  91. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  92. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  93. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  94. data/test/dummy/config/initializers/inflections.rb +16 -0
  95. data/test/dummy/config/initializers/mime_types.rb +4 -0
  96. data/test/dummy/config/initializers/new_framework_defaults.rb +21 -0
  97. data/test/dummy/config/initializers/session_store.rb +3 -0
  98. data/test/dummy/config/initializers/workarea.rb +5 -0
  99. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  100. data/test/dummy/config/locales/en.yml +23 -0
  101. data/test/dummy/config/puma.rb +47 -0
  102. data/test/dummy/config/routes.rb +5 -0
  103. data/test/dummy/config/secrets.yml +22 -0
  104. data/test/dummy/config/spring.rb +6 -0
  105. data/test/dummy/db/seeds.rb +3 -0
  106. data/test/dummy/lib/assets/.keep +0 -0
  107. data/test/dummy/log/.keep +0 -0
  108. data/test/dummy/public/404.html +67 -0
  109. data/test/dummy/public/422.html +67 -0
  110. data/test/dummy/public/500.html +66 -0
  111. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  112. data/test/dummy/public/apple-touch-icon.png +0 -0
  113. data/test/dummy/public/favicon.ico +0 -0
  114. data/test/integration/workarea/storefront/wish_lists_integration_test.rb +211 -0
  115. data/test/models/workarea/wish_list/public_search_test.rb +82 -0
  116. data/test/models/workarea/wish_list_test.rb +158 -0
  117. data/test/services/workarea/set_wish_list_details_test.rb +62 -0
  118. data/test/services/workarea/wish_list_session_test.rb +47 -0
  119. data/test/system/workarea/admin/wish_lists_system_test.rb +46 -0
  120. data/test/system/workarea/storefront/wish_lists_system_test.rb +287 -0
  121. data/test/test_helper.rb +10 -0
  122. data/test/view_models/workarea/storefront/user_view_model_test.rb +46 -0
  123. data/test/view_models/workarea/storefront/wish_list_item_view_model_test.rb +47 -0
  124. data/test/view_models/workarea/storefront/wish_list_view_model_test.rb +74 -0
  125. data/test/workers/workarea/mark_wish_list_items_purchased_test.rb +21 -0
  126. data/workarea-wish_lists.gemspec +21 -0
  127. metadata +188 -0
@@ -0,0 +1,49 @@
1
+ module Workarea
2
+ class SetWishListDetails
3
+ def initialize(wish_list)
4
+ @wish_list = wish_list
5
+ end
6
+
7
+ def perform
8
+ return unless user.present?
9
+
10
+ @wish_list.attributes = {
11
+ email: user.email,
12
+ first_name: user.first_name,
13
+ last_name: user.last_name,
14
+ name: user.name,
15
+ location: location_for(user.default_billing_address)
16
+ }
17
+ end
18
+
19
+ def perform!
20
+ perform && @wish_list.save!
21
+ end
22
+
23
+ private
24
+
25
+ def user
26
+ @user ||= Workarea::User.find(@wish_list.user_id)
27
+ rescue Mongoid::Errors::DocumentNotFound, Mongoid::Errors::InvalidFind
28
+ nil
29
+ end
30
+
31
+ # TODO: Remove in next major version
32
+ #
33
+ # @deprecated
34
+ def name_for(user)
35
+ [user.first_name, user.last_name].join(' ').strip
36
+ end
37
+
38
+ def location_for(address)
39
+ return '' if address.blank?
40
+
41
+ [
42
+ address.city,
43
+ address.region,
44
+ address.country.alpha2,
45
+ address.postal_code
46
+ ].join(' ').strip
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,53 @@
1
+ module Workarea
2
+ # WishListSession is responsible for storing a representation of a product that will later be added to a user's Wish List.
3
+ #
4
+ class WishListSession
5
+ attr_reader :session
6
+
7
+ # @param [Hash] user's Session
8
+ def initialize(session)
9
+ @session = session
10
+ end
11
+
12
+ # Store a form-posted representation of a Wish List Item. This would include the product_id, sku and quantity of that item.
13
+ #
14
+ # @param [Hash] controller's params
15
+ #
16
+ # @return [void]
17
+ def store_item(params)
18
+ collection_keys.each do |key|
19
+ session["wish_list_#{key}"] = params[key] if params[key].present?
20
+ end
21
+ end
22
+
23
+ # Add the current item in the session to a the given wish list.
24
+ #
25
+ # @param [WishList]
26
+ #
27
+ # @return [void]
28
+ def add_item(wish_list)
29
+ product_id = session['wish_list_product_id']
30
+ sku = session['wish_list_sku']
31
+ quantity = session['wish_list_quantity']
32
+ customizations = session['wish_list_customizations']
33
+
34
+ wish_list.add_item(
35
+ product_id,
36
+ sku,
37
+ quantity.to_i,
38
+ OrderItemDetails.find!(sku).to_h,
39
+ customizations || {}
40
+ )
41
+
42
+ collection_keys.each do |key|
43
+ session.delete("wish_list_#{key}")
44
+ end
45
+ end
46
+
47
+ private
48
+
49
+ def collection_keys
50
+ %w(item_id product_id sku quantity customizations)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,12 @@
1
+ module Workarea
2
+ decorate Admin::UserViewModel, with: :wish_lists do
3
+
4
+ def wish_list
5
+ @wish_list ||=
6
+ Storefront::WishListViewModel.new(
7
+ Workarea::WishList.for_user(model.id),
8
+ options
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,31 @@
1
+ module Workarea
2
+ decorate Storefront::UserViewModel, with: 'wish_lists' do
3
+ def wish_list_items
4
+ @wish_list_items ||= unpurchased_items.map do |item|
5
+ product = wish_list_active_products.detect do |active_product|
6
+ active_product.id == item.product_id
7
+ end
8
+
9
+ if product.present?
10
+ Storefront::WishListItemViewModel.new(item, product: product)
11
+ end
12
+ end.compact
13
+ end
14
+
15
+ private
16
+
17
+ delegate :unpurchased_items, to: :wish_list
18
+
19
+ def wish_list
20
+ @wish_list ||= WishList.for_user(id)
21
+ end
22
+
23
+ def wish_list_active_products
24
+ @wish_list_active_products ||=
25
+ begin
26
+ product_ids = unpurchased_items.map(&:product_id)
27
+ Catalog::Product.find(product_ids).select(&:active?)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,35 @@
1
+ module Workarea
2
+ module Storefront
3
+ class WishListItemViewModel < ApplicationViewModel
4
+ delegate :has_prices?, :primary_image, :name, :purchasable?, to: :product
5
+
6
+ def product
7
+ @product ||= ProductViewModel.wrap(
8
+ product_model,
9
+ sku: sku,
10
+ pricing: options[:pricing],
11
+ inventory: options[:inventory_collection]
12
+ )
13
+ end
14
+
15
+ def customized?
16
+ customizations.present?
17
+ end
18
+
19
+ def inventory_status
20
+ InventoryStatusViewModel.new(inventory).message
21
+ end
22
+
23
+ private
24
+
25
+ def inventory
26
+ @inventory ||= options[:inventory] ||
27
+ Inventory::Sku.find_or_create_by(id: sku)
28
+ end
29
+
30
+ def product_model
31
+ options[:product] || Catalog::Product.find(product_id)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,75 @@
1
+ module Workarea
2
+ module Storefront
3
+ class WishListViewModel < ApplicationViewModel
4
+ def name
5
+ user.name.present? ? user.name : user.email
6
+ end
7
+
8
+ def items
9
+ @items ||=
10
+ begin
11
+ items = if options[:state] == 'purchased'
12
+ model.purchased_items
13
+ else
14
+ model.unpurchased_items
15
+ end
16
+
17
+ items.map do |item|
18
+ product = products.detect { |p| p.id == item.product_id }
19
+
20
+ next unless product.active?
21
+
22
+ item = Storefront::OrderItemViewModel.new(item)
23
+
24
+ WishListItemViewModel.new(
25
+ item,
26
+ product: product,
27
+ inventory: inventory.for_sku(item.sku),
28
+ inventory_collection: inventory,
29
+ pricing: pricing
30
+ )
31
+ end.compact
32
+ end
33
+ end
34
+
35
+ def state_options
36
+ [
37
+ [I18n.t('workarea.storefront.wish_lists.unpurchased_items'), :unpurchased],
38
+ [I18n.t('workarea.storefront.wish_lists.purchased_items'), :purchased]
39
+ ]
40
+ end
41
+
42
+ def empty_state
43
+ I18n.t(
44
+ options[:state] || :unpurchased,
45
+ scope: 'workarea.storefront.wish_lists.empty.states'
46
+ )
47
+ end
48
+
49
+ def empty_text
50
+ I18n.t(
51
+ 'workarea.storefront.wish_lists.empty.message',
52
+ state: empty_state
53
+ )
54
+ end
55
+
56
+ private
57
+
58
+ def user
59
+ @user ||= User.find(user_id)
60
+ end
61
+
62
+ def products
63
+ @products ||= Catalog::Product.find(model.items.map(&:product_id))
64
+ end
65
+
66
+ def inventory
67
+ @inventory ||= Inventory::Collection.new(model.items.map(&:sku))
68
+ end
69
+
70
+ def pricing
71
+ @pricing ||= Pricing::Collection.new(model.items.map(&:sku))
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,6 @@
1
+ -# TODO v4 remove
2
+ - warn "DEPRECATION WARNING: the location of the `_wish_lists_link.html.haml` partial has moved from `app/views/layout/workarea/storefront/` to `app/views/workarea/storefront/wish_lists/`. Please update your application accordingly, as this file will be removed in the next major release."
3
+ .grid__cell
4
+ .wish-lists__link
5
+ = link_to users_wish_list_path do
6
+ %span= t('layouts.workarea.storefront.wish_lists_link.your_wish_list')
@@ -0,0 +1,24 @@
1
+ .grid__cell
2
+ .card{ class: card_classes(:wish_list, local_assigns[:active]) }
3
+ = link_to user_wish_list_path(model), class: 'card__header' do
4
+ %span.card__header-text= t('workarea.admin.users.cards.wish_list.title')
5
+ = inline_svg 'workarea/admin/icons/featured_products.svg', class: 'card__icon'
6
+
7
+ - if local_assigns[:active].blank?
8
+ .card__body
9
+ - if model.wish_list.items.empty?
10
+ .card__empty-note
11
+ %p= t('workarea.admin.users.cards.wish_list.empty')
12
+ = link_to user_wish_list_path(model), class: 'card__button' do
13
+ %span.button.button--small= t('workarea.admin.users.cards.wish_list.button')
14
+ - else
15
+ %ol.grid
16
+ - model.wish_list.items.take(4).each_with_index do |item, i|
17
+ %li.grid__cell.grid__cell--50
18
+ .card__photo-box
19
+ - if i == 3 && model.wish_list.items.size > 4
20
+ %span.card__photo +#{model.wish_list.items.size - i}
21
+ - else
22
+ = image_tag product_image_url(item.product.primary_image, :medium), alt: item.product.name, class: 'card__photo'
23
+ = link_to user_wish_list_path(model), class: 'card__button' do
24
+ %span.button.button--small= t('workarea.admin.users.cards.wish_list.button')
@@ -0,0 +1,8 @@
1
+ .summary
2
+ = link_to catalog_product_path(model.product) do
3
+ .summary__image-container
4
+ = image_tag(product_image_url(model.product.primary_image, :medium), alt: model.name, class: 'summary__image') if model.product.primary_image.present?
5
+ %span.summary__name= model.name
6
+ .summary__info-container
7
+ %span.summary__info #{t('workarea.admin.users.wish_list.quantity')}: #{model.quantity}
8
+ %span.summary__info= model.sku_name
@@ -0,0 +1,26 @@
1
+ - @page_title = t('workarea.admin.users.wish_list.title', user: @user.name)
2
+
3
+ .view
4
+ .view__header
5
+ .grid.grid--middle.grid--center
6
+ .grid__cell.grid__cell--50
7
+ .view__heading
8
+ = link_to_index_for(@user)
9
+ %h1= t('workarea.admin.users.wish_list.title_html', user: link_to(@user.name, url_for(@user)))
10
+
11
+ .view__container
12
+ = render_cards_for(@user, :wish_list)
13
+
14
+ .view__container
15
+ .browsing-controls.browsing-controls--with-divider.browsing-controls--center.browsing-controls--filters-displayed
16
+ = form_tag user_wish_list_path(@user), method: 'get', id: 'user_wish_list_form' do
17
+ .browsing-controls__filter
18
+ .property.property--inline
19
+ = label_tag 'state', t('workarea.admin.users.wish_list.state'), class: 'property__name'
20
+ = select_tag :state, options_for_select(@user.wish_list.state_options, params[:state]), data: { form_submitting_control: '' }
21
+
22
+ %p.align-center= pluralize(@user.wish_list.items.count, t('workarea.admin.users.wish_list.item'))
23
+
24
+ .grid.grid--auto.grid--flush.grid--center
25
+ - @user.wish_list.items.each do |item|
26
+ .grid__cell= render 'workarea/admin/users/wish_list_item_summary', model: item
@@ -0,0 +1,4 @@
1
+ .grid__cell
2
+ = form_tag from_cart_users_wish_list_path(item), method: 'post' do
3
+ = hidden_field_tag :return_to, users_wish_list_path, id: "wishlist_return_to_#{dom_id(item)}"
4
+ %p= button_tag t('workarea.storefront.wish_lists.move_to_wish_list'), value: 'move_to_wish_list', class: 'text-button'
@@ -0,0 +1,4 @@
1
+ .wish-list-button
2
+ - if product.purchasable?
3
+ = link_to users_wish_list_path, class: 'wish-list-button__link text-button', data: { wish_list_button: '' } do
4
+ = t('workarea.storefront.wish_lists.add_to_wish_list')
@@ -0,0 +1,158 @@
1
+ %p Cart items with wish list plugin:
2
+
3
+ .style-guide__example-block
4
+ %ul.product-list
5
+ %li.product-list__item
6
+ .product-list__item-cell
7
+ .product-list__summary
8
+ %p.product-list__media= link_to(image_tag('workarea/storefront/style_guide_product.jpg', alt: 'Product Name', class: 'product-list__media-image'), '#', class: 'product-list__media-link')
9
+ .product-list__info
10
+ %p.product-list__name= link_to('Product Name', '#')
11
+ %p.product-list__id 1234
12
+ .product-list__option-group
13
+ %p.product-list__option Color: Blue
14
+ %p.product-list__option Size: Small
15
+ .grid.grid--auto.grid--middle
16
+ = form_tag nil, class: 'grid__cell' do
17
+ %p= button_tag 'Remove', class: 'text-button'
18
+ = form_tag nil, class: 'grid__cell' do
19
+ %p= button_tag 'Move to Wish List', class: 'text-button'
20
+ .product-list__item-cell
21
+ %table.table
22
+ %thead
23
+ %tr
24
+ %th.table__prices Price
25
+ %th.table__quantity Qty
26
+ %th.table__prices Total
27
+ %tbody
28
+ %tr
29
+ %td.table__prices
30
+ %p.table__price
31
+ %span.table__price-label Now:
32
+ %strong.table__price-discount= number_to_currency(90.00)
33
+ %p.table__price
34
+ %span.table__price-label Was:
35
+ %s= number_to_currency(100.00)
36
+ %p.table__price
37
+ %span.table__price-label Customizations:
38
+ %span= number_to_currency(10.00)
39
+ %td.table__quantity
40
+ = form_tag nil, class: 'inline-form' do
41
+ .inline-form__cell
42
+ .value= number_field_tag 'wl_table_cart_item_quantity', 1, min: 1, required: true, class: 'text-box text-box--x-small', data: { form_submitting_control: '' }, title: 'Quantity', id: nil
43
+ %p.inline-form__cell.hidden-if-js-enabled= button_tag 'Update', value: 'change_quantity', class: 'button'
44
+ %td.table__prices
45
+ %p.table__price
46
+ %span.table__price-label Subtotal:
47
+ %span= number_to_currency(100.00)
48
+ %p.table__price
49
+ %span.table__price-label Gift Wrap:
50
+ %span= number_to_currency(10.00)
51
+ %p.table__price
52
+ %span.table__price-label Item Level Discount:
53
+ %strong.table__price-discount −#{number_to_currency(5.00)}
54
+ %p.table__price
55
+ %span.table__price-label An Item Level Discount With a Longer Name Than the Last:
56
+ %strong.table__price-discount −#{number_to_currency(5.00)}
57
+ %p.table__price
58
+ %span.table__price-label Total:
59
+ %span= number_to_currency(100.00)
60
+ %li.product-list__item
61
+ .product-list__item-cell
62
+ .product-list__summary
63
+ %p.product-list__media= link_to(image_tag('workarea/storefront/style_guide_product.jpg', alt: 'Product Name', class: 'product-list__media-image'), '#', class: 'product-list__media-link')
64
+ .product-list__info
65
+ %p.product-list__name= link_to('Product Name', '#')
66
+ .product-list__item-cell
67
+ %table.table
68
+ %thead
69
+ %tr
70
+ %th.table__prices Price
71
+ %th.table__quantity Qty
72
+ %th.table__prices Total
73
+ %tbody
74
+ %tr
75
+ %td.table__prices
76
+ %p.table__price
77
+ %span Free Gift!
78
+ %td.table__quantity
79
+ %p 1
80
+ %td.table__prices
81
+ %p.table__price
82
+ %span Free Gift!
83
+
84
+ %p Public wish list (plugin):
85
+
86
+ .style-guide__example-block
87
+ %ul.product-list
88
+ - 2.times do
89
+ %li.product-list__item
90
+ .product-list__item-cell
91
+ .product-list__summary
92
+ %p.product-list__media= link_to(image_tag('workarea/storefront/style_guide_product.jpg', alt: 'Product Name', class: 'product-list__media-image'), '#', class: 'product-list__media-link')
93
+ .product-list__info
94
+ %p.product-list__name= link_to('Product Name', '#')
95
+ %p.product-list__id 1234
96
+ .product-list__option-group
97
+ %p.product-list__option Color: Blue
98
+ %p.product-list__option Size: Small
99
+ = form_tag nil, class: 'product-list__item-cell' do
100
+ %table.table
101
+ %thead
102
+ %tr
103
+ %th.table__prices Price
104
+ %th.table__quantity Qty
105
+ %th.table__prices Total
106
+ %tbody
107
+ %tr
108
+ %td.table__prices
109
+ %p.table__price
110
+ = number_to_currency(90.00)
111
+ %td.table__quantity
112
+ %p.value= number_field_tag 'wl_table_cart_item_quantity', 1, min: 1, required: true, class: 'text-box text-box--x-small', data: { form_submitting_control: '' }, title: 'Quantity', id: nil
113
+ %td.table__prices
114
+ %p.table__price
115
+ = number_to_currency(90.00)
116
+ .grid.grid--auto.grid--middle
117
+ %p.grid__cell= button_tag 'Add to Shopping Bag', class: 'button'
118
+
119
+ %p Private wish list (plugin):
120
+
121
+ .style-guide__example-block
122
+ %ul.product-list
123
+ - 2.times do
124
+ %li.product-list__item
125
+ .product-list__item-cell
126
+ .product-list__summary
127
+ %p.product-list__media= link_to(image_tag('workarea/storefront/style_guide_product.jpg', alt: 'Product Name', class: 'product-list__media-image'), '#', class: 'product-list__media-link')
128
+ .product-list__info
129
+ %p.product-list__name= link_to('Product Name', '#')
130
+ %p.product-list__id 1234
131
+ .product-list__option-group
132
+ %p.product-list__option Color: Blue
133
+ %p.product-list__option Size: Small
134
+ .product-list__item-cell
135
+ %table.table
136
+ %thead
137
+ %tr
138
+ %th.product-list__prices Price
139
+ %th.product-list__quantity Qty
140
+ %th.product-list__prices Total
141
+ %tbody
142
+ %tr
143
+ %td.product-list__prices
144
+ %p.product-list__price
145
+ = number_to_currency(90.00)
146
+ %td.product-list__quantity
147
+ = form_tag nil, class: 'inline-form' do
148
+ .inline-form__cell
149
+ .value= number_field_tag 'wl_table_cart_item_quantity', 1, min: 1, required: true, class: 'text-box text-box--x-small', data: { form_submitting_control: '' }, title: 'Quantity', id: nil
150
+ %p.inline-form__cell.hidden-if-js-enabled= button_tag 'Update', value: 'change_quantity', class: 'button'
151
+ %td.product-list__prices
152
+ %p.product-list__price
153
+ = number_to_currency(90.00)
154
+ .grid.grid--auto.grid--middle
155
+ = form_tag nil, class: 'grid__cell' do
156
+ %p= button_tag 'Add to Shopping Bag', class: 'button'
157
+ = form_tag nil, class: 'grid__cell' do
158
+ %p= button_tag 'Remove', class: 'text-button'