- Posts: 431
- Thank you received: 22
Cannot select products for discont or badges
11 years 4 months ago #201971
by mojweb
Cannot select products for discont or badges was created by mojweb
Please Log in or Create an account to join the conversation.
11 years 4 months ago #201972
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Cannot select products for discont or badges
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,
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 4 months ago #201986
by mojweb
Replied by mojweb on topic Cannot select products for discont or badges
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?
Maybe to send you admin to see?
Please Log in or Create an account to join the conversation.
11 years 4 months ago #201988
by nicolas
Replied by nicolas on topic Cannot select products for discont or badges
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
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
Please Log in or Create an account to join the conversation.
11 years 4 months ago #202054
by mojweb
Replied by mojweb on topic Cannot select products for discont or badges
Access send. Thank you.
Please Log in or Create an account to join the conversation.
11 years 4 months ago - 11 years 4 months ago #202104
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Cannot select products for discont or badges
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 )
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 )
So in the file "administrator/components/com_hikashop/classes/product.php" please replace
Into
And I hope it will fix your issue by converting the text into a correct encoding.
Regards,
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 )
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 )
So in the file "administrator/components/com_hikashop/classes/product.php" please replace
Code:
if(!empty($displayFormat) && !empty($displayFormat_tags)) {
if($p->product_quantity == -1)
$p->product_quantity = JText::_('UNLIMITED');
$p->product_name = htmlentities($p->product_name);
$o->name = $displayFormat;
foreach($displayFormat_tags[1] as $key) {
$o->name = str_replace('{'.$key.'}', $p->$key, $o->name);
}
}
if(empty($o->name)) {
$o->name = htmlentities($p->product_name);
if(empty($o->name))
$o->name = '['.$p->product_id.']';
}
Code:
if(!preg_match('!!u', $p->product_name))
$product_name = htmlentities(utf8_encode($p->product_name));
else
$product_name = htmlentities($p->product_name);
if(!empty($displayFormat) && !empty($displayFormat_tags)) {
if($p->product_quantity == -1)
$p->product_quantity = JText::_('UNLIMITED');
$p->product_name = $product_name;
$o->name = $displayFormat;
foreach($displayFormat_tags[1] as $key) {
$o->name = str_replace('{'.$key.'}', $p->$key, $o->name);
}
}
if(empty($o->name)) {
$o->name = $product_name;
if(empty($o->name))
$o->name = '['.$p->product_id.']';
}
And I hope it will fix your issue by converting the text into a correct encoding.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 11 years 4 months ago by Jerome. Reason: fix
Please Log in or Create an account to join the conversation.
11 years 4 months ago #202132
by mojweb
Replied by mojweb on topic Cannot select products for discont or badges
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
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 or Create an account to join the conversation.
11 years 4 months ago #202145
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Cannot select products for discont or badges
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,
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.201 seconds