Cart Configuration
This reference explains the main Cart configuration options.
Available options
The Cart public configuration has the following options:
couponCode
: configuration options for coupon code behaviordisableRemove
: when set totrue
, prevents users from removing applied coupon codes from the cart. When set tofalse
(default), users can both apply and remove coupon codes.
Examples
disableRemove: false
(default)
When disableRemove
is set to false
or not configured, users can both apply
and remove coupon codes from their cart.
Behavior:
- Shows a form with input field for entering coupon codes
- Displays "Apply Discount" button when no coupon is applied
- Shows "Remove Discount" button when a coupon is already applied
- Users can remove applied coupon codes
disableRemove: true
When disableRemove
is set to true
, users can apply coupon codes but cannot
remove them once applied.
Behavior:
- Shows a form with input field for entering coupon codes (when no coupon is applied)
- Displays "Apply Discount" button when no coupon is applied
- Shows only a success message when a coupon is applied (no remove functionality)
- Users cannot remove applied coupon codes
Configuration Example
my-extension/config/cart.ts
import type { ConfigProvider } from "@front-commerce/core/config";
const cartConfig = {
name: "my-extension:cart-config",
values: {
public: {
theme: {
cart: {
couponCode: {
disableRemove: false,
},
},
},
},
},
} satisfies ConfigProvider;
export default cartConfig;