- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
I would like to create custom state as Dispatch and status as Dispatched. Please anyone can help ASAP.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try it with directly adding from Database:
Modify below 2 tables:
sales_order_status
sales_order_status_state
First add in this table "sales_order_status" > Status = dispatched and label = Dispatch
Now add in this table "sales_order_status_state" > status = dispatched, state = dispatched
It will work for you.
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Sharing here few articles to follow:
https://www.mageplaza.com/kb/how-to-create-custom-order-status-magento-2.html
https://magecomp.com/blog/create-custom-order-status-state-programmatically-magento-2/
Hope this will help you.
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Hi @tippanna_pawar
You can follow the magneto documentation to create new order status and assign the order state to it.
https://docs.magento.com/user-guide/sales/order-status-custom.html
I hope it will help you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Thank for Suggetion. But still my issue not resolved. I have created Status as Dispatch but i want to create new state for that. I am unable to create new state
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Thank you for suggestion. I have created module as per the post but throwing database error on magento module Upgrade.
This is the below error
Installing data... SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`dnour`.`sales_order_status_state`, CONSTRAINT `SALES_ORDER_STATUS_STATE_STATUS_SALES_ORDER_STATUS_STATUS` FOREIGN KEY (`status`) REFERENCES `sales_order_status` (`status`) ON DELETE CASCADE), query was: INSERT INTO `sales_order_status_state` (`status`,`state`,`is_default`,`visible_on_front`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE `status` = VALUES(`status`), `state` = VALUES(`state`), `is_default` = VALUES(`is_default`), `visible_on_front` = VALUES(`visible_on_front`)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Hi @tippanna_pawar
Try the below stack solution,
https://magento.stackexchange.com/a/229948
Might be it will help you for order state.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
are you still recommending to use installData? as this is deprecated in my knowledge.
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try it with directly adding from Database:
Modify below 2 tables:
sales_order_status
sales_order_status_state
First add in this table "sales_order_status" > Status = dispatched and label = Dispatch
Now add in this table "sales_order_status_state" > status = dispatched, state = dispatched
It will work for you.
https://www.manishmittal.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Thank you brother. Your suggetion worked for me. Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Create custom State and status magento 2
Definitely allow me sometime, I will provide you that too.
https://www.manishmittal.com/