After_end template not being shown after guest checkout

  • Posts: 27
  • Thank you received: 4
6 years 5 months ago #293778

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.8
-- PHP version -- : 7.0

I have a custom after_end template which shows the order details, and also contains several plugin dispatchers. It usually shows when logged in users complete the checkout process, but I have noticed that whenever guests complete checkout, the after_end template is never called from the Checkout Controller function after_end.

And I found out that the condition,

if(hikashop_loadUser(false) != $order->order_user_id)
evaluates to true during Guest checkout, which then skips calling $this->display().

Is there something I can do to get around this problem, or will I have to create a temporary workaround?
I was thinking a temporary workaround like,
if((JFactory::getUser()->guest != true && hikashop_loadUser(false) != $order->order_user_id)

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 5 months ago #293783

Hello,

Guest user do have a "user_id" in the HikaShop database.
So I don't see any issue with the line you mentioned.

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: 27
  • Thank you received: 4
6 years 5 months ago #293862

After some more testing, I found out the root of the problem. We are using the legacy checkout and there is a line in the function after_confirm where it sets the user ID to 0.

Is there a way around this or are we forced to use the current checkout code?


EDIT: I found a workaround. The setting "Clean Cart When Order Is ..." was set to "created". I changed this to "confirmed" and it worked. I need more testing to see if this changed setting will break anything.

Last edit: 6 years 5 months ago by fengel.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum