commercelayer / mfe-checkout

Commerce Layer Hosted Checkout
https://commercelayer.io
MIT License
41 stars 46 forks source link

Add settings to allow further customization #253

Open malessani opened 2 years ago

malessani commented 2 years ago

Description

This Feature will allow to set or override settings received from order and organization endpoint to allow an improved level of customization. Configuration can also be linked to a market.

Each item needs to be assessed in terms of benefits/feasibility.

clgiovannelli commented 7 months ago

Something like this @malessani @mscardellato ?

{
  "checkout": {
    "support": {
      "email": true,
      "phone": true
    },
    "branding": {
      "logo": "path/to/logo.png",
      "favicon": "path/to/favicon.ico",
      "primaryColor": "#hexcolor"
    },
    "tracking": {
      "gtmId": "GTM-XXXXXX"
    },
    "legal": {
      "privacyUrl": "https://example.com/privacy",
      "termsUrl": "https://example.com/terms"
    },
    "orderSettings": {
      "overrideLanguage": "language_code",
      "billingCountries": [
        "US",
        "GB",
        "FR"
      ],
      "shippingCountries": [
        "US",
        "GB",
        "FR"
      ],
      "defaultCountry": "US",
      "guestCheckoutForSubscription": {
        "enabled": true,
        "alertCustomer": true
      },
      "savePaymentSourceForSubscription": true
    },
    "translation": {
      "overrideLabelTranslations": {
        "filesPath": "path/to/translation/files"
      }
    },
    "payment": {
      "enableCustomPaymentRules": true,
      "enabledMethods": [
        "credit_card",
        "paypal"
      ],
      "disabledMethods": [
        "bitcoin"
      ]
    },
    "userInterface": {
      "enableLogin": true,
      "layout": {
        "switchColumns": true
      },
      "thankYouPage": {
        "customText": "Your custom message here.",
        "redirectUrl": "https://example.com/thank-you"
      }
    }
  }
}