commercelayer-react-checkout icon indicating copy to clipboard operation
commercelayer-react-checkout copied to clipboard

Add settings to allow further customization

Open malessani opened this issue 2 years ago • 1 comments

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.

  • [x] Add custom thankyou page URL
  • [ ] Set email and phone support, logo, favicon, primary color, GTM id
  • [ ] Privacy and terms url
  • [ ] Override order language
  • [x] Set list of billing and shipping countries / states
  • [x] Preselect default country
  • [ ] Enable/disable state/province selector for countries without states
  • [ ] State field optional
  • [x] Guest checkout for order with subscription (alert for customer)
  • [x] Set automatically save customer payment source for order with subscription
  • [ ] Override label translations (passing keys or path to files) (only checkout dev)
  • [ ] Enable/Disable payment methods based on custom rules (needs components support)
  • [ ] Sort payment methods on the payment step
  • [ ] Enable/Disable login
  • [ ] Switch columns between summary and form
  • [ ] Enable/Disable unit price on the order summary
  • [ ] Enhanced configuration for GTM (client and server side)
  • [ ] MFE URLs for forked applications
  • [ ] Add external validation config to avoid placing orders
  • [ ] ~~Add copy and custom text in the thank you page~~ Redirect to thank you page
  • [ ] ~~Add metadata to order~~

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

malessani avatar May 23 '22 13:05 malessani

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"
      }
    }
  }
}

clgiovannelli avatar Jan 12 '24 12:01 clgiovannelli