Magento Expert Forum - Improve your Magento experience
-
How to cancel order Programmatically without disabling URL security key in Magento 2?
Whenever the admin tries to cancel an order from the controller using order ID, it is required to disable the URL security key from Magento 2 admin configuration. Thereby, I am here with the code to cancel order programmatically without disabling URL security key in Magento 2. Let’s get started 🚀
Steps to cancel order Programmatically without disabling URL security key in Magento 2:
Step 1: Navigate to the following path:
app/code/VENDOR/EXTENSION/Controller/Adminhtml/Order/Cancel.php
And add the below code:
Step 2: Now, move to the following path:
app/code/VENDOR/EXTENSION/view/adminhtml/ui_component/sales_order_grid.xml
for more details: https://magecomp.com/blog/cancel-ord...key-magento-2/
View more threads in the same category:
-
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks