Dodanie obsługi kuponów rabatowych w zamówieniach oraz aktualizacja adresów URL do zasobów aktualizacji

This commit is contained in:
2025-03-11 23:56:14 +01:00
parent 39047d4bad
commit af3d46b3d6
15 changed files with 48 additions and 21 deletions

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';