Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOOM-4647] Bug in Legal Compliance Module; Prestashop 1.7.2.3/1.7.2.4 version. Solution #9766

Closed
prestonBot opened this issue Aug 22, 2018 · 11 comments

Comments

@prestonBot
Copy link
Collaborator

@prestonBot prestonBot commented Aug 22, 2018

This issue has been migrated from the Forge. Read the original ticket here.

  • Reporter: Fabrizio
  • Created at: Wed, 17 Jan 2018 17:49:42 +0100

Hi,

Prestaheroes.com Team  found an issue about the translation of a label that this module apply on Front End when Smarty cache is enabled. This of course happens with multilanguage websites. I checked some websites built with ps 1.7.2.3 and 1.7.2.4 versions and all have the same issue, indipendently from php version or other servers parameters. The problem is in ps_legalcompliance.php file. I loaded the correct version of the file. The solution is to add a 3d parameter ( red color text below) with the correct id of the language.

Here the code:  

-return $this->dumpHookDisplayProductPriceBlock($smartyVars, $hook_type);
+return $this->dumpHookDisplayProductPriceBlock($smartyVars, $hook_type, (int)$this->context->language->id);

the line interested at this modification is line Nº 900 that is the "Handle Product Combination Label" code section.

 

 

  • How to reproduce the issue ?

When we have a product with combinations/attributes, Legal Compliance module print a "from" label before the price; this label of course must have different translations according to the choosen language. Now if we have Smarty cache enabled this label doesn't change translation, i mean that we can have "from" also for French language and go on with all other languages despite translations are correctly done in Back Office. This happen in Ps 1.7.2.3 and 1.7.2.4 versions that i checked.

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: khouloud.belguith
  • Created at: Thu, 18 Jan 2018 09:17:56 +0100

Hi Fabrizio,

Thanks for your report

I manage to reproduce the issue with the last version PS 1.7.3.0, and the module "ps_legalcompliance" v3.0.0.
Would you be willing to make a pull request on GitHub with your code suggestion?
Thank you!

Best regards, Khouloud

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: bweber
  • Created at: Sat, 3 Feb 2018 00:46:48 +0100

Hi i replaced  this code in line 900 but it messed up . First it worked and the english side showed it right but the german one showed the product with the delivery date as it would be not in stock 3-6 weeks. Cleaning the cache and everything was back to ( Normal ) both sided showed the german delivery time and the link to the german CMS . Please provide a solution as this is not just a user expierience problem as well a legal problem which can cause major trouble from laywers . ( Especially in germany ) 

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: khouloud.belguith
  • Created at: Mon, 5 Feb 2018 10:16:42 +0100

Hi Fabrizio,

Thanks for your report.
I manage to reproduce the issue with the last version PS 1.7.3.0, and the module "ps_legalcompliance" v3.0.0.
We will see how to fix it.

Best regards, Khouloud

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: fabrizio
  • Created at: Thu, 15 Feb 2018 15:26:01 +0100

Only now i saw that i forgot to say that the modification must be done not only in line 900 but also at line 913, 941, 963, and line 981.

 

Regards

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: waschier-design
  • Created at: Tue, 12 Jun 2018 10:31:47 +0200

Same Problem here - PS 1.6.3.3
Fabrizios fix did work

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: khouloud.belguith
  • Created at: Tue, 12 Jun 2018 10:50:45 +0200

Hi,

I manage to reproduce the issue with the last version 1.7.3.3. and the ps_legalcompliance module v3.0.0.

Best regards, Khouloud

@BilalDr BilalDr added this to To do in Native modules integration via automation Oct 24, 2018
@BilalDr BilalDr moved this from To do to Legal Compliance in Native modules integration Oct 24, 2018
@BilalDr BilalDr moved this from Legal Compliance to To do in Native modules integration Oct 24, 2018
@Nobodaddy

This comment has been minimized.

Copy link
Contributor

@Nobodaddy Nobodaddy commented Nov 24, 2018

  • Author: waschier-design
  • Created at: Tue, 12 Jun 2018 10:31:47 +0200

Same Problem here - PS 1.6.3.3
Fabrizios fix did work

Nope, it's not really the same problem. AEUC is quite messed up and produces far more cache errors. I made a fixed version available for download in the german forum, because the Prestashop team rejected a bugfix for 1.6 at that time: https://www.prestashop.com/forums/topic/662685-download-aeuc-europ%C3%A4ische-rechtssicherheit-verbessertes-modul-ohne-cachefehler/
But the way ps_legalcompliance has chosen with the file split for the hookdisplayProductPrice only reduces the malfunction without fixing it completely. This seems to be also the reason why Prestaheroes.com's suggestion doesn't really solve the problem.

@holle75

This comment has been minimized.

Copy link

@holle75 holle75 commented Feb 19, 2019

problem still exists in module v3.0.1 and Presta 1.7.5
you can also realize the problem under the pricetag on product pages. Additional text fe "VAT included Shipping excluded - Estimated time to delivery 1-2 month", the "Shipping excluded " part stays in the language one used when switching caching on.

@Nobodaddy

This comment has been minimized.

Copy link
Contributor

@Nobodaddy Nobodaddy commented Feb 19, 2019

Like I said, but they wouldn't listen. This file split in ps_legalcompliance was the wrong tack to avoid caching errors.
:)

@holle75

This comment has been minimized.

Copy link

@holle75 holle75 commented Feb 19, 2019

Yup, after spending 2 month now fixing errors, discovering "unlogic" behavior and missing features from (even very old) former versions in Presta 1.7.x, still every day something new and surprising comes up.
.... Or maybe i´m just anal in not willing to be the Admin of a buggy shop?

But hey, finally everything will be alright! .... Just the path to get there .....

And i think (and hope) the impression one gets from Presta depends heavily on the use of just one or more languages.

1 Language -> not so bad, a few missing features and marvels here and there

1+ Languages ->Ooh, pain

btw the mods from Fabrizio are helping. Haven´t had time to check what pain comes at other places after those code modifications, but the initial problems are solved.

@marionf marionf added Fixed and removed To Do labels May 22, 2019
@marionf marionf added this to Backlog in PrestaShop 1.7.7 via automation May 22, 2019
@marionf marionf moved this from Backlog to To be merged in PrestaShop 1.7.7 May 22, 2019
@marionf marionf moved this from To do to To be merged in Native modules integration May 22, 2019
@eternoendless

This comment has been minimized.

Copy link
Member

@eternoendless eternoendless commented May 22, 2019

@marionf marionf closed this May 22, 2019
Native modules integration automation moved this from To be merged to Done May 22, 2019
PrestaShop 1.7.7 automation moved this from To be merged to Done May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.