By default, VTEX Sales App does not show the Cancel order
in the Order placed page when the selected payment method is Debit Direct sale or Credit Direct sale. It only shows the Cancel total order
button by default in these cases.
If you want to enable partial cancellation of orders — the ability to cancel individual packages — for these payment methods, you must edit the checkout-instore-custom.js
file as described below. Check out the How to customize VTEX Sales App guide for further information on how to access this file.
Prerequisites
To enable this functionality, make sure that you meet the following prerequisites:
- Having Debit Direct sale or Credit Direct sale configured as payment conditions, as described in the VTEX Sales App - Payments guide.
- Create the filters that define which payment methods will be displayed on VTEX Sales App, as described in the Define payment methods displayed on VTEX Sales App guide.
Edit the checkout-instore-custom.js
file
To enable partial cancellation for these payment methods, the payments
object within window.INSTORE_CONFIG
must contain the following property:
_12{_12 "data": {_12 "0-0": "`partialCancellationEnabled`",_12 "0-1": "array",_12 "0-2": "You should add payment conditions that will have partial cancellation enabled on inStore in this array",_12 "h-0": "Property",_12 "h-1": "Type",_12 "h-2": "Description"_12 },_12 "cols": 3,_12 "rows": 1_12}
The indication of each payment condition is made by the payment condition ID. Check the section on Where to find the payment condition ID in the Define payment methods displayed on VTEX Sales App guide for more details.
In the example code below, partial cancellation will be enabled for Debit Direct Sale (whose ID is 44
) and Credit Direct Sale (whose ID is 45
).
_10window.INSTORE_CONFIG = {_10 payments: {_10 partialCancellationEnabled: [_10 '44', // Debit Direct Sale_10 '45', // Credit Direct Sale_10 ],_10 }_10}