Skip to content

Commit

Permalink
Merge pull request #13931 from stalker780/patch-29
Browse files Browse the repository at this point in the history
Fix cart session_id typo
  • Loading branch information
danielkerr committed May 13, 2024
2 parents 43c1016 + ef64427 commit cefa59c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions upload/system/library/cart/cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public function __construct(\Opencart\System\Engine\Registry $registry) {

if ($this->customer->isLogged()) {
// We want to change the session ID on all the old items in the customers cart
$this->db->query("UPDATE `" . DB_PREFIX . "cart` SET `session_id` = '" . $this->db->escape($this->session->getId()) . "' AND `date_added` = NOW() WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `customer_id` = '" . (int)$this->customer->getId() . "'");
$this->db->query("UPDATE `" . DB_PREFIX . "cart` SET `session_id` = '" . $this->db->escape($this->session->getId()) . "', `date_added` = NOW() WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `customer_id` = '" . (int)$this->customer->getId() . "'");

// Once the customer is logged in we want to update the customers cart
$this->db->query("UPDATE `" . DB_PREFIX . "cart` SET `customer_id` = '" . (int)$this->customer->getId() . "' AND `date_added` = NOW() WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `customer_id` = '0' AND `session_id` = '" . $this->db->escape($this->session->getId()) . "'");
$this->db->query("UPDATE `" . DB_PREFIX . "cart` SET `customer_id` = '" . (int)$this->customer->getId() . "', `date_added` = NOW() WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `customer_id` = '0' AND `session_id` = '" . $this->db->escape($this->session->getId()) . "'");
}

// Populate the cart data
Expand Down

0 comments on commit cefa59c

Please sign in to comment.