diff --git a/autoload/.DS_Store b/autoload/.DS_Store new file mode 100644 index 0000000..3239922 Binary files /dev/null and b/autoload/.DS_Store differ diff --git a/autoload/front/.DS_Store b/autoload/front/.DS_Store new file mode 100644 index 0000000..7285fd1 Binary files /dev/null and b/autoload/front/.DS_Store differ diff --git a/config.php b/config.php index b8c2d11..b8cefd3 100644 --- a/config.php +++ b/config.php @@ -15,4 +15,7 @@ $config['redis']['port'] = 16921; $config['redis']['password'] = 'FUjKFMzJ1sMrRpoX29xop5ih4MdbyRbC'; $config['debug']['apilo'] = false; + +$config['trustmate']['enabled'] = true; +$config['trustmate']['uid'] = '9e2d3181-b56e-4d3d-a532-f96b09dc215f'; ?> diff --git a/cron-turstmate.php b/cron-turstmate.php new file mode 100644 index 0000000..3f8476e --- /dev/null +++ b/cron-turstmate.php @@ -0,0 +1,94 @@ + 'mysql', + 'database_name' => $database[ 'name' ], + 'server' => $database[ 'host' ], + 'username' => $database[ 'user' ], + 'password' => $database[ 'password' ], + 'charset' => 'utf8' + ] ); + +if ( !$config['trustmate']['enabled'] ) +{ + echo 'TrustMate is not enabled.'; + exit; +} + +$settings = \front\factory\Settings::settings_details(); + +$order_id = $mdb -> get( 'pp_shop_orders', '*', [ 'AND' => [ 'status' => 6, 'trustmate_send' => 0 ] ] ); +if ( is_array( $order_id ) and $order_id['id'] ) +{ + $order = \front\factory\ShopOrder::order_details( $order_id['id'] ); + ?> + + + + TrustMate Cron + + + + + +

TrustMate Cron

+

Wysłano zaproszenie do TrustMate dla zamówienia nr .

+ update( 'pp_shop_orders', [ 'trustmate_send' => 1 ], [ 'id' => $order['id'] ] ); + ?> + + + }); - - - - - - \ No newline at end of file + \ No newline at end of file