diff --git a/core/components/commerce_splitit/docs/changelog.txt b/core/components/commerce_splitit/docs/changelog.txt index 5fdcdec..ff362f3 100644 --- a/core/components/commerce_splitit/docs/changelog.txt +++ b/core/components/commerce_splitit/docs/changelog.txt @@ -1,3 +1,11 @@ +Splitit for Commerce 2.2.0-pl +--------------------------------- +Released on TBD + +- Automatically detect Commerce's AcceptTerms module and gate the Splitit widget until terms are accepted +- Show a notice message when Splitit is selected but terms have not been accepted yet +- Show a user-friendly error instead of a JS exception when Splitit API authentication fails + Splitit for Commerce 2.1.0-pl --------------------------------- Released on 25-01-2024 diff --git a/core/components/commerce_splitit/lexicon/en/default.inc.php b/core/components/commerce_splitit/lexicon/en/default.inc.php index 43d733c..148163b 100644 --- a/core/components/commerce_splitit/lexicon/en/default.inc.php +++ b/core/components/commerce_splitit/lexicon/en/default.inc.php @@ -16,6 +16,9 @@ $_lang['setting_commerce_splitit.locale'] = 'Splitit Locale'; $_lang['setting_commerce_splitit.locale_desc'] = 'Set a locale for Splitit to use. e.g. en-US or fr-FR. If no value is found, the core locale system setting will be used instead. Default is en-US. If you have more than one language, add this setting to each of your contexts with a different value in each.'; +$_lang['commerce_splitit.accept_terms_first'] = 'Please accept the terms and conditions before paying with Splitit.'; +$_lang['commerce_splitit.gateway_error'] = 'The Splitit payment method is temporarily unavailable. Please choose a different payment method or try again later.'; + // Transaction lexicons $_lang['commerce.payment_verified'] = 'Payment Verified'; $_lang['commerce.is_paid'] = 'Is Paid'; diff --git a/core/components/commerce_splitit/templates/frontend/gateways/splitit.twig b/core/components/commerce_splitit/templates/frontend/gateways/splitit.twig index 36f2721..01d66b7 100644 --- a/core/components/commerce_splitit/templates/frontend/gateways/splitit.twig +++ b/core/components/commerce_splitit/templates/frontend/gateways/splitit.twig @@ -2,8 +2,30 @@ #splitit-container .spt-btn { /*display: none;*/ } + #splitit-terms-notice { + display: none; + padding: 0.75rem 1rem; + margin-bottom: 0.75rem; + background: #fff8e1; + border: 1px solid #f0c040; + border-radius: 4px; + color: #555; + } + #splitit-error { + padding: 0.75rem 1rem; + margin-bottom: 0.75rem; + background: #fdecea; + border: 1px solid #f5c6cb; + border-radius: 4px; + color: #721c24; + } +
+{% if ipn %}
+{% else %} +
{{ lex("commerce_splitit.gateway_error") }}
+{% endif %}