Not working switch apply points

  • Posts: 9
  • Thank you received: 1
1 week 5 days ago #360640

-- 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)

File Attachment:

File Name: 1.zip
File Size:18 KB

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

Attachments:

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

  • Posts: 81637
  • Thank you received: 13087
  • MODERATOR
1 week 4 days ago #360650

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 ?

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

  • Posts: 9
  • Thank you received: 1
1 week 4 days ago #360657

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

Attachments:
Last edit: 1 week 4 days ago by bvitl.

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

  • Posts: 81637
  • Thank you received: 13087
  • MODERATOR
1 week 3 days ago #360665

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.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum