# Configuration

Once you have successfully installed the extension, go to **Stores -> Configuration -> MageComp -> Cancel Order** to configure the extension for use.

#### General Settings

<figure><img src="/files/KCrlkSCiWvK1a4P1f56C" alt=""><figcaption></figcaption></figure>

* **Cancel Order -** Enable or disable the extension from here.
* **Customer Groups -** Select the customer groups for whom you want to enable the order and item cancellation pop-up.
* **Order Statuses -** Enable order and item cancellation ability based on order status.
* **Cancel Order Valid Till (Days) -** Enter the number of days for which the order and item cancellation functionality can be used.

#### Cancel Order Popup Settings

<figure><img src="/files/NzWUJhclChdq20V9fneW" alt=""><figcaption></figcaption></figure>

* **Cancellation Popup -** Enable frontend cancellation popup from here.
* **Cancel Order Title -** From here, you can set the frontend order cancellation popup title that you want to display.
* **Cancel Item Title -** From here, you can set the frontend item cancellation popup title that you want to display.
* **Order Cancellation Reasons -** The extension comes with the option to add multiple order and item cancellation reasons to display in the store frontend popup as a dropdown.
* **Cancellation Popup Note -** Enter confirmation message for successful cancel request submission.

#### Cancel Order Approval Settings

<figure><img src="/files/qWar66maxUdT2yYzWmgu" alt=""><figcaption></figcaption></figure>

* **Admin Approval Required -** Set auto cancellation or manual approval for the cancellation request by the customer.
* **Order Rejection Reasons -** Add multiple order and item cancellation rejection reasons to display in the admin approval option as a dropdown.
* **Cancellation Pending Message -** Set message shown to customer when a cancellation request is pending from the admin for approval.
* **Cancellation Approved Message -** Set message shown to customer when a cancellation request is approved by the admin.
* **Cancellation Rejected Message -** Set message shown to customer when a cancellation request is rejected by the admin.

#### Auto Cancel Order Settings

The extension also supports auto-cancellation of orders based on certain conditions.

<figure><img src="/files/GpzYzWlwfnWB57I0uzhI" alt=""><figcaption></figcaption></figure>

* **Auto Cancel Order -** Enable automatic cancellation of orders.
* **Auto Order Statuses -** Select the order status to enable auto-cancellation of orders.
* **Payment and Duration -** Set payment methods and duration to enable auto-cancellation of orders.
* **Auto Cancel Start Date -** Set date and time to enable auto cancellation of orders.

#### Email Configuration Settings

<figure><img src="/files/1hkSiFWehLtxKMiuA6qa" alt=""><figcaption></figcaption></figure>

* **Send Emails to -** Enter the admin email ID to which you want to receive an order and item cancellation email.
* **Email Sender -** Select the Email sender using which you want to send the order and item cancellation email.
* **Email Template for Customer (Pending) -** Select the Email template that you want to use for sending the order and item cancellation approval pending email to the customer.
* **Email Template for Customer (Approved) -** Select the Email template that you want to use for sending the order and item cancellation approved email to the customer.
* **Email Template for Customer (Rejected) -** Select the Email template that you want to use for sending the order and item cancellation rejected email to the customer.
* **Email Template for Admin (New Request) -** Select the Email template you want to use for sending a new order and item cancellation request email to the admin.
* **Email Template for Customer (Auto Approved) -** Select the Email template that you want to use for sending the order and item cancellation automatically approved email to the customer.
* **Email Template for Admin (Auto Approved) -** Select the Email template that you want to use for sending the order and item cancellation automatically approved email to the admin.

#### SMS Gateway Settings

**MSG91 Configuration**

<figure><img src="/files/pRwIuHRfqlCrTyyQae50" alt=""><figcaption></figcaption></figure>

* **Cancel Order SMS Notification -** Enable it to send order and item cancellation notifications to customers via SMS.&#x20;
* **SMS Gateway -** Select the Msg91 SMS Gateway from the dropdown.
* **Msg91 Sender ID -** Enter the sender ID or Name provided by Msg91.
* **Msg91 Authentication Key -** Enter the authentication key of MSG91.
* **Send Message API -** Select the API for sending messages as a DLT Template or a Campaign Template.
* **Route -** Select the route from the dropdown, whether you need to send it as promotional or transactional.
* **API URL -** Enter API URL for Msg91.
* **DLT Dev Mode -** Admin can activate the DLT dev mode from here.

**Twilio Configuration**

<figure><img src="/files/jwtSP97sQqvW6GuZHdWa" alt=""><figcaption></figcaption></figure>

* **Cancel Order SMS Notification -** Enable it to send order and item cancellation notifications to customers via SMS.&#x20;
* **SMS Gateway -** Select the Twilio SMS Gateway from the dropdown.
* **NOTE:** To use Twilio SMS Gateway, you need to run the ‘**composer require twilio/sdk‘** command in the terminal.
* **Twilio Account SID -** You need to enter the Account SID from Twilio.
* **Twilio Auth Token -** Enter the Auth Token from Twilio.
* **Twilio Mobile Number -** Enter the mobile number that you have purchased from Twilio.

#### WhatsApp Configuration Settings

<figure><img src="/files/hRGEoWmYjst9TYYw6zIN" alt=""><figcaption></figcaption></figure>

* **WhatsApp Configuration -** Enable it to send order and item cancellation notifications to customers via WhatsApp.&#x20;
* **WhatsApp Gateway -** Select WhatsApp API as the gateway.
* **Client ID -** Add the client ID of WhatsApp API.
* **Instance ID -** Add the instance ID of WhatsApp API.
* **API URL -** Enter the API URL for WhatsApp API.

#### Country Flag Settings

<figure><img src="/files/aeNNfbVJOUnvkuUcBcbo" alt=""><figcaption></figcaption></figure>

* **Country Flag -** Enable country flag for mobile number from here.
* **Country Digit -** Add the country and allowed digits for validation. Admin can add countries according to the requirement and delete them easily.

#### Cancel Order Notification Templates

<figure><img src="/files/hfHQG1K00bhjn7L1GEfx" alt=""><figcaption></figcaption></figure>

* **Notification -** Enable SMS/WhatsApp notifications for order and item cancellation from here.
* **Notification Type -** Select the type of notification from here.
* **Order Auto Cancel Success Text -** Set custom text using variables for sending an order automatically cancelled notification to the customer.
* **Order Cancel Pending Text -** Set custom text using variables for sending an order cancellation pending approval notification to the customer.
* **Order Cancel Approved Text -** Set custom text using variables for sending an order cancellation approved notification to the customer.

<figure><img src="/files/zksu7JtSJN0s2q5pFF7z" alt=""><figcaption></figcaption></figure>

* **Order Cancel Rejected Text -** Set custom text using variables for sending an order cancellation rejected notification to the customer.
* **Item Auto Cancel Success Text -** Set custom text using variables for sending an item automatically cancelled notification to the customer.
* **Item Cancel Pending Text -** Set custom text using variables for sending an item cancellation pending approval notification to the customer.
* **Item Cancel Approved Text -** Set custom text using variables for sending an item cancellation approved notification to the customer.

<figure><img src="/files/phmYTkrrgAHvJRfM1UPg" alt=""><figcaption></figcaption></figure>

* **Item Cancel Rejected Text -** Set custom text using variables for sending an item cancellation rejected notification to the customer.
* **DLT Template ID -** Enter DLT Template ID. This is only for Msg91 SMS API users.
* **Campaign Name -** Enter Campaign Name. This is only for Msg91 SMS API users.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.magecomp.com/magento-2-cancel-order-by-customer-extension/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
