cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic order status to "Complete" for Digital Downloadable Products

Automatic order status to "Complete" for Digital Downloadable Products

By default in Magento 2.4.x there is a default necessity to manually set order status to Completed in admin tools, including Digital Products. Customer will not be able to download digital product until order status is Completed

 

Do we have a possibility for Digital Downloadable Products to have in case of successful transaction automatic Completed status for order without any manual activity in admin tools?

 

Thanks in advance

4 REPLIES 4

Re: Automatic order status to "Complete" for Digital Downloadable Products

According out of the box functionality it could be potential solution via Order Statuses in case if I associate Processing status with Complete state. I tried this solution - it doesn't workScreenshot from 2024-10-08 17-42-55.png

Re: Automatic order status to "Complete" for Digital Downloadable Products

An order will go into a complete state once it has both an invoice and a shipment. For virtual products, there is no need fro shipment so it will go into complete as soon as it has invoice. 

 

All you need to do is invoice the order and it will go into complete, some custom code that will automatically issue an invoice if the order contains only digital products would suffice for your needs and it shouldn't be a lot of work.

Founder at https://agency418.com

Re: Automatic order status to "Complete" for Digital Downloadable Products

So it must be an interceptor on Payment Succeeded event, and method that programmatically initiates invoice creation must be called in that interceptor?

I'm RoR developer & not familiar with Magento 2 architecture. Would be glad if there is an example with working solution & you would share a link for the gist with that solution (if it's possible).

 

Right now I'm thinking to write a custom outside service that will execute all necessary INSERTs/UPDATEs in MySQL that are using when you manually complete order from Admin Tools.

 

Thanks in advance

Re: Automatic order status to "Complete" for Digital Downloadable Products

You should observe the sales_order_place_after event and hook your invoicing logic in there.

 

I don't have a working example of the code, but I checked and I think if you use what ChatGPT gives you for this prompt, it will work Smiley Happy "Write a Magento 2 module that will automatically invoice any order that contains only downloadable products."

Founder at https://agency418.com