FIMA Опубликовано 29 ноября, 2019 Жалоба Поделиться Опубликовано 29 ноября, 2019 (изменено) Всем примет. Прощу помощи в редактировании файла order_print.tplЯ с помощью шпаргалки подкорректировал файл, сделал таблицу для <div id="customer"> и <div id="purchases">.Проблема в том что при открытии страницы заказа order_print.tpl все отображается отлично, а после отправления на печать, таблица исчезает. Почему так, как исправить это? <!DOCTYPE html> {* Печать заказа *} {$wrapper='' scope=parent} <html> <head> <base href="{$config->root_url}/"/> <title>Заказ №{$order->id}</title> {* Метатеги *} <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="description" content="{$meta_description|escape}" /> <style> body { width: 1000px; height: 1414px; /* to centre page on screen*/ margin-left: auto; margin-right: auto; //border: 1px solid black; font-family: Trebuchet MS, times, arial, sans-serif; font-size: 16pt; color: black; background-color: white; } div#header{ margin-left: 5px; margin-top: 20px; height: 150px; width: 400px; float: left; } div#company{ margin-right: 5px; margin-top: 20px; height: 150px; width: 300px; float: right; text-align: right; } div#customer table { width: 100%; /* Ширина таблицы */ background: #000; /* Цвет фона таблицы */ color: #000; /* Цвет текста */ font-weight: 600; border-spacing: 1px; /* Расстояние между ячейками */ } div#customer td { background: #fff; /* Цвет фона ячеек */ padding: 5px; /* Поля вокруг текста */ } div#purchases table { width: 100%; /* Ширина таблицы */ background: #000; /* Цвет фона таблицы */ color: #000; /* Цвет текста */ border-spacing: 1px; /* Расстояние между ячейками */ } div#purchases td, div#purchases th { background: #fff; /* Цвет фона ячеек */ padding: 5px; /* Поля вокруг текста */ } div#total{ float: right; margin-right: 50px; height: 100px; width: 500px; text-align: right; } div#total table{ width: 500px; float: right; border-collapse:collapse } div#total th { font-weight: normal; text-align: left; font-size: 22px; border-top: 1px solid black; } div#total td { text-align: right; border-top: 1px solid black; font-size: 18px; padding-top: 10px; padding-bottom: 10px; margin: 0; } div#total .total { font-size: 30px; } </style> </head> <body _onload="window.print();"> <div id="header"> <h2>Заказ покупателя №{$order->id}</h2> <p>от {$order->date|date}</p> </div> <div id="company"> <h2>{$settings->site_name}</h2> <p>{$config->root_url}</p> </div> </br> <div id="customer"> <table> <tr> <td width="200">ФИО получателя</td> <td><strong>{$order->name|escape}</strong></td> </tr> <tr> <td width="200">Телефон</td> <td>{$order->phone|escape}</td> </tr> <tr> <td width="200">Email </td> <td>{$order->email|escape}</td> </tr> <tr> <td width="200">Адрес доставки </td> <td>{$order->address|escape}</td> </tr> <tr> <td width="200">Комментарий к заказу </td> <td><i>{$order->comment|escape|nl2br}</i></td> </tr> </table> {* {if $order->note} <table> <tr> <td><h2><i>Примечание менеджера</i></h2><i>{$order->note|escape|nl2br}</i></td> </tr> </table> {/if} *} </div> </br> <div id="purchases"> <table> <tr> <th class="align_right">Товар</th> <th class="align_left">Цена</th> <th class="align_right">Количество</th> <th class="align_right">Всего</th> </tr> {foreach $purchases as $purchase} <tr> <td> <span class=view_purchase> {$purchase->product_name} {$purchase->variant_name} {if $purchase->sku} (артикул {$purchase->sku}){/if} </span> </td> <td class="align_right"> <span class=view_purchase>{$purchase->price}</span> {$currency->sign} </td> <td class="align_right"> <span class=view_purchase> {$purchase->amount} {$settings->units} </span> </td> <td class="align_right"> <span class=view_purchase>{$purchase->price*$purchase->amount}</span> {$currency->sign} </td> </tr> {/foreach} {* Если стоимость доставки входит в сумму заказа *} {if $order->delivery_price>0} <tr> <td colspan=3>{$delivery->name|escape}{if $order->separate_delivery} (оплачивается отдельно){/if}</td> <td class="align_right">{$order->delivery_price|convert} {$currency->sign}</td> </tr> {/if} </table> </div> </br> <div id="total"> <table> {if $order->discount>0} <tr> <th>Скидка</th> <td>{$order->discount} %</td> </tr> {/if} {if $order->coupon_discount>0} <tr> <th>Купон{if $order->coupon_code} ({$order->coupon_code}){/if}</th> <td>{$order->coupon_discount} {$currency->sign}</td> </tr> {/if} <tr> <th>Итого</th> <td class="total">{$order->total_price} {$currency->sign}</td> </tr> {if $payment_method} <tr> <td colspan="2">Способ оплаты: {$payment_method->name}</td> </tr> <tr> <th>К оплате</th> <td class="total">{$order->total_price|convert:$payment_method->currency_id} {$payment_currency->sign}</td> </tr> {/if} </table> </div> </body> </html> Изменено 29 ноября, 2019 пользователем FIMA Цитата Ссылка на сообщение Поделиться на другие сайты
shooroop Опубликовано 29 ноября, 2019 Жалоба Поделиться Опубликовано 29 ноября, 2019 потому что надо читать статьи . современные браузеры режут стили . в браузере в настройках печати измените вид отображения. Цитата Ссылка на сообщение Поделиться на другие сайты
chocolate_moles Опубликовано 29 ноября, 2019 Жалоба Поделиться Опубликовано 29 ноября, 2019 Например div#customer table { width: 100%; background: #000; color: #000; font-weight: 600; border-collapse: collapse; } div#customer td { background: #fff; padding: 5px; border: 1px solid #333; } Цитата Ссылка на сообщение Поделиться на другие сайты
FIMA Опубликовано 29 ноября, 2019 Автор Жалоба Поделиться Опубликовано 29 ноября, 2019 Спасибо большое друзья! Цитата Ссылка на сообщение Поделиться на другие сайты
Рекомендуемые сообщения
Присоединяйтесь к обсуждению
Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.