0

I need to show product condition in mails/en/order_conf_product_list.tpl

I tried adding

{$product['condition']}

but i get this error:

Notice: Undefined index: condition in /home/yourserver/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(171) : eval()'d code on line 70

I guess I must make modification of mailalerts.php, but how to get the product condition?

AndrewS
  • 1,555
  • 4
  • 20
  • 32
  • 1
    $product does not contain an array key of 'condition'. `var_dump()` it and see what it does have. – delboy1978uk Sep 21 '17 at 10:01
  • I did {$product|@var_dump} as debloy1978uk suggested and this is the result it looks like condition is not in that array: array(6) { ["reference"]=> string(2) "10" ["name"]=> string(35) "test" ["unit_price"]=> string(9) "45,00 $" ["price"]=> string(9) "45,00 $" ["quantity"]=> int(1) ["customization"]=> array(0) { } } – AndrewS Sep 21 '17 at 10:07
  • I tried to search the class file or control file but I cant get the right file to make the modification so that i can get also condition in $product array – AndrewS Sep 21 '17 at 10:08

1 Answers1

1

I found the solution by myself so in case anyone face same problem:

For Prestashop: 1.6~

  1. edit classes/PaymentModule.php after line 467 add:

    'condition' => $product['condition'],

  2. In your email template the file "order_conf_product_list.tpl" use:

    {$product['condition']}

AndrewS
  • 1,555
  • 4
  • 20
  • 32