@ordergroove/offers 2.35.8-alpha-PR-831-1.26 → 2.36.0

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.35.8-alpha-PR-831-1.26+837c516f",
3
+ "version": "2.36.0",
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": "837c516f9418cb8720c90fd955373945bea4d5f2"
51
+ "gitHead": "3d4c898b8dffb8c106a36e1f3eaa9c7291e70702"
52
52
  }
@@ -33,7 +33,7 @@ function logMulticurrencyWarning(storeCurrency, primaryCurrency) {
33
33
  // only log once
34
34
  if (!hasLogged) {
35
35
  console.warn(
36
- `Hiding Ordergroove offer since the store currency ${storeCurrency} does not match your configured currency ${primaryCurrency} and you are not setup for multicurrency. Contact your Ordergroove rep for next steps.`
36
+ `Hiding Ordergroove offer since the store currency ${storeCurrency} does not match your configured currency ${primaryCurrency} and you are not set up for multicurrency. Contact your Ordergroove representative for next steps.`
37
37
  );
38
38
  hasLogged = true;
39
39
  }
@@ -320,6 +320,7 @@ export class Offer extends TemplateElement {
320
320
  }
321
321
 
322
322
  get shouldRenderOffer() {
323
+ // currently, only the shopify reducer populates storeCurrency
323
324
  if (this.config && this.config.storeCurrency && this.config.merchantSettings) {
324
325
  const shouldRender =
325
326
  this.config.merchantSettings.multicurrency_enabled ||
@@ -313,6 +313,9 @@ export const setProductToSubscribe = (product, productToSubscribe) => ({
313
313
  payload: { product, productToSubscribe }
314
314
  });
315
315
 
316
+ /**
317
+ * @param {import('../types').MerchantSettings} settings
318
+ */
316
319
  export const receiveMerchantSettings = settings => ({
317
320
  type: constants.RECEIVE_MERCHANT_SETTINGS,
318
321
  payload: settings
package/src/make-api.js CHANGED
@@ -166,6 +166,7 @@ export default function makeApi(store) {
166
166
  * @param {*} merchantId
167
167
  * @param {*} env
168
168
  * @param {*} authUrl
169
+ * @param {import('./types').MerchantSettings} merchantSettings
169
170
  */
170
171
  initialize(merchantId, env, authUrl, merchantSettings) {
171
172
  // settings resolves once, before anything.
package/src/types.ts ADDED
@@ -0,0 +1,4 @@
1
+ export interface MerchantSettings {
2
+ currency_code: string;
3
+ multicurrency_enabled: boolean;
4
+ }