Jump to content

[Problème] Erreur d'affichage de la table produit dans les emails


Recommended Posts

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

error_mail_template_hmlt.png

Questions forum Prestashop.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...