If you see an error in opencart like below: Notice: Trying to access array offset on the value of type null in .../vendor/scss.inc.php on line 1753 then the solution is: Open the file .../vendor/scss.inc.php and go to line as given in the above case it is 1753 where you will see code like below: foreach ($args as $arg) { list($key, $value) = $arg; $key = $key[1]; if (empty($key)) { $posArgs[] = $value; } else { $keyArgs[$key] = $value; } } Then change the line to the following, the changes done is in bold. foreach ($args as $arg) { list($key, $value) = $arg; if (!empty($key[1])) { $key = $key[1]; } if (empty($key)) { $posArgs[] = $value; } else { $keyArgs[$key] = $value; } } ...
customer: login($email, $password): Check whether the customer is approved and check whether the username and password is correct or not. public function login($email, $password) { if (!$this->config->get('config_customer_approval')) { $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'"); } else { $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'"); } if ($customer_query->num_rows) { $this->session->data['customer_id'] = $customer_qu...
Cart: Functions that are in the cart library of opencart are: $this->cart->getProducts(): This is the line which is used for getting the products that are in the cart. public function getProducts() { $product_data = array(); foreach ($this->session->data['cart'] as $key => $value) { $array = explode(':', $key); $product_id = $array[0]; $quantity = $value; $stock = TRUE; if (isset($array[1])) { $options = explode('.', $array[1]); } else { $options = array(); } $product_query = $this->db->query("SELECT *, wcd.unit AS weight_class, mcd.unit AS length_class FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "weight_class wc ON (p.weight_class_id = wc.weight_class_id) LEFT JOIN " . DB_PREFIX . "weight_class_description wcd ON (wc.weight_class_id = wcd.weight_class_id) LEFT JOIN " . DB_PREFIX . "length_c...
Comments
Post a Comment