Kích hoạt SSL cho website dùng CS-Cart

  • Friday 28/02/2020

Trước tiên bạn cần cái SSL cho website tham khảo https://kb.pavietnam.vn/huong-dan-cai-dat-ssl-tren-cpanel.html nếu hosting đang chạy trên cPanel

Sau đó vào trang admin của website CS-Cart, thường là domain/admin

Chọn settings  (góc phải màn hình) => chọn   Security settings

https ssl settings menu

Trong mục này cần thiết lập lại

https ssl settings enable

Enable secure connection in the administration panel :
Keep HTTPS connection once a secure page is visited:

Sau đó lưu lại

 

Tuy nhiên nếu phát sinh lỗi khi bấm lưu “The Secure Connection Check Has Failed

bạn vào file app/schemas/settings/actions.functions.php để chỉnh sửa như sau, lưu ý sao lưu trước khi sửa

Thay đoạn:


if (empty($content) || $content != ‘OK’) {
// Disable https
Settings::instance()->updateValue(‘secure_storefront’, ‘none’, ‘Security’);
$new_value = ‘none’;

$error = Http::getErrorFields();
$error_warning = __(‘warning_https_is_disabled’, array(
‘[href]’ => Registry::get(‘config.resources.kb_https_failed_url’
)));

$error_warning .= fn_settings_actions_build_detailed_error_message($error);
fn_set_notification(‘W’, __(‘warning’), $error_warning);
}

Bằng

/*if (empty($content) || $content != ‘OK’) {
// Disable https
Settings::instance()->updateValue(‘secure_storefront’, ‘none’, ‘Security’);
$new_value = ‘none’;

$error = Http::getErrorFields();
$error_warning = __(‘warning_https_is_disabled’, array(
‘[href]’ => Registry::get(‘config.resources.kb_https_failed_url’
)));

$error_warning .= fn_settings_actions_build_detailed_error_message($error);
fn_set_notification(‘W’, __(‘warning’), $error_warning);
}*/

và Thay đoạn

if (empty($content) || $content != ‘OK’) {
// Disable https
Settings::instance()->updateValue(‘secure_admin’, ‘N’, ‘Security’);
$new_value = ‘N’;

$error = Http::getErrorFields();
$error_warning = __(‘warning_https_is_disabled’, array(
‘[href]’ => Registry::get(‘config.resources.kb_https_failed_url’
)));

$error_warning .= fn_settings_actions_build_detailed_error_message($error);
fn_set_notification(‘W’, __(‘warning’), $error_warning);
}

bằng

/*if (empty($content) || $content != ‘OK’) {
// Disable https
Settings::instance()->updateValue(‘secure_admin’, ‘N’, ‘Security’);
$new_value = ‘N’;

$error = Http::getErrorFields();
$error_warning = __(‘warning_https_is_disabled’, array(
‘[href]’ => Registry::get(‘config.resources.kb_https_failed_url’
)));

$error_warning .= fn_settings_actions_build_detailed_error_message($error);
fn_set_notification(‘W’, __(‘warning’), $error_warning);
}*/

Sau khi chỉnh sửa xong, bạn vào lưu lại là hoàn tất việc kích hoạt CS-Cart

Rate this post