Skip to content

Commit 4e4906d

Browse files
sync behaviour for add to cart and increments buttons with alert message appearance
1 parent 678a7fe commit 4e4906d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

assets/js/theme/common/product-details-base.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function optionChangeDecorator(areDefaultOptionsSet) {
2424
if (areDefaultOptionsSet) {
2525
this.updateView(attributesData, attributesContent, true);
2626
} else {
27-
this.updateDefaultAttributesForOOS(attributesData);
27+
this.updateDefaultAttributesForOOS(attributesData, true);
2828
}
2929
};
3030
}
@@ -278,7 +278,7 @@ export default class ProductDetailsBase {
278278
viewModel.stock.$input.text(data.stock);
279279
}
280280

281-
this.updateDefaultAttributesForOOS(data);
281+
this.updateDefaultAttributesForOOS(data, shouldMessageAppear);
282282
this.updateWalletButtonsView(data);
283283

284284
// If Bulk Pricing rendered HTML is available
@@ -366,9 +366,9 @@ export default class ProductDetailsBase {
366366
}
367367
}
368368

369-
updateDefaultAttributesForOOS(data) {
369+
updateDefaultAttributesForOOS(data, shouldUpdateAttributes) {
370370
const viewModel = this.getViewModel(this.$scope);
371-
if (!data.purchasable || !data.instock) {
371+
if (shouldUpdateAttributes && (!data.purchasable || !data.instock)) {
372372
viewModel.$addToCart.prop('disabled', true);
373373
viewModel.$increments.prop('disabled', true);
374374
} else {

0 commit comments

Comments
 (0)