However, with all my luck, and to no avail, I have not been able to succesfully "2.x-ify" this piece of code. I have had little to no luck with the developer (as he believes it's not his code, even though i've had to fix pieces of it) and from prior searches for help it appears the developer might do some shady things if provided access to the website.
So, if at all possible could I receive some help? file is system/library/cart.php
Code: Select all
$offer_discount_quantity = 0;
foreach ($this->session->data['cart'] as $key_offer => $quantity_offer) {
$product_offer = (array)unserialize(base64_decode($key_offer));
if ($product_offer['product_id'] == $product_id) {
$offer_discount_quantity += $quantity_offer;
}
}
$offer_discount_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "offer_discount WHERE product_id = '" . (int)$product_id . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND quantity <= '" . (int)$offer_discount_quantity . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY quantity DESC, price ASC LIMIT 1");
The errors are these:
please note: i will not pay for help on this. I already dropped nearly 200 dollars for a module that needed debugging and fixes already. This is just a small piece of the puzzle and unfortunately the last piece.2016-08-09 9:36:33 - PHP Notice: Undefined index: cart in <omitted>.../vq2-system_library_cart.php on line 173
2016-08-09 9:36:33 - PHP Warning: Invalid argument supplied for foreach() in <omitted>.../vq2-system_library_cart.php on line 173
2016-08-09 9:36:33 - PHP Notice: Undefined variable: product_id in <omitted>.../vq2-system_library_cart.php on line 181