Uploaded image for project: 'PrestaShop 1.7'
  1. PrestaShop 1.7
  2. BOOM-4647

Bug in Legal Compliance Module; Prestashop 1.7.2.3/1.7.2.4 version. Solution

    Details

    • How to reproduce the issue ?:
      Hide
      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.
      Show
      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.
    • Tests & Expected Results:
      N/A
    • Documentation Change:
      N/A

      Description

      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:  

      900--return $this>dumpHookDisplayProductPriceBlock($smartyVars, $hook_type);

      become this:

      900--- 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.

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Fabrizio Fabrizio
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: