- Posts: 9
- Thank you received: 1
Not working switch apply points
2 years 6 months ago #360640
by bvitl
Not working switch apply points was created by bvitl
-- HikaShop version -- : 5.0.4
-- Joomla version -- : 4.4.4
-- PHP version -- : 8.1
-- Error-message(debug-mod must be tuned on) -- : Not working switch apply points
Not working switch apply points (Ajax request)
if in file: /plugins/hikashop/userpoints/userpoints.php
in line where: public function onCheckoutStepDisplay($layoutName, &$html, &$view, $pos=null, $options=null)
remove null in option $pos that is:
public function onCheckoutStepDisplay($layoutName, &$html, &$view, $pos, $options=null)
then all working
-- Joomla version -- : 4.4.4
-- PHP version -- : 8.1
-- Error-message(debug-mod must be tuned on) -- : Not working switch apply points
Not working switch apply points (Ajax request)
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
if in file: /plugins/hikashop/userpoints/userpoints.php
in line where: public function onCheckoutStepDisplay($layoutName, &$html, &$view, $pos=null, $options=null)
remove null in option $pos that is:
public function onCheckoutStepDisplay($layoutName, &$html, &$view, $pos, $options=null)
then all working
Please Log in or Create an account to join the conversation.
2 years 6 months ago #360650
by nicolas
Replied by nicolas on topic Not working switch apply points
Hi,
I don't think that changing this parameter default value changes anything. I think your problem is elsewhere.
Why did you think the problem came from that line of code ?
Did you get some error message ? Which one ?
Can you confirm that you don't have the problem anymore ?
If you revert the change, can you confirm that you have the error again ?
I don't think that changing this parameter default value changes anything. I think your problem is elsewhere.
Why did you think the problem came from that line of code ?
Did you get some error message ? Which one ?
Can you confirm that you don't have the problem anymore ?
If you revert the change, can you confirm that you have the error again ?
Please Log in or Create an account to join the conversation.
2 years 6 months ago - 2 years 6 months ago #360657
by bvitl
Replied by bvitl on topic Not working switch apply points
Installing only
new Joomla 5.1.0
Hikashop 5.0.4
Userpoints from remository.com/
video with problem: youtu.be/dCB-XRF58nU
I parsed the html and found that there is no second parameter in submitUserpoints
Afterwards I found a solution.
Ok now:
I think this is a problem with PHP, assigns a default value to a non-null argument: youtu.be/rJt7JeUim3w
new Joomla 5.1.0
Hikashop 5.0.4
Userpoints from remository.com/
video with problem: youtu.be/dCB-XRF58nU
I parsed the html and found that there is no second parameter in submitUserpoints
Afterwards I found a solution.
Ok now:
I think this is a problem with PHP, assigns a default value to a non-null argument: youtu.be/rJt7JeUim3w
Last edit: 2 years 6 months ago by bvitl.
Please Log in or Create an account to join the conversation.
2 years 6 months ago #360665
by nicolas
Replied by nicolas on topic Not working switch apply points
Hi,
Thank you for the details.
That's strange.
I think I'll use another, cleaner solution.
I already pass the first parameter of the submitUserpoints JS function to the onCheckoutStepDisplay event through the $view object parameter. So I'll also add the position parameter in there.
It's actually something we already do for default views ( checkout / show_block_* ) so it will make it more consistant with the rest of the system and will completely bypass the problem of parameters default values.
That $pos parameter should have never been there in the first place.
I've made the patch and added it to the install package of HikaShop 5.0.4 on our website as a hot fix.
Download it again and install it again on your website and you'll get the patch.
Thank you for the details.
That's strange.
I think I'll use another, cleaner solution.
I already pass the first parameter of the submitUserpoints JS function to the onCheckoutStepDisplay event through the $view object parameter. So I'll also add the position parameter in there.
It's actually something we already do for default views ( checkout / show_block_* ) so it will make it more consistant with the rest of the system and will completely bypass the problem of parameters default values.
That $pos parameter should have never been there in the first place.
I've made the patch and added it to the install package of HikaShop 5.0.4 on our website as a hot fix.
Download it again and install it again on your website and you'll get the patch.
Please Log in or Create an account to join the conversation.
Time to create page: 0.054 seconds