CookieMonster's avatar

Can I use QR Code to scan and update the order status?

I am new to laravel and currently using a simple qr code package that I want to add to my e-commerce website. The idea is when a customer placed an order, the merchant will deliver the item via courier. The order status in the merchant dashboard is in progress when an item is placed. When the item arrives, the merchant view the purchase order where the QR code is there and scan it with his phone and updates the order status to "Delivered". This means it will require some sort of linkage to the backend database to update it.

I am unfamiliar with this. Is this doable?

0 likes
5 replies
Tray2's avatar

In short yes it's doable.

The Qr code needs to contain a link to your finish order route with a uuid or similar that puts the order into finish state. You can use something similar to how Laravel handles the reset password link.

CookieMonster's avatar

But the QR scan is in the mobile phone and in order to work, the merchant has to signed in through the phone.

Tray2's avatar

A regular browser in the phone would be enough and the need to be signed in isn't mandatory. Though most courier firms have their own system to track shipments.

CookieMonster's avatar

I have a table called orders with order_number as primary key for the purchase order and order_status being the one that needs to be updated once the customer scan the QR on it. So I just linked it to this table?

Because I need to create a route and since login is not mandatory, where do I link the customer to after he or she scan the QR?

I'm thinking something like Route::get('/order-completed','Some controller to handle the update');

Please or to participate in this conversation.