first commit
This commit is contained in:
147
templates/shop-order/mail-summary.php
Normal file
147
templates/shop-order/mail-summary.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?
|
||||
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;?>
|
||||
</p>
|
||||
<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;?>
|
||||
<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'];?>
|
||||
191
templates/shop-order/order-details.php
Normal file
191
templates/shop-order/order-details.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<? global $config; $this -> settings['ssl'] ? $base = 'https' : $base = 'http';?>
|
||||
<div class="order-summary">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'szczegoly-zamowienia' ) );?>: <?= $this -> order['number'];?>
|
||||
</div>
|
||||
<?= \Tpl::view( 'shop-order/order-simple', [
|
||||
'order' => $this -> order,
|
||||
'statuses' => \shop\Order::order_statuses()
|
||||
] );?>
|
||||
<? if ( $this -> order['status'] == 0 or $this -> order['status'] == 2 ):?>
|
||||
<div class="order-bottom">
|
||||
<div class="left">
|
||||
<div class="content">
|
||||
<div class="box-title"><?= ucfirst( \S::lang( 'dane-do-przelewu' ) );?>:</div>
|
||||
<?= str_replace( [ '[KWOTA]', '[NR-ZAMOWIENIA]' ], [ \S::decimal( $this -> order['summary'] ) . ' zł', $this -> order['number'] ], $this -> settings['shop_bank_account_info'] );?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="content">
|
||||
<div class="box-title"><?= $this -> order['payment_method_id'] == 6 ? 'Zapłać za pomocą PAYPO' : ucfirst( \S::lang( 'platnosc-online' ) );?>:</div>
|
||||
<? if ( $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ):?>
|
||||
<div class="payment-info">Co prawda nie wybrałeś żadnej z dostępnych form "szybkich płatności", ale w każdej chwili możesz z nich skorzystać.</div>
|
||||
<? endif;?>
|
||||
<? if ( ( $this -> order['payment_method_id'] == 2 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and \front\factory\ShopPaymentMethod::is_payment_active( 2 ) ):?>
|
||||
<form id="order" action="https://platnosc.hotpay.pl/" method="post">
|
||||
<input required name="SEKRET" value="<?= $this -> settings['hotpay_api'];?>" type="hidden">
|
||||
<input required name="KWOTA" value="<?= round( $this -> order['summary'], 2 );?>" type="hidden">
|
||||
<input required name="NAZWA_USLUGI" value="Zamówienie nr <?= $this -> order['number'];?>" type="hidden">
|
||||
<input required name="ADRES_WWW" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/zamowienie/<?= $this -> order['hash'];?>" type="hidden">
|
||||
<input required name="ID_ZAMOWIENIA" value="<?= $this -> order['id'];?>" type="hidden">
|
||||
<input name="EMAIL" value="<?= $this -> order['client_email'];?>" type="hidden">
|
||||
<input name="DANE_OSOBOWE" value="" type="hidden">
|
||||
<div class="form-group row agreement">
|
||||
<div class="col-12">
|
||||
<input type="checkbox" required id="agreement"> <?= \S::lang( 'akceptuje-regulamin-sklepu' );?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row agreement">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?> <b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<? endif;?>
|
||||
<? if ( $this -> order['payment_method_id'] == 6 and \front\factory\ShopPaymentMethod::is_payment_active( 6 ) ):?>
|
||||
<?
|
||||
global $mdb;
|
||||
$przelewy24_hash = md5( time() );
|
||||
$mdb -> update( 'pp_shop_orders', [ 'przelewy24_hash' => $przelewy24_hash ], [ 'id' => $this -> order['id'] ] );
|
||||
?>
|
||||
<form action="<?= $this -> settings['przelewy24_sandbox'] ? 'https://sandbox.przelewy24.pl/trnDirect' : 'https://secure.przelewy24.pl/trnDirect';?>" method="post" class="form" accept-charset="ISO-8859-2">
|
||||
<input type="hidden" name="p24_session_id" value="<?= $przelewy24_hash;?>" />
|
||||
<input type="hidden" name="p24_merchant_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
|
||||
<input type="hidden" name="p24_pos_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
|
||||
<input type="hidden" name="p24_amount" value="<?= $this -> order['summary'] * 100;?>" />
|
||||
<input type="hidden" name="p24_currency" value="PLN" />
|
||||
<input type="hidden" name="p24_description" value="Zamówienie nr <?= $this -> order['number'];?>" />
|
||||
<input type="hidden" name="p24_client" value="<?= $this -> order['client_name'] . ' ' . $this -> order['client_surname'];?>" />
|
||||
<input type="hidden" name="p24_address" value="<?= $this -> order['client_street'];?>" />
|
||||
<input type="hidden" name="p24_zip" value="<?= $this -> order['client_postal_code'];?>" />
|
||||
<input type="hidden" name="p24_city" value="<?= $this -> order['client_city'];?>" />
|
||||
<input type="hidden" name="p24_country" value="PL" />
|
||||
<input type="hidden" name="p24_email" value="<?= $this -> order['client_email'];?>" />
|
||||
<input type="hidden" name="p24_language" value="pl" />
|
||||
<input type="hidden" name="p24_url_return" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/potwierdzenie-platnosci/<?= $this -> order['hash'];?>" />
|
||||
<input type="hidden" name="p24_url_status" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/przelewy24-status" />
|
||||
<input type="hidden" name="p24_api_version" value="3.2" />
|
||||
<input type="hidden" name="p24_wait_for_result" value="1">
|
||||
<input type="hidden" name="p24_method" value="227">
|
||||
<input type="hidden" name="p24_sign" value="<?= md5( $przelewy24_hash . '|' . $this -> settings['przelewy24_merchant_id'] . '|' . ( $this -> order['summary'] * 100 ) . '|PLN|' . $this -> settings['przelewy24_crc_key'] );?>" />
|
||||
<button type="submit" name="submit_send" class="btn btn-success">Zapłać za pomocą PAYPO <b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
|
||||
</form>
|
||||
<? endif;?>
|
||||
<? if ( $this -> order['payment_method_id'] == 6 ):?>
|
||||
<div class="box-title">lub skorzystaj z płatności online</div>
|
||||
<? endif;?>
|
||||
<? if ( ( $this -> order['payment_method_id'] == 6 or $this -> order['payment_method_id'] == 4 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and \front\factory\ShopPaymentMethod::is_payment_active( 4 ) ):?>
|
||||
<?
|
||||
global $mdb;
|
||||
$przelewy24_hash = md5( time() );
|
||||
$mdb -> update( 'pp_shop_orders', [ 'przelewy24_hash' => $przelewy24_hash ], [ 'id' => $this -> order['id'] ] );
|
||||
?>
|
||||
<form action="<?= $this -> settings['przelewy24_sandbox'] ? 'https://sandbox.przelewy24.pl/trnDirect' : 'https://secure.przelewy24.pl/trnDirect';?>" method="post" class="form" accept-charset="ISO-8859-2">
|
||||
<input type="hidden" name="p24_session_id" value="<?= $przelewy24_hash;?>" />
|
||||
<input type="hidden" name="p24_merchant_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
|
||||
<input type="hidden" name="p24_pos_id" value="<?= $this -> settings['przelewy24_merchant_id'];?>" />
|
||||
<input type="hidden" name="p24_amount" value="<?= $this -> order['summary'] * 100;?>" />
|
||||
<input type="hidden" name="p24_currency" value="PLN" />
|
||||
<input type="hidden" name="p24_description" value="Zamówienie nr <?= $this -> order['number'];?>" />
|
||||
<input type="hidden" name="p24_client" value="<?= $this -> order['client_name'] . ' ' . $this -> order['client_surname'];?>" />
|
||||
<input type="hidden" name="p24_address" value="<?= $this -> order['client_street'];?>" />
|
||||
<input type="hidden" name="p24_zip" value="<?= $this -> order['client_postal_code'];?>" />
|
||||
<input type="hidden" name="p24_city" value="<?= $this -> order['client_city'];?>" />
|
||||
<input type="hidden" name="p24_country" value="PL" />
|
||||
<input type="hidden" name="p24_email" value="<?= $this -> order['client_email'];?>" />
|
||||
<input type="hidden" name="p24_language" value="pl" />
|
||||
<input type="hidden" name="p24_url_return" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/potwierdzenie-platnosci/<?= $this -> order['hash'];?>" />
|
||||
<input type="hidden" name="p24_url_status" value="<?= $base . "://" . $_SERVER['SERVER_NAME'];?>/przelewy24-status" />
|
||||
<input type="hidden" name="p24_api_version" value="3.2" />
|
||||
<input type="hidden" name="p24_wait_for_result" value="1">
|
||||
<input type="hidden" name="p24_sign" value="<?= md5( $przelewy24_hash . '|' . $this -> settings['przelewy24_merchant_id'] . '|' . ( $this -> order['summary'] * 100 ) . '|PLN|' . $this -> settings['przelewy24_crc_key'] );?>" />
|
||||
<button type="submit" name="submit_send" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?> <b><?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
|
||||
</form>
|
||||
<? endif;?>
|
||||
<?
|
||||
if ( ( $this -> order['payment_method_id'] == 6 or $this -> order['payment_method_id'] == 5 or $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) and \front\factory\ShopPaymentMethod::is_payment_active( 5 ) ):
|
||||
|
||||
$url = 'https://secure.tpay.com';
|
||||
|
||||
$this -> settings['tpay_sandbox'] ? $id = '1010' : $id = $this -> settings['tpay_id'];
|
||||
$this -> settings['tpay_sandbox'] ? $code = 'demo' : $code = $this -> settings['tpay_security_code'];
|
||||
$this -> settings['tpay_sandbox'] ? $email = 'biuro@project-pro.pl' : $email = 'sklep@marianek.pl';
|
||||
|
||||
$url .= '?id=' . $id;
|
||||
$url .= '&kwota=' . str_replace( ',', '.', round( $this -> order['summary'], 2 ) );
|
||||
$url .= '&opis=' . urlencode( 'Zamówienie nr ' . $this -> order['number'] );
|
||||
$url .= '&wyn_email=' . urlencode( $email );
|
||||
$url .= '&email=' . urlencode( $this -> order['client_email'] );
|
||||
$url .= '&nazwisko=' . urlencode( $this -> order['client_name'] . ' ' . $this -> order['client_surname'] );
|
||||
$url .= '&crc=' . $this -> order['hash'];
|
||||
$url .= '&result_url=' . urlencode( $base . "://" . $_SERVER['SERVER_NAME'] . '/tpay-status' );
|
||||
$url .= '&return_url=' . urlencode( $base . "://" . $_SERVER['SERVER_NAME'] . '/potwierdzenie-platnosci/' . $this -> order['hash'] );
|
||||
$url .= '&return_error_url=' . urlencode( $base . "://" . $_SERVER['SERVER_NAME'] . '/zamowienie/' . $this -> order['hash'] );
|
||||
$url .= '&md5sum=' . md5( $id . '&' . str_replace( ',', '.', round( $this -> order['summary'], 2 ) ) . '&' . $this -> order['hash'] . '&' . $code );
|
||||
?>
|
||||
<button type="button" onclick="document.location.href='<?= $url;?>'" class="btn btn-success"><?= \S::lang( 'zaplac-online' );?> <?= \S::decimal( $this -> order['summary'] );?> zł</b></button>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<? if ( \S::get_session( 'ekomi-purchase' ) and $this -> settings['ekomi_survey'] and ( $this -> order['payment_method_id'] == 1 or $this -> order['payment_method_id'] == 3 ) ):?>
|
||||
<? unset( $_SESSION['ekomi-purchase'] );?>
|
||||
<?= $this -> settings['ekomi_survey'];?>
|
||||
<? endif;?>
|
||||
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/grid/plugins/icheck/skins/minimal/minimal.css">
|
||||
<script class="footer" type="text/javascript" src="/libraries/grid/plugins/icheck/icheck.min.js"></script>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
jQuery( '#order-payment input[type="checkbox"]' ).iCheck({
|
||||
checkboxClass: 'icheckbox_minimal-blue',
|
||||
radioClass: 'iradio_minimal-blue'
|
||||
});
|
||||
|
||||
<? if ( \S::get_session( 'piksel_purchase' ) and $this -> settings[ 'piksel' ] ):?>
|
||||
<? unset( $_SESSION['piksel_purchase'] );?>
|
||||
fbq(
|
||||
'track',
|
||||
'Purchase', {
|
||||
currency: 'PLN',
|
||||
value: <?= str_replace( ',', '.', round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
|
||||
content_type: 'product',
|
||||
contents: [
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
{ id: <?= (int)$product['product_id'];?>, quantity: <?= $product['quantity'];?> }<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
|
||||
<? endforeach;?>
|
||||
]
|
||||
} );
|
||||
<? endif;?>
|
||||
|
||||
<? if ( \S::get_session('google-analytics-purchase') ):?>
|
||||
|
||||
<? if ( $this -> settings['google_tag_manager_id'] ):?>
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
event: "purchase",
|
||||
ecommerce: {
|
||||
transaction_id: "<?= $this -> order['id'];?>",
|
||||
value: 25.42,
|
||||
currency: "PLN",
|
||||
value: <?= \S::normalize_decimal( round( $this -> order['summary'], 2 ) ) - str_replace( ',', '.', round( $this -> order['transport_cost'], 2 ) );?>,
|
||||
shipping: <?= \S::normalize_decimal( $this -> order['transport_cost'] );?>,
|
||||
items: [
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
{
|
||||
'id': <?= (int)$product['product_id'];?>,
|
||||
'name': '<?= $product['name'];?>',
|
||||
'quantity': <?= $product['quantity'];?>,
|
||||
'price': <?= $product['price_brutto_promo'];?>
|
||||
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
|
||||
<? endforeach;?>
|
||||
]
|
||||
}
|
||||
});
|
||||
<? endif;?>
|
||||
<? unset( $_SESSION['google-analytics-purchase'] );?>
|
||||
<? endif;?>
|
||||
});
|
||||
</script>
|
||||
76
templates/shop-order/order-simple.php
Normal file
76
templates/shop-order/order-simple.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<div class="order-summary-content">
|
||||
<div class="top">
|
||||
<div class="basket-summary left">
|
||||
Data zamówienia: <span><?= \S::pretty_date( 'j f Y', strtotime( $this -> order['date_order'] ) );?></span>
|
||||
</div>
|
||||
<div class="basket-summary left">
|
||||
Status zamówienia: <span><?= $this -> statuses[ $this -> order['status'] ];?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="products">
|
||||
<? if ( is_array( $this -> order['products'] ) and count( $this -> order['products'] ) ):?>
|
||||
<? foreach ( $this -> order['products'] as $product ):?>
|
||||
<? $product_tmp = \shop\Product::getFromCache( $product['product_id'], $lang['id'] );?>
|
||||
<div class="basket-product">
|
||||
<div class="image">
|
||||
<? if ( file_exists( substr( $product_tmp['images'][0]['src'], 1 ) ) ):?>
|
||||
<img class="main-img" src="<?= $product_tmp['images'][0]['src'];?>" alt="">
|
||||
<? else:?>
|
||||
|
||||
<? endif;?>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="name">
|
||||
<?= $product['name'];?>
|
||||
<div class="attributes">
|
||||
<?= $product['attributes'];?>
|
||||
</div>
|
||||
<div class="custom-fields">
|
||||
<?= $product['custom_fields'];?>
|
||||
</div>
|
||||
<div class="product-message">
|
||||
<?= $product['message'] != '' ? '<strong>Wiadomość:</strong> ' . $product['message'] : '';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prices">
|
||||
<div class="price">
|
||||
<?
|
||||
echo \S::decimal( $product['price_brutto_promo'] ) . ' zł';
|
||||
|
||||
if ( $product['price_brutto_promo'] and $product['price_brutto_promo'] < $product['price_brutto'] )
|
||||
echo '<u>' . \S::decimal( $product['price_brutto'] ) . ' zł</u>';
|
||||
|
||||
if ( $product['price_brutto_promo'] and $product['price_brutto_promo'] < $product['price_brutto'] )
|
||||
$discount += \S::normalize_decimal( ( $product['price_brutto'] - $product['price_brutto_promo'] ) * $product['quantity'] );
|
||||
?>
|
||||
<span>x <?= $product['quantity'];?></span>
|
||||
<?= \S::decimal( \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] ) );?> zł
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? $summary += \S::normalize_decimal( $product['price_brutto'] * $product['quantity'] );?>
|
||||
<? endforeach;?>
|
||||
<div class="basket-summary">
|
||||
Wartość koszyka <span><?= \S::decimal( $summary );?> zł</span>
|
||||
</div>
|
||||
<? if ( $discount ):?>
|
||||
<div class="basket-summary">
|
||||
Rabat <span class="text-danger"><?= \S::decimal( $discount );?> zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="basket-summary">
|
||||
<?= $this -> order['transport'];?> <span><?= \S::decimal( $this -> order['transport_cost'] );?> zł</span>
|
||||
</div>
|
||||
<div class="basket-summary big">
|
||||
<?= ucfirst( \S::lang( 'razem-z-dostawa' ) );?>: <span><?= \S::decimal( $summary - $discount + $this -> order['transport_cost'] );?> zł</span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( $this -> order['message'] ):?>
|
||||
<div class="basket-summary">
|
||||
Wiadomość:
|
||||
<span class="comment"><?= $this -> order['message'];?></span>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
</div>
|
||||
31
templates/shop-order/payment-confirmation.php
Normal file
31
templates/shop-order/payment-confirmation.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<? if ( $this -> order['status'] == 1 ):?>
|
||||
<div id="payment-confirmation">
|
||||
<div class="bold blue text-center">Płatność została zatwierdzona. Dziękujemy za wybranie naszych usług.</div>
|
||||
<div class="text-center">Nasz system zweryfikuje Państwa zamówienie w ciągu kilku minut.</div>
|
||||
<p></p>
|
||||
<table class="table table-stripped table-bordered payment-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center" colspan="2">Informacje o płatności</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-bold">Zamówienie nr:</td><td><?= $this -> order['number'];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-bold">Data transakcji:</td><td><?= date( 'Y-m-d H:i', strtotime( $this -> order['date_order'] ) );?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" class="text-right"><a href="/zamowienie/<?= $this -> order['hash'];?>" class="btn btn-success">Powrót do zamówienia</a></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? if ( \S::get_session( 'ekomi-purchase' ) and $this -> settings['ekomi_survey'] ):?>
|
||||
<? unset( $_SESSION['ekomi-purchase'] );?>
|
||||
<?= $this -> settings['ekomi_survey'];?>
|
||||
<? endif;?>
|
||||
Reference in New Issue
Block a user