cancel
Showing results for 
Search instead for 
Did you mean: 

Get increment_id for order

Get increment_id for order

I'm trying to solve the problem with session validation on the page /checkout/onepage/success/ with example  https://gielberkers.com/style-checkoutonepagesuccess-page-magento-2/

But the example does not work if there is no order. How get increment_id for order, if does not orders exist?

2 REPLIES

Re: Get increment_id for order

.

Re: Get increment_id for order

Hi @wallone

 

To do this you must place an order first. So what you should do is, undo all the changes that this article is proposing, place an order, and do it again.

 

This code is taking the last order placed on your platform to build the success page, so if has no order, will not work.

 

Regards.