Poprawiono obsługę kuponów w szczegółach zamówienia, aby uniknąć błędów przy braku identyfikatora kuponu.

This commit is contained in:
2025-03-12 08:05:34 +01:00
parent e674ae6f42
commit b5c614d792
5 changed files with 3 additions and 3 deletions

BIN
autoload/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -52,7 +52,7 @@ class ShopOrder
public static function order_details()
{
$order = new \shop\Order( (int)\S::get( 'order_id' ) );
$coupon = new \shop\Coupon( $order -> coupon_id );
$coupon = $order -> coupon_id ? new \shop\Coupon( $order -> coupon_id ) : null;
return \Tpl::view( 'shop-order/order-details', [
'order' => $order,

BIN
autoload/front/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -145,7 +145,7 @@ class ShopOrder
$order = \front\factory\ShopOrder::order_details(
\front\factory\ShopOrder::order_id( \S::get( 'order_hash' ) )
);
$coupon = new \shop\Coupon( $order['coupon_id'] );
$coupon = (int)$order['coupon_id'] ? new \shop\Coupon( (int)$order['coupon_id'] ) : null;
return \Tpl::view( 'shop-order/order-details', [
'order' => $order,

View File

@@ -328,7 +328,7 @@ class Order implements \ArrayAccess
global $settings;
$order = \front\factory\ShopOrder::order_details( $this -> id );
$coupon = new \shop\Coupon( $order['coupon_id'] );
$coupon = (int)$order['coupon_id'] ? new \shop\Coupon( (int)$order['coupon_id'] ) : null;
$mail_order = \Tpl::view( 'shop-order/mail-summary', [
'settings' => $settings,