Order Status Change

  • Posts: 197
  • Thank you received: 13
1 year 3 months ago #348065

-- HikaShop version -- : 4.7
-- Joomla version -- : 4.2.6
-- PHP version -- : 8.1

Hi.
I know that there is a gret possibility in Hikashop to change the order status via mass actions.

what I need, is to change the order status by runnig a php script by opening a url.

in my website , users order history url is this : domain.com/orders

for exampe, to change the order status of order number 425, by opening a URL like this :

my-domain.com/orders/order-425?order_status=cancel

is that possible ?

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
1 year 3 months ago #348068

Hi,

Well, it depends.

If the order was made by a guest, then it's possible to change the status of the order to cancelled by requesting the URL:

my-domain.com/index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=XXX&order_token=YYY
where XXX is the id of the order and YYY is the token of the order (which guarantees that the person cancelling the order is the same person who placed the order).

If the order was made by someone connected with a user account, then that same URL, without the order_token parameter can be used, but only by someone logged in on the frontend of the website with the user account of that person (again for security reasons).

There is no mechanism to change the order status of orders to someone else from an URL. It would require some authentication mechanism, to make sure the person calling that URL has the authority to do that.
Now, it would be possible to develop a small plugin to answer calls to a special URL with code in the plugin to be able to change the order information. We actually developed a plugin which, appart from other things can also receive such requests to change the order status but also other things of an order.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
1 year 3 months ago #348070

thank you for the answer.

let me explain my exact need.

i'm selling restaurant tickets on my website using hikashop.
I was thinking to put a QR code on the printed order information in which when the QR code is scanned by the restaurant manager, order status be changed from "confirmed" to "used" that means the ticket is used and can not be used again ...

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
1 year 3 months ago #348073

Hi,

In that case, you should use HikaSerial:
www.hikashop.com/component/hikashop/product/17-hikaserial.html
It will allow you to easily generate a QR code for each product purchase. And HikaSerial also has a consume feature to validate each QR code:
www.hikashop.com/support/documentation/2...ticket-tutorial.html
www.hikashop.com/support/documentation/1...onsume-features.html

Without HikaSerial, it would require quite a bit of development to generate the QR code and add it to the order, and then handle the scanning and validation. So I really recommand looking into HikaSerial because I think it will fit nicely with your requirements.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
1 year 3 months ago #348076

Thank you alot
What i want to know is that if i use Hikaserial, is there any option to mark a ticket as “used” ?

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
1 year 3 months ago #348080

Hi,

Yes, that's what the "consume" mechanism does.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
1 year 3 months ago #348081

and that consume option can be used with QR qode ?

there are tablets on the enterance of the restaurant, i want the ticket be marked as used with scanning the QR code in the enterance

is that possible ?

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
1 year 3 months ago #348086

Yes, it can be used with the QR code generator.
It's totally possible provided the QR Code scanner has access to the internet to request the URL of the QR code. The links I gave in this message www.hikashop.com/forum/orders-management...s-change.html#348073 explain on to set this up.
The example there is the sale of a ticket:
- someone purchase a ticket product
- HikaSerial generate a ticket number for the purchase (serial)
- HikaShop generates a ticket image (or PDF) with the consume URL of the serial as QR code
- when arriving to the venue, the customer provides the ticket with the QR code and the person at the entrance scans it (with a smartphone for example)
- this will trigger the consume mechanism. Either no one has already provided the QR code and the serial will be consumed and the person at the entrance will see a success message, or someone has already entered with that QR code and the person will see an error message.

The following user(s) said Thank You: khashiz

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 13
1 year 3 months ago #348144

That is my exact need.

Thank you alot

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum