Jump to content

Ändern {items} vom Modul mailalerts / new_order.html


Recommended Posts

Hallo,

ich suche vergebens wo ich  {items}   ändern kann,  das im Modul  Mailalerts  verwendet wird  (genauer gesagt dann in  new_order.html )

Wegen unseren internen Abläufen muss ich die  new_order.html so ändern das Tabelle der bestellten Artikel diese Reihenfolge hat:

Menge  -  Bezeichnung  -  Art.nr.  -  Einzelpreis  -   Preis

 

Daher muss ich  {items}  zu eben dieser gleichen Reihenfolge anpassen.  Aber wo ist das möglich?  Ich finde im gesamten Modul  Mailalerts  nichts entsprechendes.  Bitte hierzu auch das Bild ansehen,  dort erkennt man daß die Bezeichnung  nicht zur Tabelle passt.   danke!  

 

items_table.jpg

Link to comment
Share on other sites

In /mailalerts/mailalerts.php ab 377 sollte sich das finden lassen....

        $items_table = '';

        $products = $params['order']->getProducts();
        $customized_datas = Product::getAllCustomizedDatas((int)$params['cart']->id);
        Product::addCustomizationPrice($products, $customized_datas);
        foreach ($products as $key => $product)
        {
            $unit_price = Product::getTaxCalculationMethod($customer->id) == PS_TAX_EXC ? $product['product_price'] : $product['product_price_wt'];

            $customization_text = '';
            if (isset($customized_datas[$product['product_id']][$product['product_attribute_id']]))
            {
                foreach ($customized_datas[$product['product_id']][$product['product_attribute_id']][$order->id_address_delivery] as $customization)
                {
                    if (isset($customization['datas'][Product::CUSTOMIZE_TEXTFIELD]))
                        foreach ($customization['datas'][Product::CUSTOMIZE_TEXTFIELD] as $text)
                            $customization_text .= $text['name'].': '.$text['value'].'<br />';

                    if (isset($customization['datas'][Product::CUSTOMIZE_FILE]))
                        $customization_text .= count($customization['datas'][Product::CUSTOMIZE_FILE]).' '.$this->l('image(s)').'<br />';

                    $customization_text .= '---<br />';
                }
                if (method_exists('Tools', 'rtrimString'))
                    $customization_text = Tools::rtrimString($customization_text, '---<br />');
                else
                    $customization_text = preg_replace('/---<br \/>$/', '', $customization_text);
            }

            $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>';

Ich hab jetzt grad wenig Zeit, aber wenn du da die Zeilen ein wenig umstellst, sollte das Ganze hinkommen, so wie ich das jetzt auf die Schnelle sehe...

Link to comment
Share on other sites

Hi und vielen Dank,

habe es nun gleichzeitig mit deinem Beitrag gefunden, war erst etwas verwirrend aber nun passt es  zur Mailvorlage und wird in der richtigen Reihenfolge angezeigt  :) 

Genauer ist es dieser Teil hier,  ich habe ihn umgestellt und auch den Link zu den Artikeln entfernt da ich das in unserer Bestätigung nicht brauche und über die Jahre ne Menge Toner spare wenn die Schrift nicht fett und nicht unterstrichen ist:

 

 

            $itemsTable .=
                '<tr style="background-color:'.($key % 2 ? '#DDE2E6' : '#EBECEE').';">
                    <td style="padding:0.6em 0.4em; text-align:left;">'.(int) $product['product_quantity'].'</td>
                    <td style="padding:0.6em 0.4em;">'.$product['product_name']
                .(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '')
                .(!empty($customizationText) ? '<br />'.$customizationText : '')
                .'
                    </td>
                    <td style="padding:0.6em 0.4em;">'.$product['product_reference'].'</td>
                    <td style="padding:0.6em 0.4em; text-align:right;">'.Tools::displayPrice($unitPrice, false).'</td>
                    <td style="padding:0.6em 0.4em; text-align:right;">'
                .Tools::displayPrice(($unitPrice * $product['product_quantity']), false)
                .'</td>
                </tr>';
        }
        foreach ($params['order']->getCartRules() as $discount) {
            $itemsTable .=
                '<tr style="background-color:#EBECEE;">
                        <td colspan="4" style="padding:0.6em 0.4em; text-align:right;">'.$this->l('Voucher code:').' '.$discount['name'].'</td>
                    <td style="padding:0.6em 0.4em; text-align:right;">-'.Tools::displayPrice($discount['value'], false).'</td>
            </tr>';
        }

 

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