- Posts: 145
- Thank you received: 6
checkout results displayed on the home menu
4 years 9 months ago #338278
by levelup
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
checkout results displayed on the home menu was created by levelup
-- 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
-- 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
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Please Log in or Create an account to join the conversation.
4 years 9 months ago #338282
by nicolas
Replied by nicolas on topic checkout results displayed on the home menu
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:
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.
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:
Code:
$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . $this->url_itemid;
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.
4 years 9 months ago - 4 years 8 months ago #338295
by levelup
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.
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Replied by levelup on topic checkout results displayed on the home menu
nicolas wrote: Hi,
Code:$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.
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Last edit: 4 years 8 months ago by levelup.
Please Log in or Create an account to join the conversation.
4 years 9 months ago #338308
by nicolas
Replied by nicolas on topic checkout results displayed on the home menu
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 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.
4 years 9 months ago #338325
by levelup
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Replied by levelup on topic checkout results displayed on the home menu
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
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
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Please Log in or Create an account to join the conversation.
4 years 9 months ago #338331
by nicolas
Replied by nicolas on topic checkout results displayed on the home menu
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:
by:
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 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:
Code:
$returnUrl = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . $this->url_itemid;
Code:
$returnUrl = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id . '&Itemid='.@$_REQUEST['Itemid'];
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.211 seconds