Documentation
Feedback
Guides
API Reference

Guides
VTEX Sales App
How to customize VTEX Sales AppEnable partial cancellation for Debit or Credit Direct sales
Enable partial cancellation for Debit or Credit Direct sales

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:

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).


_10
window.INSTORE_CONFIG = {
_10
payments: {
_10
partialCancellationEnabled: [
_10
'44', // Debit Direct Sale
_10
'45', // Credit Direct Sale
_10
],
_10
}
_10
}

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page