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

#   Cannot select products for discont or badges

##

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

Less More

- Posts: 432
- Thank you received: 22
-

11 years 5 months ago [\#201971](#201971) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#201971 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")* was created by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1

When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.

[ ![select.jpg](/forum/attachment/24425) ](/forum/attachment/24425 "select.jpg")

I was trying to find diferences between products, but no luck.

- [ ![select.jpg](/forum/attachment/24425) ](/forum/attachment/24425 "select.jpg") [ ](/forum/attachment/24425?download=1 "select.jpg")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#201972](#201972) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#201972 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

Hi,

Thanks for the report.
Would it be possible to have more details about the products you got in the category ?
The goal is to understand why you got "null", what should be really displayed.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 432
- Thank you received: 22
-

11 years 5 months ago [\#201986](#201986) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#201986 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

This are products like other. With same setings. It should show their titles. What other info you need?
Maybe to send you admin to see?

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

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 5 months ago [\#201988](#201988) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#201988 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

Hi,

Yes. Please provide a backend access with a link to this thread via our contact form so that we can have a look at your setup:
[ www.hikashop.com/support/contact-us.html](http://www.hikashop.com/support/contact-us.html)

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

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

Less More

- Posts: 432
- Thank you received: 22
-

11 years 5 months ago [\#202054](#202054) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#202054 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

Access send. Thank you.

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

11 years 5 months ago -  11 years 5 months ago [\#202104](#202104) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#202104 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

Hi,

Thanks for the accesses.
We saw that the products displayed by "null" are products with special characters (like "Č").
I tried to reproduce the issue in my local website but the display is fine on my side.
I checked if there were some modifications between the current stable release and the development version and I there is nothing related to the display of the elements.

So I see the source of the error but it is difficult to explain exactly why you have the error.
I see two differences with my local website.
First I can see it that I have a database with a "utf8_bin" collation and you have a database with a "latin1_swedish_ci" collation.
Second, You're using PHP 5.3.29 and I'm using PHP 5.4.12

It looks like that PHP 5.4 is better with UTF8 in strings when encoding to JSON.
( [ stackoverflow.com/questions/8143163/php-...null-instead-of-text](http://stackoverflow.com/questions/8143163/php-json-encode-shows-null-instead-of-text) )

So the best might be to detect if the product name have some special characters and is not in UTF8 ; in order to convert it into UTF8.
( [ stackoverflow.com/questions/4407854/how-...r-encode-on-a-string](http://stackoverflow.com/questions/4407854/how-to-detect-if-have-to-apply-utf8-decode-or-encode-on-a-string) )

So in the file "administrator/components/com_hikashop/classes/product.php" please replace Code:

if(!empty($displayFormat) &amp;&amp; !empty($displayFormat_tags)) { if($p-&gt;product_quantity == -1) $p-&gt;product_quantity = JText::_('UNLIMITED'); $p-&gt;product_name = htmlentities($p-&gt;product_name); $o-&gt;name = $displayFormat; foreach($displayFormat_tags[1] as $key) { $o-&gt;name = str_replace('{'.$key.'}', $p-&gt;$key, $o-&gt;name); } } if(empty($o-&gt;name)) { $o-&gt;name = htmlentities($p-&gt;product_name); if(empty($o-&gt;name)) $o-&gt;name = '['.$p-&gt;product_id.']'; }

Into Code:

if(!preg_match('!!u', $p-&gt;product_name)) $product_name = htmlentities(utf8_encode($p-&gt;product_name)); else $product_name = htmlentities($p-&gt;product_name); if(!empty($displayFormat) &amp;&amp; !empty($displayFormat_tags)) { if($p-&gt;product_quantity == -1) $p-&gt;product_quantity = JText::_('UNLIMITED'); $p-&gt;product_name = $product_name; $o-&gt;name = $displayFormat; foreach($displayFormat_tags[1] as $key) { $o-&gt;name = str_replace('{'.$key.'}', $p-&gt;$key, $o-&gt;name); } } if(empty($o-&gt;name)) { $o-&gt;name = $product_name; if(empty($o-&gt;name)) $o-&gt;name = '['.$p-&gt;product_id.']'; }

And I hope it will fix your issue by converting the text into a correct encoding.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 11 years 5 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: fix

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

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

Less More

- Posts: 432
- Thank you received: 22
-

11 years 5 months ago [\#202132](#202132) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#202132 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

Solved with PHP 5.4.

On main domain, we have old joomla and using PHP 5.3. Now i changed php and Hikashop display of products is ok.

Thank you

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#202145](#202145) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Cannot select products for discont or badges](/forum/46-discount-coupon/877008-cannot-select-products-for-discont-or-badges#202145 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1  When in discount or badges menu and want to select single or more product, cannot select. Some product are listed, some not (those have null). Those with null i cant select.  I was trying to find diferences between products, but no luck.")*

Hi,

Good to know that your problem is solved and thank you for sharing.
I hope that it will help other users with the same kind of issue.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzcwMDgtY2Fubm90LXNlbGVjdC1wcm9kdWN0cy1mb3ItZGlzY29udC1vci1iYWRnZXM/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.062 seconds

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