  |
106 | 106 | | if ($this->in_cart($products_id_string)) { |
| |
107 | 107 | | $this->update_quantity($products_id_string, $qty, $attributes); |
| |
108 | 108 | | } else { |
  |
109 | | - | $this->contents[$products_id_string] = array('qty' => $qty); |
| |
| 109 | + | $this->contents[$products_id_string] = array('qty' => (int)$qty); |
|
110 | 110 | | // insert into database |
| |
111 | 111 | | if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')"); |
| |
112 | 112 | | |
| |
|
|
 |
… |
|
147 | 147 | | } |
| |
148 | 148 | | |
| |
149 | 149 | | if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) { |
  |
150 | | - | $this->contents[$products_id_string] = array('qty' => $quantity); |
| |
| 150 | + | $this->contents[$products_id_string] = array('qty' => (int)$quantity); |
  |
151 | 151 | | // update database |
| |
152 | 152 | | if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'"); |
| |
153 | 153 | | |