Futamiya Posted August 9, 2021 Share Posted August 9, 2021 Environnement de travail : localhost : xampp dernière version, sur Ubuntu apache web server mySQL database Ubuntu Bonjour, Je viens vers vous car dans tous mes mails (new order, confirmation de commande ...), la table du produit (product table) s'affiche comme vous pouvez le voir sur l'image suivante (nom de l'image : error_mail_template_html). J'ai découvert que c'était un problème lié à $itemsTable dans module/ps_emailalerts/psemailalerts.php. Donc j'ai remplacé ça : $url = $context->link->getProductLink($product['product_id']); $items_table .= '<tr style="background-color:' . ($key % 2 ? '#DDE2E6' : '#EBECEE') . ';"> <td style="padding:0.6em 0.4em;">' . $product['product_reference'] . '</td> <td style="padding:0.6em 0.4em;"> <strong><a href="' . $url . '">' . $product['product_name'] . '</a>' . (isset($product['attributes_small']) ? ' ' . $product['attributes_small'] : '') . (!empty($customization_text) ? '<br />' . $customization_text : '') . '</strong> </td> <td style="padding:0.6em 0.4em; text-align:right;">' . Tools::displayPrice($unit_price, $currency, false) . '</td> <td style="padding:0.6em 0.4em; text-align:center;">' . (int) $product['product_quantity'] . '</td> <td style="padding:0.6em 0.4em; text-align:right;">' . Tools::displayPrice(($unit_price * $product['product_quantity']), $currency, false) . '</td> </tr>'; Par ça : $url = $context->link->getProductLink($product['product_id']); $items_table .= '<TABLE width=100% border=1 style="background-color: #7ca8de;"> <tr><td bgcolor="#FDFDFD" style="font-family: Open sans, Arial, sans-serif; font-size: 12px; background-color: #fdfdfd; color: #353943; font-weight: 600; border: 1px solid #DFDFDF;width:7em;"> <p>' . $product['product_reference'] . '</p> </td><td bgcolor="#FDFDFD" style="font-family: Open sans, Arial, sans-serif; font-size: 12px; background-color: #fdfdfd; color: #353943; font-weight: 600; padding: 10px 5px; border: 1px solid #DFDFDF;"> <p><a href="' . $url . '">' . $product['product_name'] . '</a>'. (isset($product['attributes_small']) ? ' ' . $product['attributes_small'] : '') . (!empty($customization_text) ? '<br />' . $customization_text : '').'</p> </td><td bgcolor="#FDFDFD" style="font-family: Open sans, Arial, sans-serif; font-size: 12px; background-color: #fdfdfd; color: #353943; font-weight: 600; padding: 10px 5px; border: 1px solid #DFDFDF;"> <p>' . Tools::displayPrice($unit_price, $currency, false) . '</p> </td> <td bgcolor="#FDFDFD" style="font-family: Open sans, Arial, sans-serif; font-size: 12px; background-color: #fdfdfd; color: #353943; font-weight: 600; padding: 10px 5px; border: 1px solid #DFDFDF;"> <p>' . $product['product_quantity']. '</p> </td> <td bgcolor="#FDFDFD" style="font-family: Open sans, Arial, sans-serif; font-size: 12px; background-color: #fdfdfd; color: #353943; font-weight: 600; padding: 10px 5px; border: 1px solid #DFDFDF;"> <p>' . Tools::displayPrice(($unit_price * $product['product_quantity']), $currency, false) . '</p> </td> </tr> </TABLE>'; Ce qui fait que j'obtiens (voir image nommée : Question forum prestashop.png) J'ai beau essayer de modifier au maximum, cela me fait un rendu catastrophique. Je rajouterais que la table n'est pas pareil en fonction des emails : Nous avons par exemple, dans l'email new_order, la template qui ressemble à celle de Question_forum_prestashop.png, mais dans l'email confirmation de commande, nous avons l’ancienne template, comme celle de error_mail_template_html.png Avez-vous déjà été confronté à ce genre de problème ? Quelqu'un pourrait-il m'aider ? Merci d'avance pour vos réponses Cordialement Futamiya Link to comment Share on other sites More sharing options...
doekia Posted August 9, 2021 Share Posted August 9, 2021 J'ai pas trop analysé mais si vous êtes dans une table, au moins commencer (et terminer) votre code de remplacement par une tr Link to comment Share on other sites More sharing options...
Futamiya Posted August 9, 2021 Author Share Posted August 9, 2021 (edited) Bonjour, il y est, ligne 4 <tr> et avant derniere ligne </tr> Edited August 9, 2021 by Futamiya (see edit history) Link to comment Share on other sites More sharing options...
doekia Posted August 9, 2021 Share Posted August 9, 2021 Si le code d'origine commence par tr, c'est que cette section est injectée dans une table. Vous devez donc également commencer par tr Link to comment Share on other sites More sharing options...
Futamiya Posted August 9, 2021 Author Share Posted August 9, 2021 Ah dakodak. Je vais faire les modifications puis je reviens vers vous (enfin, ici) merci à vous Cordialement Link to comment Share on other sites More sharing options...
Mediacom87 Posted August 9, 2021 Share Posted August 9, 2021 Bonjour, un rappel sur les tableaux HTML : https://openclassrooms.com/fr/courses/1603881-apprenez-a-creer-votre-site-web-avec-html5-et-css3/1606851-ajoutez-des-tableaux Link to comment Share on other sites More sharing options...
Futamiya Posted August 10, 2021 Author Share Posted August 10, 2021 Ha ha ha, merci beaucoup Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now