Author Topic: Add to cart popup not appearing in French in multi-lingual shop  (Read 296 times)

six gun

  • Beginner
  • *
  • Posts: 38
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Add to cart popup not appearing in French in multi-lingual shop
« on: September 04, 2018, 05:02:33 am »
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1667
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #1 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8002
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #2 on: September 04, 2018, 10:32:30 am »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

six gun

  • Beginner
  • *
  • Posts: 38
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #3 on: September 04, 2018, 11:24:05 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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8002
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #4 on: September 04, 2018, 11:47:13 am »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3334
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #5 on: September 04, 2018, 14:00:57 pm »
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

  • Beginner
  • *
  • Posts: 38
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #6 on: September 07, 2018, 04:59:22 am »
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1667
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #7 on: September 07, 2018, 07:40:20 am »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3334
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #8 on: September 07, 2018, 10:12:21 am »
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

  • Beginner
  • *
  • Posts: 38
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #9 on: September 07, 2018, 13:28:21 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8002
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Add to cart popup not appearing in French in multi-lingual shop
« Reply #10 on: September 07, 2018, 22:51:14 pm »
see above

Quote
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?

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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation