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

feat(storefront): BCTHEME-306 show price range on option selection #1924

Merged
merged 2 commits into from
Jan 5, 2021
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
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Added narrow down pricing during option selections [#1924](https://github.com/bigcommerce/cornerstone/pull/1924)
- Cornerstone - Image Zoom Does Not Work on Internet Explorer. [#1923](https://github.com/bigcommerce/cornerstone/pull/1923)
- Fixed input placeholder color contrast according to AA standard. [#1933](https://github.com/bigcommerce/cornerstone/pull/1933)

Expand Down
2 changes: 1 addition & 1 deletion assets/js/test-unit/theme/common/payment-method.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('PaymentMethod', () => {

it('should have valid input expiration date', () => {
const callback = jasmine.createSpy();
const validator = { add: ({ validate }) => validate(callback, '12/20') };
const validator = { add: ({ validate }) => validate(callback, '12/25') };
Validators.setExpirationValidation(validator, 'selector');

expect(callback).toHaveBeenCalledWith(true);
Expand Down
10 changes: 8 additions & 2 deletions assets/js/theme/common/product-details-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,19 @@ export default class ProductDetailsBase {
this.clearPricingNotFound(viewModel);

if (price.with_tax) {
const updatedPrice = price.price_range ?
`${price.price_range.min.with_tax.formatted} - ${price.price_range.max.with_tax.formatted}`
: price.with_tax.formatted;
viewModel.priceLabel.$span.show();
viewModel.$priceWithTax.html(price.with_tax.formatted);
viewModel.$priceWithTax.html(updatedPrice);
}

if (price.without_tax) {
const updatedPrice = price.price_range ?
`${price.price_range.min.without_tax.formatted} - ${price.price_range.max.without_tax.formatted}`
: price.without_tax.formatted;
viewModel.priceLabel.$span.show();
viewModel.$priceWithoutTax.html(price.without_tax.formatted);
viewModel.$priceWithoutTax.html(updatedPrice);
}

if (price.rrp_with_tax) {
Expand Down