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

#   Warning: htmlspecialchars() expects parameter1 to

##

- **[len4e](/forum/user/6174-len4e "View len4e's Profile")**
- [![len4e's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6174-len4e "View len4e's Profile") Topic Author
- [ Offline](/forum/user/6174-len4e)

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 8 months ago [\#39841](#39841) by [len4e](/forum/user/6174-len4e "View len4e's Profile")  *[Warning: htmlspecialchars() expects parameter1 to](/forum/4-how-to/39841-warning-htmlspecialchars-expects-parameter1-to#39841 "Hi,  I had a problem when trying to set (for to value) to checkbox so that my product corresponds to the selected check box, and when i go to the registration form and select the product in the shopping cart the product doesn't appears (the other options appears in the cart that are not selected)  Here is screen shot of my problem, please review it and give me quick response. Regards,")* was created by *[len4e](/forum/user/6174-len4e "View len4e's Profile")*

Hi,

I had a problem when trying to set (for to value) to checkbox so that my product corresponds to the selected check box, and when i go to the registration form and select the product in the shopping cart the product doesn't appears (the other options appears in the cart that are not selected)

Here is screen shot of my problem, please review it and give me quick response.
Regards,

[ ![check&#95;box.JPG](/forum/attachment/2778) ](/forum/attachment/2778 "check&#95;box.JPG")

- [ ![check&#95;box.JPG](/forum/attachment/2778) ](/forum/attachment/2778 "check&#95;box.JPG") [ ](/forum/attachment/2778?download=1 "check&#95;box.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzM5ODQxLXdhcm5pbmctaHRtbHNwZWNpYWxjaGFycy1leHBlY3RzLXBhcmFtZXRlcjEtdG8/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 8 months ago [\#39881](#39881) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Warning: htmlspecialchars() expects parameter1 to](/forum/4-how-to/39841-warning-htmlspecialchars-expects-parameter1-to#39881 "Hi,  I had a problem when trying to set (for to value) to checkbox so that my product corresponds to the selected check box, and when i go to the registration form and select the product in the shopping cart the product doesn't appears (the other options appears in the cart that are not selected)  Here is screen shot of my problem, please review it and give me quick response. Regards,")*

Hi,

Please change the line:
$html = $class-&gt;display($field,htmlspecialchars($value, ENT_COMPAT,'UTF-8'),$map,$inside,$options,$test);

to:
if(is_string($value)) $value = htmlspecialchars($value, ENT_COMPAT,'UTF-8');
$html = $class-&gt;display($field,$value,$map,$inside,$options,$test);

in the file administrator/components/com_hikashop/classes/field.php

That will remove the warning.

Regarding the fact that the product gets added to the cart when the checkbox is not ticked, looking at your screenshot, that's normal. It's just that you didn't tick the checkbox in the "For the value". After doing so and saving, it should work like you expect.

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

- **[len4e](/forum/user/6174-len4e "View len4e's Profile")**
- [![len4e's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6174-len4e "View len4e's Profile") Topic Author
- [ Offline](/forum/user/6174-len4e)

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 8 months ago [\#39902](#39902) by [len4e](/forum/user/6174-len4e "View len4e's Profile")  Replied by *[len4e](/forum/user/6174-len4e "View len4e's Profile")* on topic *[Re: Warning: htmlspecialchars() expects parameter1 to](/forum/4-how-to/39841-warning-htmlspecialchars-expects-parameter1-to#39902 "Hi,  I had a problem when trying to set (for to value) to checkbox so that my product corresponds to the selected check box, and when i go to the registration form and select the product in the shopping cart the product doesn't appears (the other options appears in the cart that are not selected)  Here is screen shot of my problem, please review it and give me quick response. Regards,")*

Hi Nikolas,

I copy and replace the code that have give in the massage but now when I ticked the checkbox and click save after saving the checkbox (for the value box) is still unchecked and when I go and fill the registration form and select the products the shopping card is empty ?

Please help me with this because is urgent!

Thanks,
Irena

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzM5ODQxLXdhcm5pbmctaHRtbHNwZWNpYWxjaGFycy1leHBlY3RzLXBhcmFtZXRlcjEtdG8/dG1wbD1tYXJrZG93bg==) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 8 months ago [\#39915](#39915) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Warning: htmlspecialchars() expects parameter1 to](/forum/4-how-to/39841-warning-htmlspecialchars-expects-parameter1-to#39915 "Hi,  I had a problem when trying to set (for to value) to checkbox so that my product corresponds to the selected check box, and when i go to the registration form and select the product in the shopping cart the product doesn't appears (the other options appears in the cart that are not selected)  Here is screen shot of my problem, please review it and give me quick response. Regards,")*

Hi,

We were able to reproduce the problem on our end.

Please change the code: Code:

$value = explode(',',$value); return parent::display($field,$value,$map,'checkbox',$inside,$options,$test);

to: Code:

if(!is_array($value)){ $value = explode(',',$value); } return parent::display($field,$value,$map,'checkbox',$inside,$options,$test);

in the file administrator/components/com_hikashop/classes/field.php
and the code: Code:

}elseif($value == $field-&gt;field_options['product_value']){

to: Code:

}elseif(is_string($value) &amp;&amp; in_array($value,$field-&gt;field_options['product_value'])){ $ok = true; }elseif($value == $field-&gt;field_options['product_value']){

in the file administrator/components/com_hikashop/classes/cart.php and that should fix the problem.

The following user(s) said Thank You: [len4e](/forum/user/6174-len4e "View len4e's Profile")

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

- **[len4e](/forum/user/6174-len4e "View len4e's Profile")**
- [![len4e's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6174-len4e "View len4e's Profile") Topic Author
- [ Offline](/forum/user/6174-len4e)

Less More

- Posts: 5
- Thank you received: 0
-
-

14 years 8 months ago [\#40541](#40541) by [len4e](/forum/user/6174-len4e "View len4e's Profile")  Replied by *[len4e](/forum/user/6174-len4e "View len4e's Profile")* on topic *[Check box unable!](/forum/4-how-to/39841-warning-htmlspecialchars-expects-parameter1-to#40541 "Hi,  I had a problem when trying to set (for to value) to checkbox so that my product corresponds to the selected check box, and when i go to the registration form and select the product in the shopping cart the product doesn't appears (the other options appears in the cart that are not selected)  Here is screen shot of my problem, please review it and give me quick response. Regards,")*

Hi HikaShopers,

I want to ask Is it possible to unable ticking the check box field when the product is on quantity 0 in the stock, I have a form when user chooses products which are listed as check boxes and I want to unable (make it not clickable unavailable or more gray or something like that, want to stay on site but not to be clickable) the check boxes related to the products which quantity is 0 in the stock.

I hope that you understand what I'm trying to do and If you have any suggestions please write me.

Thanks a lot.
Best regards,
Irena

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzM5ODQxLXdhcm5pbmctaHRtbHNwZWNpYWxjaGFycy1leHBlY3RzLXBhcmFtZXRlcjEtdG8/dG1wbD1tYXJrZG93bg==) 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.099 seconds

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

[](#top)
