Page 1 of 3
[1.5.0.5] Bug - Quantity Discount ignored with special price
Posted: Sat Jul 09, 2011 9:37 am
by ExtremeLeadProgram
It seems that if you use the "Special" section to lower a price that quantity discounts are ignored.
Try:
http://extreme-mlm-leads.com/opencart2/ ... -mlm-leads
No matter what quantity you try to add to cart it charges the $1.27 price. It won't charge the $1.19 or $0.82 for quantities of 100 or 270 respectively.
However, if I remove the special price of $1.27 it will then charge the $1.19 or $0.82 for those higher quantities. Not sure where to go to fix this, any help would be appreciated.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sat Jul 09, 2011 4:41 pm
by uksitebuilder
Maybe this will help
open: system/library/cart.php
replace
Code: Select all
if ($product_special_query->num_rows) {
$price = $product_special_query->row['price'];
}
with:
Code: Select all
if ($product_special_query->num_rows) {
if($product_discount_query->num_rows&&$product_discount_query->row['price']<=$product_special_query->row['price']){
$price = $product_discount_query->row['price'];
}else{
$price = $product_special_query->row['price'];
}
}
open: catalog/controller/product/product.php
replace:
Code: Select all
foreach ($discounts as $discount) {
$this->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')))
);
}
with:
Code: Select all
foreach ($discounts as $discount) {
if((float)$product_info['special']){
if($product_info['special']>$discount['price']){
$this->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')))
);
}
}else{
$this->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')))
);
}
}
or if you use vQmod to save from core file overwriting:
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sat Jul 09, 2011 5:10 pm
by uksitebuilder
We could go further than the above.
For example
Product has Main Price 3.00
Product has discount buy 10 for 2.00
product has Special Price 1.00
Although with the above mod, the correct price of 10.00 will be added to the cart if the user buys 10 quantity (because of the special price being lower than the discount price)
The display on the product page will look confusing to the user as it will still list the discounts
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sat Jul 09, 2011 5:31 pm
by uksitebuilder
OK fixed that too and changed code in my edit post above - vqmod file also updated
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sat Jul 09, 2011 8:27 pm
by Daniel
there is no bug here. you need to be careful that the discount and specials do not overlap each other.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sat Jul 09, 2011 11:21 pm
by Xsecrets
Daniel wrote:there is no bug here. you need to be careful that the discount and specials do not overlap each other.
I may not be a bug, but it's certainly limitation of the system. And since someone has gone to the trouble to overcome the limitation it probably wouldn't hurt to add it to future versions.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Mon Jul 11, 2011 1:10 am
by Daniel
its not a limitation. its how the system should work.
the system is very flexible it has a massive discount system with coupons, price breaks, special offers. if you don;t set them correctly they don't work how they should.
don't use special prices with quantity discounts they don't mix well.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Mon Jul 11, 2011 1:36 am
by uksitebuilder
Daniel wrote:don't use special prices with quantity discounts they don't mix well.
Exactly it is a limitation in so much as the use of special prices with discounts is limited to not working.
But hey, it is your system, so it is up to you.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Tue Jul 12, 2011 3:31 am
by emmetje
uksitebuilder wrote:OK fixed that too and changed code in my edit post above - vqmod file also updated
Thank you for sharing the code with us, veeery usefull!!
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sun Jul 31, 2011 6:27 am
by uksitebuilder
Update to the code above.
It came to my attention that the previous vqmod file worked only to an extent.
If you have used it, please replace with this new file and clear your vqmod/vqcache
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Wed Aug 03, 2011 3:54 pm
by darrengould
I had this problem and it is definitely a problem because they should work together to be right.
I have a product that is on special offer for one and also discounted for three, six, and twelve but you don't want a visitor to see just a price for one bottle. you want them to see the normal price and the special price as it is far more effective.
I have had to put my special price as the normal price which diminishes the sale factor becasue a visitor has absolutely no idea the product is on special and it also won't show up in the specials list unless it does.
If you then have a discount on three, six and twelve you need to be able to show them as dicounts and your initial price as a special.
Sorry but this is a problem and does need fixing and anyone that sells of a website not designs one will know that the effectiveness of the specials, discounts is completely lost if you have to do it the way I described.
The only quick way round this that I can see is to allow the specials to have the option to put a quantity in so you can in effect create discounts using the specials although again this could create problems with your specials list as it could be massive.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sat Aug 06, 2011 12:27 am
by eric1998
Good Work
UKSB
Thanks
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sun Nov 06, 2011 9:31 pm
by mwd
uksitebuilder wrote:Update to the code above.
It came to my attention that the previous vqmod file worked only to an extent.
If you have used it, please replace with this new file and clear your vqmod/vqcache
uksb_discount_with_specials.xml
Thank you so much, uksb!
I didn't realize the sale price didn't work with quantity discounts until I got emails from customers asking for a refund.
Your mod did the trick!
Great work.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Wed Feb 01, 2012 5:39 am
by i2Paq
The same code seems to be used in 1.4.9.x.
I will test it in my store and let you know if it works.
If so, THANKS!
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Fri Apr 20, 2012 6:14 am
by lee420
Great addition. Works a treat. Thanks.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Thu Oct 18, 2012 4:33 pm
by ian007
This mod doesnt seem to work in 1.5.4.x
With product discounts and specials set, the result is that the discounts disapear (search, product, category etc..)
I would really like discount prices to work and update with specials, anyone know of a mod or code change to make this happen?
Many thanks.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sun Oct 21, 2012 6:15 pm
by dudumagic
it's not work to me 1.5.4
Parse error: syntax error, unexpected '}' in /home/kingmagi/public_html/instockmagic.com/vqmod/vqcache/vq2-system_library_cart.php on line 332
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Thu Nov 15, 2012 6:43 pm
by beipink
Daniel wrote:its not a limitation. its how the system should work.
the system is very flexible it has a massive discount system with coupons, price breaks, special offers. if you don;t set them correctly they don't work how they should.
don't use special prices with quantity discounts they don't mix well.
Hi Daniel
you see it from an development point of view and of course this is not a limitation for you because they are 2 different features, however I think your users have their reason to ask for such a feature.
From a selling point of view rules are different. A seller looks are the nr of transactions and how to increase them. Strategic pricing/discounts of products is a good way. In fact when a item is on special it sells more.
Other features like Cart, Category discounts, buy 3 and pay 2 etc etc are also becoming more standards features that help to increase sales.
Re: [1.5.4]SOLVED - Quantity Discount ignored with special p
Posted: Mon Jan 28, 2013 5:38 am
by dr770
@uksitebuilder - you are the hero! your mode works with 1.5.4.
Daniel, with all respect, this is indeed limitation, for ex. for stores which have specials for default clients and discounts for wholesale. Just accept it and take this fix in the feature update.
thanks.
Re: [1.5.0.5] Bug - Quantity Discount ignored with special p
Posted: Sun Mar 24, 2013 2:09 am
by GraemeH
I have the same issue with it not working in 1.5.4.1 - I would really appreciate it of this could be fixed. When I go to a product page I get:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/tikprod1/public_html/vqmod/vqcache/vq2-catalog_controller_product_product.php on line 556