[Skip to main content](#vessel-content)

#   Not working switch apply points

##

- **[bvitl](/forum/user/38376-bvitl "View bvitl's Profile")**
- [![bvitl's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/fish.gif)](/forum/user/38376-bvitl "View bvitl's Profile") Topic Author
- [ Offline](/forum/user/38376-bvitl)

Less More

- Posts: 9
- Thank you received: 1
-
-
-

2 years 6 months ago [\#360640](#360640) by [bvitl](/forum/user/38376-bvitl "View bvitl's Profile")  *[Not working switch apply points](/forum/27-checkout/908095-not-working-switch-apply-points#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)  if in file: /plugins/hikashop/userpoints/userpoints.php in line where: public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos=null, $options=null) remove null in option $pos that is: public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos, $options=null)  then all working")* was created by *[bvitl](/forum/user/38376-bvitl "View bvitl's Profile")*

-- 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)
*This attachment is hidden for guests.
Please log in or register to see it.*

if in file: /plugins/hikashop/userpoints/userpoints.php
in line where: public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos=null, $options=null)
remove null in option $pos that is:
public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos, $options=null)

then all working

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODA5NS1ub3Qtd29ya2luZy1zd2l0Y2gtYXBwbHktcG9pbnRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86582
- Thank you received: 14322
-
-

2 years 6 months ago [\#360650](#360650) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Not working switch apply points](/forum/27-checkout/908095-not-working-switch-apply-points#360650 "-- 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, &amp;$html, &amp;$view, $pos=null, $options=null) remove null in option $pos that is: public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos, $options=null)  then all working")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODA5NS1ub3Qtd29ya2luZy1zd2l0Y2gtYXBwbHktcG9pbnRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bvitl](/forum/user/38376-bvitl "View bvitl's Profile")**
- [![bvitl's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/fish.gif)](/forum/user/38376-bvitl "View bvitl's Profile") Topic Author
- [ Offline](/forum/user/38376-bvitl)

Less More

- Posts: 9
- Thank you received: 1
-
-
-

2 years 6 months ago -  2 years 6 months ago [\#360657](#360657) by [bvitl](/forum/user/38376-bvitl "View bvitl's Profile")  Replied by *[bvitl](/forum/user/38376-bvitl "View bvitl's Profile")* on topic *[Not working switch apply points](/forum/27-checkout/908095-not-working-switch-apply-points#360657 "-- 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, &amp;$html, &amp;$view, $pos=null, $options=null) remove null in option $pos that is: public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos, $options=null)  then all working")*

Installing only
new Joomla 5.1.0
Hikashop 5.0.4
Userpoints from [ remository.com/](https://remository.com/)

video with problem: [ youtu.be/dCB-XRF58nU](https://youtu.be/dCB-XRF58nU)

I parsed the html and found that there is no second parameter in submitUserpoints
[ ![1&#95;2024-04-28.JPG](/forum/attachment/59182) ](/forum/attachment/59182 "1&#95;2024-04-28.JPG")

Afterwards I found a solution.
Ok now:
[ ![2&#95;2024-04-28.JPG](/forum/attachment/59183) ](/forum/attachment/59183 "2&#95;2024-04-28.JPG")

I think this is a problem with PHP, assigns a default value to a non-null argument: [ youtu.be/rJt7JeUim3w](https://youtu.be/rJt7JeUim3w)

- [ ![1&#95;2024-04-28.JPG](/forum/attachment/59182) ](/forum/attachment/59182 "1&#95;2024-04-28.JPG") [ ](/forum/attachment/59182?download=1 "1&#95;2024-04-28.JPG")
- [ ![2&#95;2024-04-28.JPG](/forum/attachment/59183) ](/forum/attachment/59183 "2&#95;2024-04-28.JPG") [ ](/forum/attachment/59183?download=1 "2&#95;2024-04-28.JPG")

Last edit: 2 years 6 months ago by [bvitl](/forum/user/38376-bvitl "View bvitl's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODA5NS1ub3Qtd29ya2luZy1zd2l0Y2gtYXBwbHktcG9pbnRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86582
- Thank you received: 14322
-
-

2 years 6 months ago [\#360665](#360665) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Not working switch apply points](/forum/27-checkout/908095-not-working-switch-apply-points#360665 "-- 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, &amp;$html, &amp;$view, $pos=null, $options=null) remove null in option $pos that is: public function onCheckoutStepDisplay($layoutName, &amp;$html, &amp;$view, $pos, $options=null)  then all working")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODA5NS1ub3Qtd29ya2luZy1zd2l0Y2gtYXBwbHktcG9pbnRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
