Skip to content

Commit 8b948b4

Browse files
authored
packaged version 4.20.0 (#316)
Co-authored-by: Mykhailo Los <[email protected]>
1 parent 1dead0d commit 8b948b4

File tree

28 files changed

+329
-143
lines changed

28 files changed

+329
-143
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [4.20.0]
4+
5+
### Changed
6+
- Update the cart total when QTY is updated
7+
- 'Update total' button click, while shipping calculation, will update the total price
8+
9+
### Fixed
10+
- Fixed issue when webhooks option is enabled during onboarding process. Check if webhook already exists and return its id instead of trying to recreate it
11+
- Fixed error occurring while plugin activation. Problem was caused by handling the property on an empty object
12+
- Fixed bccustomervisibleterms value issue. Previously WP_Error could be set as transient value and cause issues on the storefront. Currently when error is occured empty value will be saved to transient
13+
- Fixed the inventory updates via webhook. The inventory level should be updated when it is changed on the BC side whether a product or variant tracking is enabled.
14+
- Fixed product images switch when the user selects the variant. The corresponding image of the variant will be displayed
15+
316
## [4.19.1]
417

518
### Changed
@@ -1641,6 +1654,7 @@
16411654
in fact, reset postdata, so far as Gutenberg 3.2.0 is concerned.
16421655

16431656

1657+
[4.20.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.19.1...4.20.0
16441658
[4.19.1]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.19.0...4.19.1
16451659
[4.19.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.18.0...4.19.0
16461660
[4.18.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.17.1...4.18.0

assets/css/cart-amp.css

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/cart-amp.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/master.css

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/master.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/scripts.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/scripts.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/src/public/cart/ajax-items.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,17 @@ const updatedCartTotals = (data = {}) => {
137137
tools.getNodes('bc-cart', true).forEach((cart) => {
138138
const baseAmount = cartData.subtotal.formatted;
139139
const subTotal = tools.getNodes('.bc-cart-subtotal__amount', false, cart, true)[0];
140-
const taxAmount = cartData.tax_amount.formatted;
141140
const taxTotal = tools.getNodes('.bc-cart-tax__amount', false, cart, true)[0];
141+
const cartTotal = tools.getNodes('.bc-cart-total__amount', false, cart, true)[0];
142142

143143
subTotal.textContent = baseAmount;
144144

145145
if (taxTotal) {
146-
taxTotal.textContent = taxAmount;
146+
taxTotal.textContent = cartData.tax_amount.formatted;
147+
}
148+
149+
if (cartTotal) {
150+
cartTotal.textContent = cartData.cart_amount.formatted;
147151
}
148152
});
149153
};

assets/js/src/public/cart/shipping-calculator.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,11 @@ const getMethods = (e) => {
221221
const updateShippingCosts = (shippingOption) => {
222222
const subtotal = shippingOption.dataset.cartSubtotal;
223223
const subtotalContainer = tools.getNodes('.bc-cart-subtotal__amount', false, document, true)[0];
224-
225224
subtotalContainer.innerText = subtotal;
225+
226+
const total = shippingOption.dataset.cartTotal;
227+
const totalContainer = tools.getNodes('.bc-cart-total__amount', false, document, true)[0];
228+
totalContainer.innerText = total;
226229
};
227230

228231
/**

assets/js/src/public/product/variants.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ const showVariantImage = (swiperInstance, swiperNavInstance) => {
197197
swiperInstance.appendSlide(slide);
198198
swiperInstance.update();
199199
swiperInstance.slideTo(swiperInstance.slides.length);
200-
swiperNavInstance.slideTo(0);
200+
201+
if (swiperNavInstance) {
202+
swiperNavInstance.slideTo(0);
203+
}
201204

202205
_.delay(() => {
203206
trigger({ event: 'bigcommerce/init_slide_zoom', data: { container: slide.querySelector('img') }, native: false });
@@ -224,7 +227,10 @@ const removeVariantImage = (swiperInstance, swiperNavInstance) => {
224227
});
225228

226229
swiperInstance.slideTo(0);
227-
swiperNavInstance.slideTo(0);
230+
231+
if (swiperNavInstance) {
232+
swiperNavInstance.slideTo(0);
233+
}
228234

229235
if (!slideIndex) {
230236
return;
@@ -256,11 +262,7 @@ const showHideVariantImage = (e, wrapper = '') => {
256262
const swiperWrapper = tools.getNodes('bc-gallery-container', false, currentWrapper)[0];
257263
const swiperInstance = swiperWrapper.swiper;
258264
const swiperNavWrapper = tools.getNodes(`[data-id="${swiperWrapper.dataset.controls}"]`, false, document, true)[0];
259-
// Check that the proper thumbnail slider present in the DOM before calling the swiper object.
260-
if (!swiperNavWrapper) {
261-
return;
262-
}
263-
const swiperNavInstance = swiperNavWrapper.swiper;
265+
const swiperNavInstance = swiperNavWrapper ? swiperNavWrapper.swiper : null;
264266

265267
// hide the image after each variant request.
266268
removeVariantImage(swiperInstance, swiperNavInstance);

0 commit comments

Comments
 (0)