Skip to main content

Get order on guest checkout

More
2 years 3 months ago #361436 by Joomill
Hi,

I have a hikashop type plugin which start with:
Code:
public function onAfterOrderCreate($order,$send_email) { // Get Full Order $orderClass = hikashop_get('class.order'); $order = $orderClass->loadFullOrder($order->order_id); var_dump($order->order_id);die;

When i have a registered account who creates an order i see the order_id as expected
When i have a guest checkout the reply is NULL

What can i do to get the order_id in the case of a guest checkout?

Thanks in advance

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

More
2 years 3 months ago #361437 by nicolas
Replied by nicolas on topic Get order on guest checkout
Hi,

The loadFullOrder function has a built-in check to verify that the current user has the right to load the data of the order.
If you don't want this check to be done, you need to call it like this instead:
Code:
$order = $orderClass->loadFullOrder($order->order_id, false, false);

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

More
2 years 3 months ago #361439 by Joomill
Replied by Joomill on topic Get order on guest checkout
Thank you!

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

Time to create page: 0.233 seconds
Powered by Kunena Forum