Post by Webbo » Tue Mar 17, 2015 6:40 pm

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

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by Webbo » Tue Mar 17, 2015 6:57 pm

Just discovered the issue.

it is a conflict between Special price and Quantity Discount, basically you cannot have both.

is there a way you can have a Special price AND a Quantity Discount?

Please.....

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by Webbo » Tue Mar 17, 2015 7:44 pm

It appears this issue has history > http://forum.opencart.com/viewtopic.php?t=35730

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am
Who is online

Users browsing this forum: No registered users and 150 guests