Skip to content

Commit 82e42bd

Browse files
committed
feat: fallback on privacy and terms urls in organization config
1 parent fbe1b8a commit 82e42bd

5 files changed

Lines changed: 388 additions & 205 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,21 @@ In case the order balance is zero — e.g. the customer is paying with a gift ca
261261

262262
#### Privacy acceptance
263263

264-
If the `privacy_url` and `terms_url` attributes of the order are set an info paragraph will be displayed before the "Place order" button, including the related links and a checkbox to accept the terms. Customers won't be able to place the order unless they check it and agree.
264+
If the `privacy_url` and `terms_url` attributes of the order are set, an info paragraph will be displayed before the "Place order" button, including the related links and a checkbox to accept the terms. Customers won't be able to place the order unless they check it and agree.
265+
266+
As a fallback, if neither `privacy_url` nor `terms_url` is set on the order, the checkout will look for `urls.terms` and `urls.privacy` defined in the organization's MFE configuration (`config.mfe.default.urls`). This allows you to configure default terms and privacy URLs at the organization level without having to set them on every order.
267+
268+
Order-level URLs always take precedence over organization-level URLs when both are present.
269+
270+
URL placeholders are supported in the organization config values: `:lang` is replaced with the order's `language_code`, allowing locale-specific links (e.g. `https://example.com/:lang/terms` becomes `https://example.com/it/terms` for Italian orders).
265271

266272
### Order subscription
267273

268274
#### Recurring items
269275

270276
When a line item includes a frequency, placing the order [creates an order subscription](https://docs.commercelayer.io/core/v/how-tos/placing-orders/subscriptions/generating-the-subscriptions). To activate the subscription, the payment source must be saved in the customer's wallet. Therefore, during checkout with a customer token, the payment source is automatically saved. However, if a guest is checking out, they will receive an alert indicating that the subscription will not renew successfully without a saved payment source.
271277

272-
#### Target order
278+
#### Target order
273279

274280
If a customer's payment source has expired or been deleted, or if the order initiating the subscription was placed as a guest, the resulting target order will be `pending`. Upon placement, the payment source will be automatically saved in the customer's wallet, and the order subscription will be automatically updated with the new payment source.
275281

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,5 @@
132132
"iframe-resizer",
133133
"sharp"
134134
]
135-
},
136-
"resolutions": {
137-
"minimatch": ">=10.2.1",
138-
"ajv": ">=8.18.0"
139135
}
140136
}

0 commit comments

Comments
 (0)