diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index 6fb4b58ea7..7b5b4e3d05 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -2,6 +2,7 @@ import { createTag, getConfig, loadArea, loadScript, loadStyle, localizeLink, } from '../../utils/utils.js'; import { replaceKey } from '../../features/placeholders.js'; +import * as commerceLib from '../../deps/mas/commerce.js'; export const CHECKOUT_LINK_CONFIG_PATH = '/commerce/checkout-link.json'; // relative to libs. @@ -422,15 +423,6 @@ export async function initService(force = false) { } const { env, commerce = {}, locale } = getConfig(); initService.promise = initService.promise ?? polyfills().then(async () => { - const { hostname, searchParams } = new URL(window.location.href); - let commerceLibPath = '../../deps/mas/commerce.js'; - if (/hlx\.(page|live)$|localhost$|www\.stage\.adobe\.com$/.test(hostname)) { - const maslibs = searchParams.get('maslibs'); - if (maslibs) { - commerceLibPath = `${getMasBase(hostname, maslibs)}/libs/commerce.js`; - } - } - const commerceLib = await import(commerceLibPath); const service = await commerceLib.init(() => ({ env, commerce, diff --git a/test/blocks/merch/merch.test.js b/test/blocks/merch/merch.test.js index cee0f412cc..10d84111a5 100644 --- a/test/blocks/merch/merch.test.js +++ b/test/blocks/merch/merch.test.js @@ -798,16 +798,6 @@ describe('Merch Block', () => { updateSearch({}); }); - it('should load commerce.js via maslibs', async () => { - initService.promise = undefined; - getMasBase.baseUrl = 'http://localhost:2000/test/blocks/merch/mas'; - updateSearch({ maslibs: 'test' }); - setConfig(config); - await mockIms(); - const commerce = await initService(true); - expect(commerce.mock).to.be.true; - }); - it('should return the default Adobe URL if no maslibs parameter is present', () => { expect(getMasBase()).to.equal('https://www.adobe.com/mas'); });