Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STRF-2487 - Make display of quantity selection box on PDP configurable #1398

Merged
merged 1 commit into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added default rule for product carousel card title to break words on overflow. [#1389](https://github.com/bigcommerce/cornerstone/pull/1389)
- Only show cookie privacy notice for EU IP addresses [#1381](https://github.com/bigcommerce/cornerstone/pull/1381)
- Move Cart Quantity header value to a FE API call [#1379](https://github.com/bigcommerce/cornerstone/pull/1379)
- Make display of quantity selection box on PDP configurable. [#1398](https://github.com/bigcommerce/cornerstone/pull/1398)

## 2.6.0 (2018-11-05)
- Add support for Card Management: List, Delete, Edit, Add and Default Payment Method [#1376](https://github.com/bigcommerce/cornerstone/pull/1376)
Expand Down
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"brandpage_products_per_page": 12,
"searchpage_products_per_page": 12,
"show_product_quick_view": true,
"show_product_quantity_box": true,
"show_powered_by": true,
"shop_by_brand_show_footer": true,
"show_copyright_footer": true,
Expand Down
6 changes: 6 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,12 @@
"force_reload": true,
"id": "show_product_quick_view"
},
{
"type": "checkbox",
"label": "Show quantity selection on product pages",
"force_reload": true,
"id": "show_product_quantity_box"
},
{
"type": "checkbox",
"label": "Show product description tabs",
Expand Down
65 changes: 33 additions & 32 deletions templates/components/products/add-to-cart.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
<div class="form-field form-field--increments">
<label class="form-label form-label--alternate"
for="qty[]">{{lang 'products.quantity'}}</label>

<div class="form-increment" data-quantity-change>
<button class="button button--icon" data-action="dec">
<span class="is-srOnly">{{lang 'products.quantity_decrease'}}</span>
<i class="icon" aria-hidden="true">
<svg>
<use xlink:href="#icon-keyboard-arrow-down"/>
</svg>
</i>
</button>
<input class="form-input form-input--incrementTotal"
id="qty[]"
name="qty[]"
type="tel"
value="{{#if product.min_purchase_quantity}}{{product.min_purchase_quantity}}{{else}}1{{/if}}"
data-quantity-min="{{product.min_purchase_quantity}}"
data-quantity-max="{{product.max_purchase_quantity}}"
min="1"
pattern="[0-9]*"
aria-live="polite">
<button class="button button--icon" data-action="inc">
<span class="is-srOnly">{{lang 'products.quantity_increase'}}</span>
<i class="icon" aria-hidden="true">
<svg>
<use xlink:href="#icon-keyboard-arrow-up"/>
</svg>
</i>
</button>
{{#if theme_settings.show_product_quantity_box}}
<div class="form-field form-field--increments">
<label class="form-label form-label--alternate"
for="qty[]">{{lang 'products.quantity'}}</label>
<div class="form-increment" data-quantity-change>
<button class="button button--icon" data-action="dec">
<span class="is-srOnly">{{lang 'products.quantity_decrease'}}</span>
<i class="icon" aria-hidden="true">
<svg>
<use xlink:href="#icon-keyboard-arrow-down"/>
</svg>
</i>
</button>
<input class="form-input form-input--incrementTotal"
id="qty[]"
name="qty[]"
type="tel"
value="{{#if product.min_purchase_quantity}}{{product.min_purchase_quantity}}{{else}}1{{/if}}"
data-quantity-min="{{product.min_purchase_quantity}}"
data-quantity-max="{{product.max_purchase_quantity}}"
min="1"
pattern="[0-9]*"
aria-live="polite">
<button class="button button--icon" data-action="inc">
<span class="is-srOnly">{{lang 'products.quantity_increase'}}</span>
<i class="icon" aria-hidden="true">
<svg>
<use xlink:href="#icon-keyboard-arrow-up"/>
</svg>
</i>
</button>
</div>
</div>
</div>
{{/if}}

<div class="alertBox productAttributes-message" style="display:none">
<div class="alertBox-column alertBox-icon">
Expand Down