No sef url for thank you page after purchase

  • Posts: 290
  • Thank you received: 22
2 years 1 month ago #345370

-- url of the page with the problem -- : takaroo.nl/
-- HikaShop version -- : 4.6.2
-- Joomla version -- : 4.2.3
-- PHP version -- : 8.1.10

Hi,
I've setup a thank you page in an article and made a hidden menu for it, this worked very nice in the past.

In the payment method I use (RoPayments we can select what to do after a successful payment, I selected that it should go to that article.

As a result it is showing the article content but it's not using the SEF url. Instead it comes with something that looks like this :

(on the test site)
takaroo.dlidev.nl/nl/?option=com_hikasho...7LySbXQAsLJhJLzLFNOP

Roland gave me the tip to ask for something that would trigger onHikashopAfterDisplayView but that seems not to happen.

Any idea how to get the nice url after a successful pay of an order?

Last edit: 2 years 1 month ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345423

Hi,

The after_end URL you have is the URL payment plugins usually provide to the payment gateway for the customer to come back to the website. When HikaShop process that URL it does several things:
- it clears the cart
- it checks that the payment method selected for the order has a "return_url" parameter (this is usually specified in the "pluginConfig" attribute of the class of the plugin so the merchant can enter a "Return URL" when configuring the payment method in HikaShop). If it has that parameter, HikaShop will redirect to that return URL.
- If the user was not redirected because the payment plugin didn't have a return_url set, HikaShop displays the default thank you page of HikaShop, like you have on that link.

So there are several ways to tackle this:
- the payment plugin could implement the return_url parameter and you would just include the URL of the Joomla article in that setting, like for any other payment plugin
- the payment plugin could implement the onHikashopBeforeDisplayView or onHikashopAfterDisplayView and check the ctrl parameter of the URL to then redirect to wherever he wants
- you could make your own view override of the after_end view file via the menu Display>Views and manually add the redirect to the URL you want there. It's quite easy as it's just one line:

<?php JFactory::getApplication()->redirect('http://mywebsite.com/my/thank/you/page'); ?>

I would recommend method one or two, but both need to be implemented in the payment plugin, and thus by Roland, the developer.

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

  • Posts: 290
  • Thank you received: 22
2 years 1 month ago #345476

Hi Nicolas,

After some debugging by Roland heb found something.
He fixed it in my site and will add a fix in the next release of ROPayments.

Thanks for the reply.
Nico

The following user(s) said Thank You: nicolas

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

Time to create page: 0.059 seconds
Powered by Kunena Forum