It is worth opencart, it is necessary that the basket is not dumped a day, since orders are very large and add for a long time. Already done everything possible, but the basket is still reset.

  1. Installed on the server

    session.cookie_lifetime 86400; session.gc_maxlifetime 86400;

  2. In php.ini in the root folder:

    magic_quotes_gpc = Off;

    register_globals = Off;

    default_charset = UTF-8;

    memory_limit = 1024M;

    session.cookie_lifetime 86400;

    session.gc_maxlifetime 86400;

    php_value session.cache_expire 180;

    php_value max_execution_time = 36000;

    upload_max_filesize = 4000M;

    php_value max_input_vars = 10000;

    php_value suhosin.request.max_vars = 10,000;

    php_value suhosin.post.max_vars = 10000;

    safe_mode = Off;

    mysql.connect_timeout = 20;

    session.auto_start = Off;

    session.use_only_cookies = On;

    session.use_cookies = On;

    session.use_trans_sid = Off;

    session.cookie_httponly = On;

    allow_url_fopen = on;

Changed the session.php file | brought in a separate folder, gave the rights 700

public function __construct($session_id = '', $key = 'default') { if (!session_id()) { ini_set('session.use_only_cookies', 'Off'); ini_set('session.use_cookies', 'On'); ini_set('session.use_trans_sid', 'Off'); ini_set('session.cookie_httponly', 'On'); if (isset($_COOKIE[session_name()]) && !preg_match('/^[a-zA-Z0-9,\-]{22,40}$/', $_COOKIE[session_name()])) { exit(); } if ($session_id) { session_id($session_id); } session_set_cookie_params(86400, '/'); ini_set('session.cache_expire', '180'); ini_set('session.gc_maxlifetime', '86400'); session_save_path(realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/session')); session_start(); } if (!isset($_SESSION[$key])) { $_SESSION[$key] = array(); } $this->data =& $_SESSION[$key]; } 

Added rule also in .htaccess

 php_value session.gc_maxlifetime 86400 php_value session.cookie_lifetime 86400 

Even after that the basket is dumped exactly in an hour.

  • The problem is solved as follows: Go to \ system \ library \ cart.php and see there: $this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR)"); change INTERVAL 1 HOUR as far as we need :) - retrojdev

1 answer 1

For OpenCard 2.2: here /system/library/session.php change the value in the string

 session_set_cookie_params(0, '/'); 

on

 session_set_cookie_params(60*60*24, '/'); 

And also here: /system/library/cart/cart.php change the value in the line $this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR)"); on here it is:

 $this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 24 HOUR)"); 

For other versions, about the same procedure. Paths may vary slightly.