168 lines
9.6 KiB
PHP
168 lines
9.6 KiB
PHP
<?
|
|
global $lang_id;
|
|
|
|
if ( $this -> settings['ssl'] ) $base = 'https'; else $base = 'http';
|
|
echo $this -> settings['newsletter_header'];
|
|
?>
|
|
<p style="font-family: Arial; font-size: 14px; font-weight: normal; margin-bottom: 25px;"><?= ucfirst( \S::lang( 'podsumowanie-zamowienia' ) );?> <?= \S::lang( 'nr' );?> <strong><?= $this -> order['number'];?></strong> <?= \S::lang( 'z-dnia' );?> <strong><?= date( 'd.m.Y H:i', strtotime( $this -> order['date_order'] ) );?></strong></p>
|
|
<p><a href="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/zamowienie/<?= $this -> order['hash'];?>" style="display: block; width: 200px; text-align: center; padding: 10px; background: #77cdd1; color: #FFF; text-decoration: none; text-transform: uppercase;"><?= \S::lang( 'szczegoly-zamowienia' );?></a></p>
|
|
<? if ( is_array( $this -> order['products'] ) ): foreach ( $this -> order['products'] as $product ):?>
|
|
<? $summary_tmp += \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
|
<? $quantity += $product['quantity'];?>
|
|
<? endforeach; endif;?>
|
|
<?
|
|
if ( $this -> order['coupon_amount'] ) {
|
|
if ( $this -> order['coupon_type'] === '1' ) {
|
|
$summary_tmp = $summary_tmp - $summary_tmp * $this -> order['coupon_amount'] / 100;
|
|
}
|
|
}
|
|
?>
|
|
<? $summary_tmp += $this -> order['transport_cost'];?>
|
|
<? if ( $this -> order['payment_method_id'] == 1 ):?>
|
|
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
|
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-przelewu' );?>:</p>
|
|
<div style="font-family: Arial; font-size: 14px;">
|
|
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \S::decimal( $summary_tmp ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
|
|
</div>
|
|
<? endif;?>
|
|
|
|
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
|
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-dostawy' );?>:</p>
|
|
<p style="font-family: Arial; font-size: 14px; ">
|
|
<?= $this -> order['client_surname'];?> <?= $this -> order['client_name'];?><br />
|
|
<?= $this -> order['client_street'];?><br />
|
|
<?= $this -> order['client_postal_code'];?> <?= $this -> order['client_city'];?><br />
|
|
<?= $this -> order['client_email'];?><br />
|
|
<?= $this -> order['client_phone'];?>
|
|
<? if ( $this -> order['inpost_paczkomat'] ):?>
|
|
<br /><br />Paczkomat: <b><?= $this -> order['inpost_paczkomat'];?>
|
|
<? endif;?>
|
|
<? if ( $this -> order['orlen_point'] ):?>
|
|
<br /><br />Punkt Orlen: <b><?= $this -> order['orlen_point'];?>
|
|
<? endif;?>
|
|
</p>
|
|
<? if ( $this -> order['firm_name'] ):?>
|
|
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
|
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'dane-do-faktury' );?>:</p>
|
|
<p style="font-family: Arial; font-size: 14px; margin-top: 15px;">
|
|
<?= $this -> order['firm_name'];?><br />
|
|
<?= $this -> order['firm_street'];?><br />
|
|
<?= $this -> order['firm_postal_code'];?> <?= $this -> order['firm_city'];?><br />
|
|
NIP: <?= $this -> order['firm_nip'];?>
|
|
</p>
|
|
<? endif;?>
|
|
<div style="border-bottom: 1px solid #eee; margin-bottom: 15px;"></div>
|
|
<p style="font-family: Arial; font-size: 14px; font-weight: 600; text-transform: uppercase;"><?= \S::lang( 'zamowione-produkty' );?>:</p>
|
|
<table style="font-family: Arial; width: 100%; max-width: 800px; border-collapse: collapse; font-size: 14px; margin-bottom: 25px;">
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align: left; border-bottom: 1px solid #ccc;"><?= ucfirst( \S::lang( 'produkt' ) );?></th>
|
|
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'cena' ) );?></th>
|
|
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'ilosc' ) );?></th>
|
|
<th style="text-align: right; border-bottom: 1px solid #ccc; padding: 0 5px;"><?= ucfirst( \S::lang( 'razem' ) );?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<? if ( is_array( $this -> order['products'] ) ): foreach ( $this -> order['products'] as $position ):?>
|
|
<? $product = \shop\Product::getFromCache( $position['product_id'], $lang_id );?>
|
|
<tr style="border-bottom: 1px solid #eee;">
|
|
<td style="padding: 10px 10px 10px 0;" colspan="4">
|
|
<?
|
|
$product['language']['seo_link'] ? $url = '/' . $product['language']['seo_link'] : $url = '/p-' . $product['id'] . '-' . \S::seo( $product['language']['name'] );
|
|
|
|
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
|
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
|
|
|
$regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|http://).)*)(['\"][^>]*>)-i";
|
|
echo preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", '<a href="' . $url . '" target="_blank" style="text-decoration: none; color: #77cdd1; font-size: 14px; font-weight: bold;">' . $product['language']['name'] . '</a>' );
|
|
|
|
if ( $position['attributes'] ):?>
|
|
<div style="font-size: 13px; margin: 10px 0 0;">
|
|
<?= $position['attributes'];?>
|
|
</div>
|
|
<? endif;
|
|
|
|
// custom fields
|
|
if ( $position['custom_fields'] ):?>
|
|
<div style="font-size: 13px; margin: 10px 0 0;">
|
|
<?= $position['custom_fields'];?>
|
|
</div>
|
|
<? endif;
|
|
|
|
if ( $position['message'] ):?>
|
|
<div style="font-size: 13px; margin: 10px 0 0;">
|
|
<strong>Wiadomość:</strong> <?= $position['message'];?>
|
|
</div>
|
|
<? endif;
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr style="border-bottom: 1px solid #eee;">
|
|
<td style="padding: 10px 10px 10px 0; width: 135px;">
|
|
<?
|
|
$regex = "-(<img[^>]+src\s*=\s*['\"])(((?!'|\"|http://).)*)(['\"][^>]*>)-i";
|
|
echo preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", '<img src="' . $product['images'][0]['src'] . '" style="width: 100%; max-width: 125px;">' );
|
|
?>
|
|
</td>
|
|
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
|
<?
|
|
echo \S::decimal( $position['price_brutto_promo'] ) . ' zł';
|
|
|
|
if ( $position['price_brutto_promo'] and $position['price_brutto_promo'] < $position['price_brutto'])
|
|
echo '<u style="font-size: 15px; font-weight: 400; color: #c3c3c3; margin-left: 5px; text-decoration: line-through;">' . \S::decimal( $position['price_brutto'] ) . ' zł</u>';
|
|
|
|
if ( $position['price_brutto_promo'] and $position['price_brutto_promo'] < $position['price_brutto'] )
|
|
$discount += \S::normalize_decimal( ( $position['price_brutto'] - $position['price_brutto_promo'] ) * $position['quantity'] );
|
|
?>
|
|
</td>
|
|
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
|
<?= $position['quantity'];?>
|
|
</td>
|
|
<td style="text-align: right; white-space: nowrap; padding: 0 5px;">
|
|
<?= \S::decimal( \S::normalize_decimal( $position['price_brutto_promo'] * $position['quantity'] ) );?> zł
|
|
</td>
|
|
</tr>
|
|
<? $summary += \S::normalize_decimal( $position['price_brutto'] * $position['quantity'] );?>
|
|
<? $quantity += $position['quantity'];?>
|
|
<? endforeach; endif;?>
|
|
<tr>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="3">Wartość koszyka:</td>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px; white-space: nowrap;"><?= \S::decimal( $summary );?> zł</td>
|
|
</tr>
|
|
<? if ( $discount ):?>
|
|
<tr>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="4">
|
|
Rabat: <span style="color: #cc0000;">-<?= \S::decimal( $discount );?> zł</span>
|
|
</td>
|
|
</tr>
|
|
<? endif;?>
|
|
<? if ( $this -> coupon ):?>
|
|
<tr>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="4">
|
|
Kod rabatowy: <span style="color: #cc0000;"><?= $this -> coupon -> name;?> - <?= $this -> coupon -> amount;?> <?= $this -> coupon -> type == 1 ? '%' : 'zł';?></span>
|
|
</td>
|
|
</tr>
|
|
<? endif;?>
|
|
<tr>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px;" colspan="4"><?= $this -> order['payment_method'];?></td>
|
|
</tr>
|
|
<tr style="border-bottom: 1px solid #eee;">
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= $this -> order['transport'];?><div style="font-weight: 500; font-size: 13px; line-height: 16px; font-style: italic; margin-top: 5px;"><?= $this -> order['transport_description'];?></div></td>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \S::decimal( $this -> order['transport_cost'] );?> zł</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="3"><?= ucfirst( \S::lang( 'razem' ) );?>:</td>
|
|
<td style="text-align: right; font-weight: 600; padding-top: 10px; padding-bottom: 10px; white-space: nowrap;"><?= \S::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</td>
|
|
</tr>
|
|
<? if ( $this -> order['message'] ):?>
|
|
<tr style="border-top: 1px solid #eee;">
|
|
<td style="text-align: left; font-weight: 600; padding-top: 10px; padding-bottom: 10px;" colspan="4">
|
|
Wiadomość:
|
|
<?= $this -> order['message'];?>
|
|
</td>
|
|
</tr>
|
|
<? endif;?>
|
|
</tbody>
|
|
</table>
|
|
<?= $this -> settings['newsletter_footer'];?>
|