checkout results displayed on the home menu

  • Posts: 124
  • Thank you received: 6
2 years 10 months ago #338278

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 4.0.5
-- PHP version -- : 7.4
-- Browser(s) name and version -- : chorom

Hi
Why checkout results displayed on the home menu even though I have created a checkout menu?

[SITENAME]/index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=37&order_token=iPjxtJBx

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 10 months ago #338282

Hi,

That's because the Itemid parameter is missing for that after_end URL.
Normally, this parameter is added to the URL by the payment plugin.
For example, in the file plugins/hikashoppayment/paypal/paypal.php in the function onAfterOrderConfirm, you have this line of code to generate the after_end URL:

$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . $this->url_itemid;
The payment plugin you're using must be missing the code to add the $this->url_itemid to the URL.
And without the Itemid parameter in the URL Joomla doesn't know which menu item to use to display the page and uses the default one.

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

  • Posts: 124
  • Thank you received: 6
2 years 10 months ago #338295

nicolas wrote: Hi,

$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . $this->url_itemid;


The script you wrote already exists.
I think this problem is due to HikaShop settings.
In previous versions of HikaShop in System > Configuration > Advanced > LEGACY SETTINGS
There is a Checkout legacy field. But it is not available in Hika Shop 4.4.4.

On line 11 of the route
components \ com_hikashop \ views \ checkout \ view.html.php
Checks these settings but is not in the adnanced settings.

Last edit: 2 years 10 months ago by levelup.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 10 months ago #338308

Hi,

The checkout legacy setting has been removed from HikaShop since the support of Joomla 4 was added as the legacy checkout cannot work with Joomla 4.
The problem is not there.
As I said, it's the payment plugin which generates the URL /index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=37&order_token=iPjxtJBx
If the Itemid parameter is missing from there, and if the code I talked about is in the payment plugin you're using, then the problem is that the Itemid information is missing when the payment plugin is generating the URL.
Which payment plugin are you using ? How is it configured ?
What did you configure in the "force a menu on checkout" setting of the HikaShop configuration ? (I would recommend to select a menu item of the type "hikashop checkout" in there, that might even help your situation to do that if it's not already the case)
Could you provide a link to the shop so that we could check your checkout ?

The following user(s) said Thank You: levelup

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

  • Posts: 124
  • Thank you received: 6
2 years 10 months ago #338325

Hi
i use Zarinpal payment plugin.
"force a menu on checkout" setting is on hikashop checkout menu item.
link to shop: musicalgiftbox.ir
user : masoud
password: masoud#nicksefat
i enable test payment for now.
source code are attached

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 10 months ago #338331

Hi,

The problem is in the code of the plugin.
It is generating the URL in onPaymentNotification. There $this->url_itemid is not available.
It's only available in onAfterOrderConfirm.
Replacing the line:

$returnUrl = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . $this->url_itemid;
by:
$returnUrl = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . '&Itemid='.@$_REQUEST['Itemid'];
should fix the problem.

However, the best is to report the issue to the developer of the payment plugin so that it can check on the issue, integrate the fix and thouroughly test it on his end.
I've posted the issue on github so that the developer can check this thread:
github.com/ZarinPal-Lab/Joomla-HikaShop/issues/5

The following user(s) said Thank You: levelup

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

Time to create page: 0.065 seconds
Powered by Kunena Forum