Upgrade guide

Instructions to upgrade S-Cart from 6.4 to 6.5

Step 1. Hook event (option)
- Create new files:

+ app/Listeners/ProcessCustomerCreated.php
+ app/Listeners/ProcessOrderCreated.php
+ app/Listeners/ProcessOrderSuccess.php
+ app/Listeners/ProcessOrderUpdateStatus.php
+ app/Listeners/ProcessLogin.php

-  Additional events in app/Providers/EventServiceProvider.php

\SCart\Core\Events\OrderCreated::class => [
    \App\Listeners\ProcessOrderCreated::class,
],
\SCart\Core\Events\OrderSuccess::class => [
    \App\Listeners\ProcessOrderSuccess::class,
],
\SCart\Core\Events\CustomerCreated::class => [
    \App\Listeners\ProcessCustomerCreated::class,
],
\SCart\Core\Events\OrderUpdateStatus::class => [
    \App\Listeners\ProcessOrderUpdateStatus::class,
],
 \Illuminate\Auth\Events\Login::class => [
            \App\Listeners\ProcessLogin::class,
  ],

More detail:
https://github.com/s-cart/s-cart/commit/53ee59faabbc5ca6afd276755e6fba638340e91f
https://github.com/s-cart/s-cart/commit/3b3e5b72e1eac2f4d232ff3127481399c17a077e

Step 2: Remove the configuration in Provider (Recommend)
In file in config/app.php, delete the red content
https://github.com/s-cart/s-cart/commit/8a4570f5de69250e0bbf04106895d3c433cf02c7

Step 3: Laravel 8 standardization (Recommend)

Update the latest content of the files:

- app/Http/Kernel.php
- app/Http/Middleware/RedirectIfAuthenticated.php
- app/Http/Middleware/TrimStrings.php
- app/Http/Middleware/TrustProxies.php
- app/Providers/RouteServiceProvider.php
- composer.json


Create new files:

- app/Http/Middleware/PreventRequestsDuringMaintenance.php
- resources/views/errors/403.blade.php
- resources/views/errors/404.blade.php
- resources/views/errors/419.blade.php
- resources/views/errors/429.blade.php
- resources/views/errors/500.blade.php
- resources/views/errors/503.blade.php
- resources/views/errors/illustrated-layout.blade.php
- resources/views/errors/layout.blade.php
- resources/views/errors/minimal.blade.php

More detail: https://github.com/s-cart/s-cart/commit/754975bdd53cce00cc85504909be70c9d9ee5400

Step 4: Update data (option)
 
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.list', 'Danh sách API connection', 'admin.api_connection', 'vi');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.list', 'API connection list', 'admin.api_connection', 'en');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.api_mode', 'TẮT/MỞ API', 'admin.api_connection', 'vi');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.api_mode', 'ON/OFF API', 'admin.api_connection', 'en');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.api_mode_help', 'TẮT/MỞ API', 'admin.api_connection', 'vi');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.api_mode_help', 'ON/OFF API', 'admin.api_connection', 'en');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.edit', 'Chỉnh sửa connection', 'admin.api_connection', 'vi');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.create', 'Create new connection', 'admin.api_connection', 'en');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.api_connection_required_help', '<ul><li>If not using API, please switch to "OFF API" state</li><li>If apikey and apiconnection are not used, switch to "OFF CONNECTION" state</li></ul>\r\n    <a href="https://s-cart.org/docs/developer/about-api-scart.html" target="_new"><i class="fa fa-info-circle" aria-hidden="true"></i>See full infomation</a>\r\n    ', 'admin.api_connection', 'en');
REPLACE INTO `sc_languages` (`code`, `text`, `position`, `location`) VALUES ('admin.api_connection.api_connection_required_help', '<ul><li>Nếu không sử dụng API, hãy hãy chuyển sang trạng thái "OFF API"</li><li>Nếu không sử dụng apikey và apiconnection, hãy chuyển sang trạng thái "OFF CONNECTION"</li></ul>\r\n    <a href="https://s-cart.org/vi/docs/developer/about-api-scart.html" target="_new"><i class="fa fa-info-circle" aria-hidden="true">Xem chi tiết ở đây</i></a>\r\n    ', 'admin.api_connection', 'vi');

Step 5. Create new file config/passport.php (option)
https://github.com/s-cart/s-cart/blob/v6.5/config/passport.php

Step 6. Update file composer.json (Required)
Update core version for S-Cart 6.5  "s-cart/core": "~6.5.0"

Step 7: Update core
"php composer.phar update"

- Run command line php artisan sc:info to get information.
Done :)

Related topics

Latest Document