@ordergroove/offers 2.36.0 → 2.36.1-alpha-PR-834-3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.36.
|
|
3
|
+
"version": "2.36.1-alpha-PR-834-3.10+62a84189",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@ordergroove/offers-templates": "^0.9.6",
|
|
49
49
|
"@types/lodash.memoize": "^4.1.9"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "62a841892ab3c4e0357e8a5d3a11d9471cacb5ef"
|
|
52
52
|
}
|
package/src/components/Offer.js
CHANGED
|
@@ -319,23 +319,23 @@ export class Offer extends TemplateElement {
|
|
|
319
319
|
return this.preview || window.og.previewMode;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
get
|
|
322
|
+
get shouldEnableOffer() {
|
|
323
323
|
// currently, only the shopify reducer populates storeCurrency
|
|
324
324
|
if (this.config && this.config.storeCurrency && this.config.merchantSettings) {
|
|
325
|
-
const
|
|
325
|
+
const shouldEnable =
|
|
326
326
|
this.config.merchantSettings.multicurrency_enabled ||
|
|
327
327
|
this.config.storeCurrency === this.config.merchantSettings.currency_code;
|
|
328
|
-
if (!
|
|
328
|
+
if (!shouldEnable) {
|
|
329
329
|
logMulticurrencyWarning(this.config.storeCurrency, this.config.merchantSettings.currency_code);
|
|
330
330
|
}
|
|
331
|
-
return
|
|
331
|
+
return shouldEnable;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
return true;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
render() {
|
|
338
|
-
return this.
|
|
338
|
+
return this.shouldEnableOffer
|
|
339
339
|
? html`
|
|
340
340
|
<slot></slot>
|
|
341
341
|
`
|
|
@@ -346,6 +346,7 @@ export function getSubscribedFrequency(productId, store) {
|
|
|
346
346
|
*/
|
|
347
347
|
function synchronizeSellingPlan(store: any, offerElement?: HTMLElement) {
|
|
348
348
|
if (offerElement.isCart) return; // hidden inputs are used when product page, not cart.
|
|
349
|
+
if (!offerElement.shouldEnableOffer) return; // do not set a selling plan if we're hiding the offer
|
|
349
350
|
|
|
350
351
|
[...document.querySelectorAll('form[action$="/cart/add"] [name=id]')].forEach((productIdInput: HTMLInputElement) => {
|
|
351
352
|
const productId = productIdInput.value;
|