Skip to main content

Customise thank you page based upon items sold

More
14 years 7 months ago #38915 by Mat
Hi Nic,

How can I get the items bought by the customer and then tailor the thank you page accordingly?

Thanks,

Mat

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

More
14 years 7 months ago #39062 by nicolas
Hi,

It depends of your payment methods. You will have to edit either the file "end" or the file "after_end" of the view "checkout" via the menu Display->Views (and not have a return URL configured in your payment plugin).
You will have to load the order information like that:
Code:
$order_id = JRequest::getInt('order_id'); $orderClass = hikashop_get('class.order'); $order = $orderClass->loadFullOrder($order_id);
Then it's up to you...

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

More
14 years 7 months ago #39512 by Mat
Thanks - when I added print_r($order); nothing appeared.

how do I get the products they just ordered?

actually the $order_id = 0 when I echo'd it. So I guess the thank you page doesn't remember the order_id?

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

More
14 years 7 months ago #39557 by Mat
I even added the above code to the step.php and the order_id = 0

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

More
14 years 7 months ago #39558 by Mat
this worked

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

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

More
14 years 7 months ago #39719 by nicolas
if $order_id = JRequest::getInt('order_id'); doesn't work, you can do like that:

$app =& JFactory::getApplication();
$order_id = $app->getUserSate('com_hikashop.order_id');
The following user(s) said Thank You: Mat

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

More
14 years 7 months ago #39721 by Mat

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

Time to create page: 0.213 seconds
Powered by Kunena Forum