Usunięto pliki .DS_Store, dodano kolumnę used_count do tabeli pp_shop_coupon, zaktualizowano wersję na 0.227 oraz dodano obsługę kuponów w szczegółach zamówienia.

This commit is contained in:
2025-03-11 23:56:46 +01:00
parent 9bb837d5fc
commit e674ae6f42
21 changed files with 78 additions and 40 deletions

Binary file not shown.

View File

@@ -142,11 +142,14 @@ class ShopOrder
global $page, $settings;
$page['language']['meta_title'] = \S::lang( 'meta-title-szczegoly-zamowienia' ) . ' | ' . $settings['firm_name'];
$order = \front\factory\ShopOrder::order_details(
\front\factory\ShopOrder::order_id( \S::get( 'order_hash' ) )
);
$coupon = new \shop\Coupon( $order['coupon_id'] );
return \Tpl::view( 'shop-order/order-details', [
'order' => \front\factory\ShopOrder::order_details(
\front\factory\ShopOrder::order_id( \S::get( 'order_hash' ) )
),
'order' => $order,
'coupon' => $coupon,
'client' => \S::get_session( 'client' ),
'settings' => $settings
] );

View File

@@ -140,12 +140,14 @@ class ShopOrder
'apilo_order_status_date' => date( 'Y-m-d H:i:s' ),
'sellasist_order_status_date' => date( 'Y-m-d H:i:s' ),
] );
$order_id = $mdb -> id();
if ( !$order_id )
return false;
\Log::save_log( 'Złożono nowe zamówienie | NR: ' . $order_id );
if ( $coupon )
$mdb -> update( 'pp_shop_coupon', [ 'used_count[+]' => 1 ], [ 'id' => $coupon -> id ] );
// ustawienie statusu zamówienia
$mdb -> insert( 'pp_shop_order_statuses', [ 'order_id' => $order_id, 'status_id' => 0, 'mail' => 1 ] );
@@ -217,9 +219,10 @@ class ShopOrder
$order = \front\factory\ShopOrder::order_details( $order_id );
$mail_order = \Tpl::view( 'shop-order/mail-summary', [
'settings' => $settings,
'order' => $order
] );
'settings' => $settings,
'order' => $order,
'coupon' => $coupon,
] );
$settings[ 'ssl' ] ? $base = 'https' : $base = 'http';