How to include order details on the thank you page

  • Posts: 2
  • Thank you received: 0
12 years 11 months ago #32253

Hi, first of all, great product!

I'm wondering if it's possible to display the details of the order on the thank you page. I'm implementing standard paypal payment checkout.

I found that the file to modify is in views/checkout/tmpl/after_end.php

Here is the code I added there:

$app =& JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');

$orderClass = hikashop::get('class.order');
$order = $orderClass->loadFullOrder($order_id);

$orderNum = $order->order_number;

$app->enqueueMessage( '<br>Order id: '.$order_id.'<br>Order Number: '.$orderNum );

At this point both the order_id and Order numbers are blank. I'm thinking maybe since the checkout process is already finished, the order is empty? Can I load it from the database somehow?

Thanks for the help!

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
12 years 11 months ago #32287

Hi,

If you use a recent version of HikaShop, the order is already loaded in after_end.
You can do like that:
$app =& JFactory::getApplication();
$app->enqueueMessage( '<br/>Order id: '.$this->order->order_id.'<br/>Order Number: '.$this->order->order_number );

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

  • Posts: 2
  • Thank you received: 0
12 years 11 months ago #32609

Got it working, thank you so much!!!

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

  • Posts: 1
  • Thank you received: 0
10 years 7 months ago #152948

Hi

i Want to include order details for paypal pro method. the file it redirects once the payment successful is views/checkout/tmpl/end.php however i cant get order details on this page ? i,e $this->order not working. Please help

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 7 months ago #152951

Hi,

You can use the same code. However, before that code, you need to manually load the order data like that:

$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this->order = $orderClass->loadFullOrder($order_id,false,false);

Last edit: 7 years 10 months ago by nicolas.

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

  • Posts: 59
  • Thank you received: 1
8 years 11 months ago #224782

Hi,

I think you have a really good notifcation e-mail sent to the customers.

However! Your thank you page is very boring! It just states a 'Thank you' message...

I have an idea.

Is there someway I can simply put everything you see in the creation/confirmation mail that is sent to the customers e-mail, also in the thank you page?

So basically just take the whole confirmation e-mail and copy it in to the thank you page.

I think it makes for a much more pleasant shopping experience if the customer also directly gets too see the same info as in the status e-mail, instead of just a thank you... Or is this too much too ask?

Best Regards and merry christmas!

Last edit: 8 years 11 months ago by madjedo.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 11 months ago #224785

Hi,

You could simply redirect to the order details page of the order.
It's easy to add.
You can add such code in the file "after_end" via the menu Display>views:

<?php
$app = JFactory::getApplication();
$app->redirect(hikashop_completeLink('order&task=show',false,true));
?>

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

  • Posts: 59
  • Thank you received: 1
8 years 11 months ago #224842

Hi, thank you. I have facebook/google conversion code tracker on that page. Will it still work even if they are redirected?

* Oh, and I use guest-checkout. You have to "login" to see that page actually...

* I think optimal would be to redirect the user after 2-3 seconds to his last order page. But I use guest-checkout so I dont know if this would be possible...

Last edit: 8 years 11 months ago by madjedo.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 11 months ago #224858

Hi,

The facebook/google conversion code tracker code won't work if people are redirected.
And if you have guest checkout, the order details page is indeed not available to them.

In such case, a different solution would be required where you would directly display the order details in the "after_end" view file.
But in that case, it will require complex custom code and you can't just copy/paste it from somewhere else.
In that case, I would recommend to contact a developer to help you with that.

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

  • Posts: 59
  • Thank you received: 1
8 years 11 months ago #224918

Ok thank you anyways.

In the meantime, can you help me with the code to just display some simple text, like this:

Your order (#ordernr) is now confirmed. An e-mail has been sent to your adress (#customermail) with additional information.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 11 months ago #224933

Hi,

There is already the corresponding information to get the order number in the first reply made Nicolas in that thread.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 846
  • Thank you received: 92
8 years 2 months ago #250592

Hi
A) When the mouse click on end_file link in the column of name File ... All the link goes JOOMLA/Administrator/index.php?option=com_hikashop&ctrl=view&task=edit&id=0|beez3|component|com_hikashop|checkout|after_end%2Ephp and only the template name in red change beetween item .
What does it mean in joomla word refer to this doc ? Do we override the hikashop component layout for specific template ?



B ) after click on the first item , I can edit the code .
cms3 API link in code give
<?php
$app = JFactory:: getApplication ();
$app-> redirect (hikashop_completeLink('order&task=show',false,true));
?>
where is documented the "method ?" hikashop_completeLink ?
i think it is like angular redirect but for php

C) the code above can be replace by the new code
$app =& JFactory::getApplication();
$app->enqueueMessage( '<br/>Order id: '.$this->order->order_id.'<br/>Order Number: '.$this->order->order_number );


$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this->order = $orderClass->loadFullOrder($order_id,false,false); 
$app->enqueueMessage( '<br/>Order id: '.$this->order->order_id.'<br/>Order Number: '.$this->order->order_number );
what mean hikashop_get('class.order'); ? a alias ? where is the doc about this ?

C) Save this php file ll create a new file ( implicit) for the template



D) and the Joomla back end show that we override the file content


Regard's

Attachments:
Last edit: 8 years 2 months ago by lionel75.

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

  • Posts: 34
  • Thank you received: 0
7 years 10 months ago #258949

Hi, Does this works in guest mode?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 10 months ago #258963

Hi,

No. The order details page is only available while logged in so no.

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

  • Posts: 34
  • Thank you received: 0
7 years 10 months ago #259018

Hi, This has help me a lot, how can i get the user information in guest mode in the after_:end page?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 10 months ago #259020

Hi,

You can try to use such code to load the data from the order placed by the customer:
www.hikashop.com/forum/4-how-to/32253-ho...you-page.html#152951

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

Time to create page: 0.131 seconds
Powered by Kunena Forum