News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Add to cart popup not appearing in French in multi-lingual shop

Started by six gun, September 04, 2018, 05:02:33 AM

Previous topic - Next topic

six gun

I have a multilingual site. English, German French and Spanish.
I have just noticed there is a problem with the add to cart popup in French.
With the other languages on clicking the add to cart the popup appears. With French there is a momentary spinning image and then nothing. The item does not appear in the mini cart until the page refreshes.
I presume there is a configuration error - something not configured in French.
https://www.c60inoliveoil.com/fr/boutique/c60-dans-l-huile-de-chanvre/c60-dans-l-huile-de-chanvre-vierge-detail
Any suggestions much appreciated.

Jörgen

Have You tried turning off sef and see what happens ?
Are there some taxes that are different for buying product in french ?
It is your template vp_smart that fails in js, vmprices.js, data is null

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

TypeError: data is null[Learn More] vmprices.js:174:1
   Virtuemart.renderDialog https://www.c60inoliveoil.com/templates/vp_smart/js/vmprices.js:174:1
   success https://www.c60inoliveoil.com/templates/vp_smart/js/vmprices.js:160:5
   i https://www.c60inoliveoil.com/media/jui/js/jquery.min.js:2:27444
   fireWith https://www.c60inoliveoil.com/media/jui/js/jquery.min.js:2:28213
   y https://www.c60inoliveoil.com/media/jui/js/jquery.min.js:4:22719
   c https://www.c60inoliveoil.com/media/jui/js/jquery.min.js:4:26925

Virtuemart.renderDialog = function(data, textStatus) {
   var $ = jQuery.noConflict();
   if ($.type(data.msg) == 'string') {
      data.msg = $.parseHTML(data.msg);
   }

seems data.msg is empty - think it comes from the cart helper ajax addto function

is the lang var set etc?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

six gun

Quote from: Jörgen on September 04, 2018, 08:01:58 AM
Have You tried turning off sef and see what happens ?
Are there some taxes that are different for buying product in french ?
It is your template vp_smart that fails in js, vmprices.js, data is null

regards

Jörgen @ Kreativ Fotografi

i turned off SEF in Joomla global configuration - still has the same issue. i remember sh404SEF caused an issue with the popup where it would not translate and when i took it off the site the translation worked fine.
No different taxes for France.
i am travelling at the moment and not in a position to fully take in what you and GJC are suggesting.
Many thanks for the prompt response.

GJC Web Design

you certainly don't need anything like sh404 on any J3/VM3 sites .. they handle SEF natively
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

First disable sh404 and use Joomla core SEF.
Add a home link for each language for root and virtuemart, if it's not the case.
(the english shop language switch dont have right template set)
Activate the PHP error log, so you can see if something is wrong in french only.

six gun

I used deductive reasoning.
The problem was only in French and it was to do with the virtuemart functions.
What is different between the languages?
The language files.
I tracked it down to the fr-FR.com_virtuemart.ini file.
When i deleted this file and the site fell back onto the English file there was no problem.
So i went through the English file on the server, line by line translating it into French and then checking if the popup kept working.
At line 87 in my French file we had COM_VIRTUEMART_CART_PRODUCT_ADDED="%2$s x %1$s a été ajouté à votre panier."
when this replaced the same line in English the problem arose. COM_VIRTUEMART_CART_PRODUCT_ADDED="%2$s x %1$s was added to your cart."
So there was something in [a été ajouté à votre panier.]
i switched back and forth between the English and the French - it was that line.
Anyway i then found a recently translated fr-FR.com_virtuemart.ini and put that in - it worked.
i had got a bad ini file from somewhere and it stopped the popup working.
Strange but true.

Jörgen

Sounds that it may have something to do with the coding coding of the language file. Was it ANSI instead of UTF-8 perhaps ? I have seen strange things happen because of this, but usually more harmless than this issue.

Glad that You got it working.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

YOu can check on activating Joomla language debug in the back-end. You see then all errors in the ini file.
I had already similar problems on a website with 5 or 6 languages, but never stopped the add to cart, but because add to cart is a json request, if the file is not UTF-8 encoded then you can have an encoding error, because json need UTF-8, especialy if the json format is not specified right in the request.

six gun

Yes i wondered about the ANSI instead of UTF-8. i copied and pasted into Notepad++ and saved the file on the desktop FTP'ing it onto the server after changes. It was very late when i finally got the problem sorted so i did not go into too much details once it was. i suspect it was a file i had picked up that was ANSI. There were other lines which when i copy pasted the French text into the server file nothing appeared on the page. When i used ini files currently on the Virtuemart language download page everything worked fine.
Many thanks for the comments and advice.

GJC Web Design

see above

QuoteVirtuemart.renderDialog = function(data, textStatus) {
   var $ = jQuery.noConflict();
   if ($.type(data.msg) == 'string') {
      data.msg = $.parseHTML(data.msg);
   }

seems data.msg is empty - think it comes from the cart helper ajax addto function

is the lang var set etc?

if the lang var failed because of encoding this would throw the above error and stop the cart JS
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation