VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: etna on December 22, 2012, 17:33:24 PM

Title: Product name with weird characters inside mini cart in 2.0.16
Post by: etna on December 22, 2012, 17:33:24 PM
Hello
After upgrade from 2.0.14 to 2.0.16, clicking "add to cart", the popup mini-cart shows the product name with weird characters (Î�Î�§Î¤Î¥Î�Î�Î�).
The cart module and the check out page are OK.
The VM 2 is multilingual in Greek and English.
I checked all db tables and are OK (utf8_general_ci )
I forced Database Collation to utf8_general_ci with Admin Tools without luck.
Any ideas?

Thank you
Joomla 2.5.8 | VM 2.0..16 | PHP 5.3.13
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 17:43:05 PM
Thanks strange,

Haven't test it with greek yet also, any live url?
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 17:52:17 PM
Hello again,

Hoping the re-Collation did not Collation the data wrong...

I test it with a localsite, i updated and everything is working fine with Greek characters... Please provide a live url, i am thinking that may be there is a js conflict and the javascript function encodeURIComponent is not running properly inside vmprices.js ... not sure, but we can check it ...

Regards
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: etna on December 22, 2012, 18:53:36 PM
Sorry
I tested in WAMP not in live server.
I will make a new clean installation to check it.
Thank you
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 19:17:56 PM
Hello,

I tested on XAMPP, works fine, also check your database, are the data readable?
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 19:29:00 PM
Take a look also on that post: http://forum.virtuemart.net/index.php?topic=110647.0
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: etna on December 22, 2012, 19:46:29 PM
Clean Joomla 2.5.8 installation on WAMP
clean VM 2.0.16 installation
Joomla original template
Data Base has readable records in Greek

The same problem in mini-cart ???




Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 20:13:48 PM
I don't know, is strange, test it again working fine ... if you try to change the browser encoding from it's options?
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: etna on December 22, 2012, 20:35:01 PM
Made all possible encodings in firefox  -  :(
The strange is that at Shopping cart module and in check out page the name is OK.
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 20:57:17 PM
etna,

yes i reproduce it ... i am looking at it ...
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 21:36:16 PM
hmm ...

The problem is inside template files, specific under productdetails/tmpl/default_addtocart.php

around line 103
<input type="hidden" class="pname" value="<?php echo htmlentities($this->product->product_name?>"/>

change it to:

<input type="hidden" class="pname" value="<?php echo htmlentities($this->product->product_nameENT_QUOTES'utf-8'?>"/>
and will work.

This was added from a suggestion in the forum but causes issues because didn't parse the encoding for compatibility with multi-byte 8-bit Unicode

Fix added in 2.1 trunk

Thanks for finding that tiny bug ;)

Regards
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: etna on December 22, 2012, 21:59:11 PM
Thank you Nikos.
The code worked fine locally.

I owe you a drink!
maybe a... raki?



Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on December 22, 2012, 22:00:07 PM
Nice :)

I prefer raki, but i drink too much raki yesterday ;)
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: etna on December 22, 2012, 22:04:31 PM
Thats why you are so fast and genius!
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: jenkinhill on December 24, 2012, 18:21:59 PM
Hey should I try some of that?
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: bytelord on January 06, 2013, 17:05:55 PM
@Kelvyn

We can send a botle :)

Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: jenkinhill on January 06, 2013, 19:03:50 PM
Yes! Email one to me...  ;D
Title: Re: Product name with weird characters inside mini cart in 2.0.16
Post by: kotsifas on April 22, 2013, 11:54:34 AM
i have the same problem as posted in the first place
I use joomla 2.5.9,  virtuemart 2.0.20b and php 5.5.3
I have installed esport template by gavick. I have communicated with them and finally they turned me to you...
this is my post to their forum, if someone needs it to understand what is happening
https://www.gavick.com/forums/140/translation-problems-on-vm-24468.html

any ideas my friends?
below is the final answer of gavick's moderator:

QuoteHi

This issue is becoming even more impossible. I was looking for a right file to add the code adviced in VM forum. I've done it like this:

Looked for a text visible after broken message in cart "προστέθηκε στο καλάθι σας."

Has found that this text is being used by this static lang value: "COM_VIRTUEMART_MINICART_ADDED_JS"

Than scanned all Your site files to see where this code was used and there is none ;/ So I've tried with my copy and was directed to /helpers/config.php file which is not present in Your installation. I honestly do not know what's going on :) I think You have a different VM version than me, but this is just ridicules.

After a while I've tracked it in administrator files for VM, but it was just this part after broken text, no product name there at all. So it means this popup is being constructed from parts located in different files across whole joomla installation. Please ask VM developers where this exact part is located, the broken one and add this encode function then htmlentities($this->product->product_name, ENT_QUOTES, 'utf-8')