Customise thank you page based upon items sold

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #38915

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.

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #39062

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:

$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.

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #39512

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.

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #39557

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.

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #39558

this worked

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

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

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #39719

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.

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #39721

thanks!

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

Time to create page: 0.061 seconds
Powered by Kunena Forum