Dodanie obsługi kuponów rabatowych w zamówieniach oraz aktualizacja adresów URL do zasobów aktualizacji
This commit is contained in:
BIN
autoload/.DS_Store
vendored
Normal file
BIN
autoload/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -51,12 +51,16 @@ class ShopOrder
|
||||
|
||||
public static function order_details()
|
||||
{
|
||||
$order = new \shop\Order( (int)\S::get( 'order_id' ) );
|
||||
$coupon = new \shop\Coupon( $order -> coupon_id );
|
||||
|
||||
return \Tpl::view( 'shop-order/order-details', [
|
||||
'order' => new \shop\Order( (int)\S::get( 'order_id' ) ),
|
||||
'order_statuses' => \shop\Order::order_statuses(),
|
||||
'next_order_id' => \admin\factory\ShopOrder::next_order_id( (int)\S::get( 'order_id' ) ),
|
||||
'prev_order_id' => \admin\factory\ShopOrder::prev_order_id( (int)\S::get( 'order_id' ) ),
|
||||
] );
|
||||
'order' => $order,
|
||||
'coupon' => $coupon,
|
||||
'order_statuses' => \shop\Order::order_statuses(),
|
||||
'next_order_id' => \admin\factory\ShopOrder::next_order_id( (int)\S::get( 'order_id' ) ),
|
||||
'prev_order_id' => \admin\factory\ShopOrder::prev_order_id( (int)\S::get( 'order_id' ) ),
|
||||
] );
|
||||
}
|
||||
|
||||
public static function view_list()
|
||||
|
||||
@@ -9,7 +9,7 @@ class Update
|
||||
|
||||
\S::delete_session( 'new-version' );
|
||||
|
||||
$versions = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] );
|
||||
$versions = file_get_contents( 'https://shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] );
|
||||
$versions = explode( PHP_EOL, $versions );
|
||||
|
||||
foreach ( $versions as $ver )
|
||||
@@ -22,7 +22,7 @@ class Update
|
||||
else
|
||||
$dir = substr( $ver, 0, strlen( $ver ) - 1 ) . 0;
|
||||
|
||||
$file = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '.zip' );
|
||||
$file = file_get_contents( 'https://shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '.zip' );
|
||||
|
||||
$dlHandler = fopen( 'update.zip' , 'w' );
|
||||
if ( !fwrite( $dlHandler, $file ) )
|
||||
@@ -34,10 +34,10 @@ class Update
|
||||
else
|
||||
{
|
||||
/* aktualizacja bazy danych */
|
||||
$url = 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_sql.txt';
|
||||
$url = 'https://shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_sql.txt';
|
||||
$ch = curl_init( $url );
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||
curl_setopt( $ch, CURLOPT_HEADER, true );
|
||||
curl_setopt( $ch, CURLOPT_HEADER, false );
|
||||
$response = curl_exec( $ch );
|
||||
$content_type = curl_getinfo( $ch, CURLINFO_CONTENT_TYPE );
|
||||
|
||||
@@ -53,10 +53,10 @@ class Update
|
||||
}
|
||||
|
||||
/* usuwanie zbędnych plików */
|
||||
$url = 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_files.txt';
|
||||
$url = 'https://shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_files.txt';
|
||||
$ch = curl_init( $url );
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||
curl_setopt( $ch, CURLOPT_HEADER, true );
|
||||
curl_setopt( $ch, CURLOPT_HEADER, false );
|
||||
$response = curl_exec( $ch );
|
||||
$content_type = curl_getinfo( $ch, CURLINFO_CONTENT_TYPE );
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ class Log
|
||||
static public function save_log( $message, $user_id = null )
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$mdb -> insert( 'pp_log', [
|
||||
'message' => $message,
|
||||
'user_id' => $user_id ? $user_id : null,
|
||||
|
||||
@@ -395,7 +395,7 @@ class S
|
||||
return $version;
|
||||
|
||||
$version = 0;
|
||||
$versions = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] );
|
||||
$versions = file_get_contents( 'https://shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] );
|
||||
$versions = explode( PHP_EOL, $versions );
|
||||
foreach ( $versions as $key => $version_tmp )
|
||||
{
|
||||
|
||||
BIN
autoload/front/.DS_Store
vendored
Normal file
BIN
autoload/front/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -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
|
||||
] );
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -328,10 +328,12 @@ class Order implements \ArrayAccess
|
||||
global $settings;
|
||||
|
||||
$order = \front\factory\ShopOrder::order_details( $this -> id );
|
||||
$coupon = new \shop\Coupon( $order['coupon_id'] );
|
||||
|
||||
$mail_order = \Tpl::view( 'shop-order/mail-summary', [
|
||||
'settings' => $settings,
|
||||
'order' => $order
|
||||
'order' => $order,
|
||||
'coupon' => $coupon,
|
||||
] );
|
||||
|
||||
$settings[ 'ssl' ] ? $base = 'https' : $base = 'http';
|
||||
|
||||
Reference in New Issue
Block a user