Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created Articles.php for rendering article views including full articles, miniature lists, and news sections. - Added Banners.php for handling banner displays. - Introduced Languages.php for rendering language options. - Implemented Menu.php for dynamic menu rendering. - Developed Newsletter.php for newsletter view rendering. - Created Scontainers.php for rendering specific containers. - Added ShopCategory.php for category descriptions and product listings. - Introduced ShopClient.php for managing client-related views such as address editing and order history. - Implemented ShopPaymentMethod.php for displaying payment methods in the basket. - Created ShopProduct.php for generating product URLs. - Added ShopSearch.php for rendering a simple search form. - Added .htaccess file to enhance security by restricting access to sensitive files and directories.
This commit is contained in:
@@ -1,8 +1,36 @@
|
||||
<?
|
||||
global $db;
|
||||
ob_start();
|
||||
$orderId = (int)($this -> order['id'] ?? 0);
|
||||
?>
|
||||
<div class="details order-details">
|
||||
|
||||
<div class="site-title">Szczegóły zamówienia: <?= htmlspecialchars((string)($this -> order['number'] ?? ''), ENT_QUOTES, 'UTF-8');?></div>
|
||||
|
||||
<div class="mb15">
|
||||
<a href="/admin/shop_order/list/" class="btn btn-dark btn-sm mr5">
|
||||
<i class="fa fa-reply"></i> Wstecz
|
||||
</a>
|
||||
<a href="/admin/shop_order/order_edit/order_id=<?= $orderId;?>" class="btn btn-danger btn-sm mr5">
|
||||
<i class="fa fa-pencil"></i> Edytuj zamówienie
|
||||
</a>
|
||||
|
||||
<? if ( $this -> prev_order_id ):?>
|
||||
<a href="/admin/shop_order/order_details/order_id=<?= (int)$this -> prev_order_id;?>" class="btn btn-success btn-sm mr5">
|
||||
<i class="fa fa-arrow-left"></i> Poprzednie zamówienie
|
||||
</a>
|
||||
<? endif;?>
|
||||
|
||||
<? if ( $this -> next_order_id ):?>
|
||||
<a href="/admin/shop_order/order_details/order_id=<?= (int)$this -> next_order_id;?>" class="btn btn-success btn-sm mr5">
|
||||
<i class="fa fa-arrow-right"></i> Następne zamówienie
|
||||
</a>
|
||||
<? endif;?>
|
||||
|
||||
<button id="integrationsDropdownBtn" type="button" class="btn btn-primary btn-sm pull-right">
|
||||
<i class="fa fa-ellipsis-v"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="details order-details panel">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="row">
|
||||
@@ -45,7 +73,7 @@ ob_start();
|
||||
<div class="panel-body">
|
||||
<div>Kwota zamówienia <b><?= $this -> order[ 'summary' ];?> zł</b></div>
|
||||
<? if ( $this -> coupon ):?>
|
||||
<div>Kod rabatowy: <span style="color: #cc0000;"><?= $this -> coupon -> name;?> - <?= $this -> coupon -> amount;?> <?= $this -> coupon -> type == 1 ? '%' : 'zł';?></span></div>
|
||||
<div>Kod rabatowy: <span style="color: #cc0000;"><?= $this -> coupon['name'];?> - <?= $this -> coupon['amount'];?> <?= $this -> coupon['type'] == 1 ? '%' : 'zł';?></span></div>
|
||||
<? endif;?>
|
||||
<br>
|
||||
<div><?= strip_tags( $this -> order[ 'transport' ] );?>: <b><?= $this -> order[ 'transport_cost' ];?> zł</b></div>
|
||||
@@ -66,12 +94,12 @@ ob_start();
|
||||
<div class="paid-status panel">
|
||||
<div class="panel-body">
|
||||
<? if ( $this -> order['paid'] ):?>
|
||||
<a href="/admin/shop_order/set_order_as_unpaid/order_id=<?= $this -> order['id'];?>" class="set_order_as_unpaid">
|
||||
<a href="/admin/shop_order/set_order_as_unpaid/order_id=<?= $orderId;?>" class="set_order_as_unpaid">
|
||||
<span><i class="fa fa-dollar"></i></span>
|
||||
<b>Oznacz zamówienie jako nieopłacone</b>
|
||||
</a>
|
||||
<? else:?>
|
||||
<a href="/admin/shop_order/set_order_as_paid/order_id=<?= $this -> order['id'];?>" class="set_order_as_paid">
|
||||
<a href="/admin/shop_order/set_order_as_paid/order_id=<?= $orderId;?>" class="set_order_as_paid">
|
||||
<span class="danger"><i class="fa fa-dollar"></i></span>
|
||||
<b>Oznacz zamówienie jako opłacone</b>
|
||||
</a>
|
||||
@@ -100,7 +128,7 @@ ob_start();
|
||||
<button class="btn btn-success order_status_change">zmień status</button>
|
||||
</div>
|
||||
<div class="col-12 order-history">
|
||||
<? if ( \S::is_array_fix( $this -> order['statuses'] ) ): foreach ( $this -> order['statuses'] as $status ):?>
|
||||
<? if ( \Shared\Helpers\Helpers::is_array_fix( $this -> order['statuses'] ) ): foreach ( $this -> order['statuses'] as $status ):?>
|
||||
<div><b><?= date( 'Y-m-d H:i', strtotime( $status['date'] ) );?></b>: <?= $this -> order_statuses[$status['status_id']];?> <? if ( $status['mail'] ):?><i class="fa fa-envelope-o"></i><? endif;?></div>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
@@ -132,7 +160,7 @@ ob_start();
|
||||
<tbody>
|
||||
<? if ( is_array( $this -> order[ 'products' ] ) ): foreach ( $this -> order[ 'products' ] as $product ):?>
|
||||
<?
|
||||
if ( $id = \admin\factory\ShopProduct::get_product_parent_id( $product['product_id'] ) )
|
||||
if ( $id = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getParentId( $product['product_id'] ) )
|
||||
$product_id = $id;
|
||||
else
|
||||
$product_id = $product['product_id'];
|
||||
@@ -140,11 +168,11 @@ ob_start();
|
||||
<tr class="order-product-details">
|
||||
<td class="product-image">
|
||||
<? if ( $product['product_id'] ):?>
|
||||
<img src="<?= \shop\Product::getProductImg( (int)$product_id );?>">
|
||||
<img src="<?= ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getProductImg( (int)$product_id );?>">
|
||||
<? endif;?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= \shop\Product::getProductUrl( (int)$product_id );?>" target="_blank"><?= $product[ 'name' ];?></a>
|
||||
<a href="<?= ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getProductUrl( (int)$product_id );?>" target="_blank"><?= $product[ 'name' ];?></a>
|
||||
<br />
|
||||
<div class="atributes">
|
||||
<?= $product[ 'attributes' ];?>
|
||||
@@ -157,9 +185,9 @@ ob_start();
|
||||
</div>
|
||||
</td>
|
||||
<td class="tab-center"><?= $product[ 'quantity' ];?></td>
|
||||
<td class="tab-right"><?= \S::decimal( $product[ 'price_brutto' ] );?> zł</td>
|
||||
<td class="tab-right"><?= \S::decimal( $product[ 'price_brutto_promo' ] );?> zł</td>
|
||||
<td class="tab-right"><?= \S::decimal( $product[ 'price_brutto_promo' ] * $product[ 'quantity' ] );?> zł</td>
|
||||
<td class="tab-right"><?= \Shared\Helpers\Helpers::decimal( $product[ 'price_brutto' ] );?> zł</td>
|
||||
<td class="tab-right"><?= \Shared\Helpers\Helpers::decimal( $product[ 'price_brutto_promo' ] );?> zł</td>
|
||||
<td class="tab-right"><?= \Shared\Helpers\Helpers::decimal( $product[ 'price_brutto_promo' ] * $product[ 'quantity' ] );?> zł</td>
|
||||
</tr>
|
||||
<? endforeach; endif;?>
|
||||
</tbody>
|
||||
@@ -177,59 +205,11 @@ ob_start();
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
$out = ob_get_clean();
|
||||
|
||||
$grid = new \gridEdit;
|
||||
$grid -> id = 'order-details';
|
||||
$grid -> gdb_opt = $gdb;
|
||||
$grid -> include_plugins = true;
|
||||
$grid -> title = 'Szczegóły zamówienia: ' . $this -> order[ 'number' ];
|
||||
$grid -> buttons = [
|
||||
[
|
||||
'label' => 'Wstecz',
|
||||
'url' => '/admin/shop_order/view_list/',
|
||||
'icon' => 'fa-reply',
|
||||
'class' => 'btn btn-dark btn-sm mr5'
|
||||
], [
|
||||
'label' => 'Edytuj zamówienie',
|
||||
'url' => '/admin/shop_order/order_edit/order_id=' . $this -> order['id'],
|
||||
'icon' => 'fa-pencil',
|
||||
'class' => 'btn btn-danger btn-sm mr5 ml5'
|
||||
]
|
||||
];
|
||||
if ( $this -> prev_order_id )
|
||||
{
|
||||
$grid -> buttons[] = [
|
||||
'label' => 'Poprzednie zamówienie',
|
||||
'url' => '/admin/shop_order/order_details/order_id=' . $this -> prev_order_id,
|
||||
'icon' => 'fa-arrow-left',
|
||||
'class' => 'btn btn-success btn-sm mr5 ml5'
|
||||
];
|
||||
}
|
||||
if ( $this -> next_order_id )
|
||||
{
|
||||
$grid -> buttons[] = [
|
||||
'label' => 'Następne zamówienie',
|
||||
'url' => '/admin/shop_order/order_details/order_id=' . $this -> next_order_id,
|
||||
'icon' => 'fa-arrow-right',
|
||||
'class' => 'btn btn-success btn-sm mr5 ml5'
|
||||
];
|
||||
}
|
||||
$grid -> buttons[] = [
|
||||
'label' => '',
|
||||
'url' => '#',
|
||||
'icon' => 'fa-ellipsis-v',
|
||||
'class' => 'btn btn-primary',
|
||||
'id' => 'integrationsDropdownBtn'
|
||||
];
|
||||
$grid -> default_buttons = false;
|
||||
$grid -> external_code = $out;
|
||||
echo $grid -> draw();
|
||||
?>
|
||||
<div class="dropdown-menu dropdown-menu-right" id="integrationsDropdownMenu">
|
||||
<a class="dropdown-item btn-send-order-to-apilo" href="/admin/shop_order/send_order_to_apilo/order_id=<?= $this -> order['id'];?>">
|
||||
<a class="dropdown-item btn-send-order-to-apilo" href="/admin/shop_order/send_order_to_apilo/order_id=<?= $orderId;?>">
|
||||
<i class="fa fa-refresh"></i> Wyślij ponownie zamówienie do apilo.com
|
||||
</a>
|
||||
<a class="dropdown-item btn-toggle-trustmate" href="#">
|
||||
@@ -237,452 +217,7 @@ echo $grid -> draw();
|
||||
<?= $this -> order['trustmate_send'] ? 'Odznacz zamówienie jako wysłane do trustmate.io' : 'Zaznacz zamówienie jako wysłane do trustmate.io';?>
|
||||
</a>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( function() {
|
||||
var btn = $( '#integrationsDropdownBtn' );
|
||||
var menu = $( '#integrationsDropdownMenu' );
|
||||
|
||||
// Opakuj przycisk w dropdown wrapper
|
||||
btn.wrap( '<div class="dropdown d-inline-block pull-right"></div>' );
|
||||
menu.appendTo( btn.parent() );
|
||||
|
||||
// Ręczna obsługa toggle dropdown
|
||||
btn.on( 'click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
menu.toggleClass( 'show' );
|
||||
});
|
||||
|
||||
// Zamknij dropdown po kliknięciu poza nim
|
||||
$( document ).on( 'click', function(e) {
|
||||
if ( !btn.is( e.target ) && !menu.is( e.target ) && menu.has( e.target ).length === 0 ) {
|
||||
menu.removeClass( 'show' );
|
||||
}
|
||||
});
|
||||
});
|
||||
$( function()
|
||||
{
|
||||
var timer = '';
|
||||
$( '#notes' ).keyup( function()
|
||||
{
|
||||
var _this = $( this);
|
||||
clearTimeout( timer );
|
||||
timer = setTimeout( function()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/shop_order/notes_save/',
|
||||
data:
|
||||
{
|
||||
order_id: <?= $this -> order['id'];?>,
|
||||
notes: _this.val()
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
var time = 0;
|
||||
}
|
||||
});
|
||||
}, 500 );
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'click', '.btn-send-order-to-apilo', function(e) {
|
||||
e.preventDefault();
|
||||
var href = $( this ).attr( 'href' );
|
||||
$.alert({
|
||||
title: 'Potwierdź',
|
||||
content: 'Czy na pewno chcesz wysłać zamówienie do apilo.com?',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-question',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Tak',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
document.location.href = href;
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: 'Nie',
|
||||
btnClass: 'btn-dark',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// set_order_as_unpaid
|
||||
$( 'body' ).on( 'click', '.set_order_as_unpaid', function(e) {
|
||||
var href = $( this ).attr( 'href' );
|
||||
$.alert({
|
||||
title: 'Pytanie',
|
||||
content: 'Zmienić zamówienie na nieopłacone?',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-question',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Tak',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
document.location.href = href;
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: 'Nie',
|
||||
btnClass: 'btn-dark',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// set_order_as_paid
|
||||
$( 'body' ).on( 'click', '.set_order_as_paid', function(e) {
|
||||
var href = $( this ).attr( 'href' );
|
||||
$.alert({
|
||||
title: 'Pytanie',
|
||||
content: 'Zmienić zamówienie na opłacone?',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-question',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Tak',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
document.location.href = href;
|
||||
}
|
||||
},
|
||||
confirm2: {
|
||||
text: 'Tak (wyślij mail)',
|
||||
btnClass: 'btn-primary',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
document.location.href = href + '&send_mail=1';
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: 'Nie',
|
||||
btnClass: 'btn-dark',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('body').on('click', '.order_status_change_email', function() {
|
||||
$.alert({
|
||||
title: 'Pytanie',
|
||||
content: 'Na pewno chcesz wysłać mail o zmianie statusu?',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-question',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Tak',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
order_status_change(<?= $this -> order[ 'id' ];?>, $('#order-status').val(), true);
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: 'Nie',
|
||||
btnClass: 'btn-dark',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'click', '.resend_order_confirmation_email button', function() {
|
||||
$.alert({
|
||||
title: 'Pytanie',
|
||||
content: 'Na pewno chcesz wysłać mail o złożonym zamówieniu?',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-question',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Tak',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function()
|
||||
{
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/shop_order/order_resend_confirmation_email/',
|
||||
data: {
|
||||
order_id: <?= $this -> order['id'];?>
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
$( '#overlay' ).show();
|
||||
},
|
||||
success: function(response)
|
||||
{
|
||||
$( '#overlay' ).hide();
|
||||
|
||||
data = jQuery.parseJSON(response);
|
||||
|
||||
if ( data.result === true )
|
||||
{
|
||||
return $.alert({
|
||||
title: 'Informacja',
|
||||
content: 'Wiadomość została wysłana',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|10000',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-info',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ( data.result === false)
|
||||
{
|
||||
return $.alert({
|
||||
title: 'Błąd',
|
||||
content: 'Podczas wysyłania wiadomości wystąpił błąd',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-danger',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: 'Nie',
|
||||
btnClass: 'btn-dark',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('body').on('click', '.order_status_change', function() {
|
||||
order_status_change(<?= $this -> order[ 'id' ];?>, $('#order-status').val(), false);
|
||||
return false;
|
||||
});
|
||||
|
||||
function order_status_change($order_id, $status, $email) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/shop_order/order_status_change/',
|
||||
data: {
|
||||
order_id: $order_id,
|
||||
status: $status,
|
||||
email: $email
|
||||
},
|
||||
beforeSend: function() {
|
||||
$('#overlay').show();
|
||||
},
|
||||
success: function(response) {
|
||||
$('#overlay').hide();
|
||||
|
||||
data = jQuery.parseJSON(response);
|
||||
|
||||
if (data.email === true) {
|
||||
return $.alert({
|
||||
title: 'Informacja',
|
||||
content: 'Wiadomość o zmiane statusu została wysłana',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|10000',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-info',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (data.email === false) {
|
||||
return $.alert({
|
||||
title: 'Błąd',
|
||||
content: 'Podczas wysyłania wiadomości wystąpił błąd',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-exclamation',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-danger',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (data.result == true) {
|
||||
return $.alert({
|
||||
title: 'Informacja',
|
||||
content: 'Status zamówienia został zmieniony',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|10000',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-info',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Zamknij',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( 'body' ).on( 'click', '.btn-toggle-trustmate', function(e) {
|
||||
e.preventDefault();
|
||||
var currentState = <?= $this -> order['trustmate_send'] ? 'true' : 'false';?>;
|
||||
|
||||
$.alert({
|
||||
title: 'Potwierdź',
|
||||
content: currentState ? 'Czy na pewno chcesz odznaczyć zamówienie jako wysłane do trustmate.io?' : 'Czy na pewno chcesz zaznaczyć zamówienie jako wysłane do trustmate.io?',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-question',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Tak',
|
||||
btnClass: 'btn-success',
|
||||
keys: ['enter'],
|
||||
action: function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/shop_order/toggle_trustmate_send/',
|
||||
data: {
|
||||
order_id: <?= $this -> order['id'];?>
|
||||
},
|
||||
beforeSend: function() {
|
||||
$( '#overlay' ).show();
|
||||
},
|
||||
success: function( response ) {
|
||||
$( '#overlay' ).hide();
|
||||
var data = jQuery.parseJSON( response );
|
||||
if ( data.result === true ) {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: 'Nie',
|
||||
btnClass: 'btn-dark',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?= \Shared\Tpl\Tpl::view('shop-order/order-details-custom-script', [
|
||||
'order_id' => $orderId,
|
||||
'trustmate_send' => (int)($this -> order['trustmate_send'] ?? 0),
|
||||
]);?>
|
||||
Reference in New Issue
Block a user