Skip to content

Commit 6cb11e9

Browse files
Merge branch 'master' into BCTHEME-982
2 parents b26e76c + b0d896c commit 6cb11e9

27 files changed

+16
-456
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Draft
88
- Search results containing % symbol result in errored page. [#2205](https://github.com/bigcommerce/cornerstone/issues/2205)
9+
- Remove translations for adminBar component [#2196](https://github.com/bigcommerce/cornerstone/issues/2196)
10+
- Remove adminBar. [#2191](https://github.com/bigcommerce/cornerstone/issues/2191)
11+
- When price list price is set for currency, the cart does not respect product's price.[#2190](https://github.com/bigcommerce/cornerstone/issues/2190)
912

1013
## 6.3.0 (03-11-2022)
1114
- Update blog component to use H1 tags on posts [#2179](https://github.com/bigcommerce/cornerstone/issues/2179)

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

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import forms from '../common/models/forms';
1111
import { normalizeFormData } from './utils/api';
1212
import { isBrowserIE, convertIntoArray } from './utils/ie-helpers';
1313
import bannerUtils from './utils/banner-utils';
14+
import currencySelector from '../global/currency-selector';
1415

1516
export default class ProductDetails extends ProductDetailsBase {
1617
constructor($scope, context, productAttributesData = {}) {
@@ -399,6 +400,7 @@ export default class ProductDetails extends ProductDetailsBase {
399400

400401
// Add item to cart
401402
utils.api.cart.itemAdd(normalizeFormData(new FormData(form)), (err, response) => {
403+
currencySelector(response.data.cart_id);
402404
const errorMessage = err || response.data.error;
403405

404406
$addToCartBtn

assets/js/theme/global.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ import foundation from './global/foundation';
1111
import quickView from './global/quick-view';
1212
import cartPreview from './global/cart-preview';
1313
import privacyCookieNotification from './global/cookieNotification';
14-
import adminBar from './global/adminBar';
1514
import carousel from './common/carousel';
1615
import loadingProgressBar from './global/loading-progress-bar';
1716
import svgInjector from './global/svg-injector';
1817

1918
export default class Global extends PageManager {
2019
onReady() {
21-
const {
22-
channelId, cartId, productId, categoryId, secureBaseUrl, maintenanceModeSettings, adminBarLanguage,
23-
} = this.context;
20+
const { cartId, secureBaseUrl } = this.context;
2421
cartPreview(secureBaseUrl, cartId);
2522
quickSearch();
2623
currencySelector(cartId);
@@ -30,7 +27,6 @@ export default class Global extends PageManager {
3027
menu();
3128
mobileMenuToggle();
3229
privacyCookieNotification();
33-
adminBar(secureBaseUrl, channelId, maintenanceModeSettings, JSON.parse(adminBarLanguage), productId, categoryId);
3430
loadingProgressBar();
3531
svgInjector();
3632
}

assets/js/theme/global/adminBar.js

-104
This file was deleted.

assets/js/theme/global/currency-selector.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import swal from './sweet-alert';
22
import utils from '@bigcommerce/stencil-utils';
33

4+
let currencySelectorCalled = false;
5+
46
export default function (cartId) {
7+
if (!cartId) return;
8+
9+
if (!currencySelectorCalled) {
10+
currencySelectorCalled = true;
11+
} else {
12+
return;
13+
}
14+
515
function changeCurrency(url, currencyCode) {
616
$.ajax({
717
url,
@@ -21,9 +31,6 @@ export default function (cartId) {
2131

2232
$('[data-cart-currency-switch-url]').on('click', event => {
2333
const currencySessionSwitcher = event.target.href;
24-
if (!cartId) {
25-
return;
26-
}
2734
event.preventDefault();
2835
utils.api.cart.getCart({ cartId }, (err, response) => {
2936
if (err || response === undefined) {

assets/scss/components/_components.scss

-3
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@
162162
// Preview Cart
163163
@import "stencil/previewCart/component";
164164

165-
// Maintenance Notice
166-
@import "stencil/adminBar/component";
167-
168165
// Cookie Warning
169166
@import "stencil/cookie/component";
170167

0 commit comments

Comments
 (0)