Usunięcie plików .DS_Store oraz poprawa obsługi kuponów w klasach ShopOrder i Coupon
This commit is contained in:
BIN
autoload/.DS_Store
vendored
BIN
autoload/.DS_Store
vendored
Binary file not shown.
@@ -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
BIN
autoload/front/.DS_Store
vendored
Binary file not shown.
@@ -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,
|
||||
|
||||
@@ -5,6 +5,7 @@ class Coupon implements \ArrayAccess
|
||||
public function __construct( int $element_id )
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
if ( $element_id )
|
||||
{
|
||||
$result = $mdb -> get( 'pp_shop_coupon', '*', [ 'id' => $element_id ] );
|
||||
@@ -46,7 +47,7 @@ class Coupon implements \ArrayAccess
|
||||
|
||||
public function __get( $variable )
|
||||
{
|
||||
if ( array_key_exists( $variable, $this -> data ) )
|
||||
if ( is_array( $this -> data ) and array_key_exists( $variable, $this -> data ) )
|
||||
return $this -> $variable;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
BIN
templates/.DS_Store
vendored
BIN
templates/.DS_Store
vendored
Binary file not shown.
Reference in New Issue
Block a user