Skip to content

Commit

Permalink
Merge pull request #1063 from junedkazi/STENCIL-3383-list-view
Browse files Browse the repository at this point in the history
STENCIL-3383 STENCIL-3353 Do not show add to cart on disabled products, add pre-order button & update pre-order url to add product to cart, fix login for pricing on product cards.
  • Loading branch information
junedkazi authored Aug 14, 2017
2 parents b819868 + f55b397 commit 4cb9784
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Change the 403 page message to be more friendly [#1057](https://github.com/bigcommerce/cornerstone/pull/1057) & [#1059](https://github.com/bigcommerce/cornerstone/pull/1059)
- Add bulk discount rates to product cards [#1058](https://github.com/bigcommerce/cornerstone/pull/1058)
- Add higher z-index to display text over burst image [#1066](https://github.com/bigcommerce/cornerstone/pull/1066)
- Do not show add to cart on disabled products, add pre-order button, update pre-order url to add product to cart & fix login for pricing on product cards. [#1063](https://github.com/bigcommerce/cornerstone/pull/1063)

## 1.9.1 (2017-07-25)
- Move some hard-coded validation messages to language file [#1040](https://github.com/bigcommerce/cornerstone/pull/1040)
Expand Down
1 change: 1 addition & 0 deletions assets/scss/layouts/products/_productList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

.productList {
@include u-listBullets("none");
margin: spacing("half");

.product {
// scss-lint:disable NestingDepth
Expand Down
2 changes: 1 addition & 1 deletion templates/components/products/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<a href="{{url}}" class="button button--small card-figcaption-button" data-product-id="{{id}}">{{lang 'products.choose_options'}}</a>
{{/if}}
{{#if pre_order}}
<a href="{{url}}" class="button button--small card-figcaption-button">{{lang 'products.pre_order'}}</a>
<a href="{{pre_order_add_to_cart_url}}" class="button button--small card-figcaption-button">{{lang 'products.pre_order'}}</a>
{{/if}}
{{#if add_to_cart_url }}
<a href="{{add_to_cart_url}}" class="button button--small card-figcaption-button">{{lang 'products.add_to_cart'}}</a>
Expand Down
29 changes: 18 additions & 11 deletions templates/components/products/list-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,27 @@ <h4 class="listItem-title">
{{/if}}
</div>
<div class="listItem-actions">
{{#if price}}
<div class="listItem-price">{{> components/products/price price=price}}</div>
{{/if}}
{{#unless hide_add_to_cart}}
{{#if has_options}}
<a href="{{url}}" class="button button--primary" data-product-id="{{id}}">{{lang "products.choose_options"}}</a>
{{else}}
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
{{#if price}}
<div class="listItem-price">{{> components/products/price price=price}}</div>
{{/if}}
{{#if show_cart_action}}
{{#if has_options}}
<a href="{{url}}" class="button button--small" data-product-id="{{id}}">{{lang 'products.choose_options'}}</a>
{{/if}}
{{#if pre_order}}
<a href="{{pre_order_add_to_cart_url}}" class="button button--primary">{{lang 'products.pre_order'}}</a>
{{/if}}
{{#if add_to_cart_url }}
<a href="{{add_to_cart_url}}" class="button button--primary">{{lang 'products.add_to_cart'}}</a>
{{/if}}
{{#if out_of_stock_message }}
<span href="{{url}}" class="button button--primary">{{out_of_stock_message}}</span>
{{else}}
<a href="{{add_to_cart_url}}" class="button button--primary">{{lang "products.add_to_cart"}}</a>
<a href="{{url}}" class="button button--small" data-product-id="{{id}}">{{out_of_stock_message}}</a>
{{/if}}
{{/if}}
{{/unless}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
{{#if show_compare}}
<label class="button button--small" for="compare-{{id}}">
{{lang "products.compare"}} <input type="checkbox" name="products[]" value="{{id}}" id="compare-{{id}}" data-compare-id="{{id}}">
Expand Down
2 changes: 1 addition & 1 deletion templates/components/products/list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul class="productList">
{{#each products}}
<li class="product">
{{>components/products/list-item show_compare=../show_compare show_rating=../settings.show_product_rating theme_settings=../theme_settings}}
{{>components/products/list-item show_compare=../show_compare show_rating=../settings.show_product_rating theme_settings=../theme_settings customer=../customer}}
</li>
{{/each}}
</ul>

0 comments on commit 4cb9784

Please sign in to comment.