For some reason my Product Quantity Discount Not Working on my OC 2.0.1.1, it is only using the primary price and not the quantity discounted price.
Please could someone help me trace the problem
I understand the related files are:
line 324 > Catalog > Controller > Product > product.php
$discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
$data['discounts'] = array();
foreach ($discounts as $discount) {
$data['discounts'][] = array(
'quantity' => $discount['quantity'],
'price' => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
);
}
$data['options'] = array();
--------------------------
line 170 (system/library/cart.php)
// Product Discounts
$discount_quantity = 0;
foreach ($this->session->data['cart'] as $key_2 => $quantity_2) {
$product_2 = (array)unserialize(base64_decode($key_2));
if ($product_2['product_id'] == $product_id) {
$discount_quantity += $quantity_2;
}
}
$product_discount_query = $this->db->query("SELECT price FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND quantity <= '" . (int)$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, priority ASC, price ASC LIMIT 1");
if ($product_discount_query->num_rows) {
$price = $product_discount_query->row['price'];
}
Any help or guidance would be appreciated, please
Who is online
Users browsing this forum: No registered users and 150 guests