Page 1 of 1
[vQmod] Discounts and Specials together
Posted: Wed Aug 10, 2011 12:25 am
by uksitebuilder
This mod correctly displays discounted prices with products that have special prices.
If the special price is lower than one of the discounted prices, that discounted price is hidden so as not to confuse the user and so the correct price is shown in the cart.
Tested on 1.5.x
Re: [vQmod] Discounts and Specials together
Posted: Tue Aug 13, 2013 2:32 pm
by bruno05
Thank you. I am using 1.5.5.1 and this works great. Opencart must add this to the core product, since this is a fundamental feature.
Re: [vQmod] Discounts and Specials together
Posted: Sun Jan 26, 2014 8:49 pm
by Brynaren
It worked perfect up to 1.5.6. When I upgraded to 1.5.6.1 my product pages suddenly went blank. Remove this vqmod/xml file makes product pages OK again, but the option to have Sale price and Quantity disappeared.
I have tried to figure out how to rebuild this mod to work with 1.5.6.1 but I´m lost. Anyone out there with a solution?
Re: [vQmod] Discounts and Specials together
Posted: Tue Mar 17, 2015 7:57 pm
by Webbo
Please could you bring this vqmod out as an extension for OC2.0.1.1 or possibly modify this version
Please....
Re: [vQmod] Discounts and Specials together
Posted: Thu Apr 09, 2015 3:54 am
by moddish
Webbo wrote:Please could you bring this vqmod out as an extension for OC2.0.1.1 or possibly modify this version
Please....
it already does work with 2.0 ...did you try it?
remove this from the file for 2.0
<file name="catalog/controller/product/product.php">
<operation>
<search position="replace" offset="5"><![CDATA[ foreach ($discounts as $discount) {]]></search>
<add><![CDATA[ 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')))
);
}
}]]></add>
</operation>
</file>
Re: [vQmod] Discounts and Specials together
Posted: Thu Dec 29, 2016 10:39 am
by kavlito
I have tried this unchanged in v2.2.0.0 and it gives errors on the product page.
I removed the lines of code as indicated, and the errors are gone, but it does not show the proper discounted price.
FYI, I have a Special price set @ $15.95 and a Discounted price set at $14.975 for quantity 2 or more.
Even with this modified vqmod, the price still shows $15.95 with qty 2 or more in the shopping cart.
I wish this could be fixed because I really need this basic feature to work.
Thanks in advance for anyones's help.
Re: [vQmod] Discounts and Specials together
Posted: Thu Dec 29, 2016 9:35 pm
by kavlito
moddish wrote:Webbo wrote:Please could you bring this vqmod out as an extension for OC2.0.1.1 or possibly modify this version
Please....
it already does work with 2.0 ...did you try it?
remove this from the file for 2.0
<file name="catalog/controller/product/product.php">
<operation>
<search position="replace" offset="5"><![CDATA[ foreach ($discounts as $discount) {]]></search>
<add><![CDATA[ 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')))
);
}
}]]></add>
</operation>
</file>
Initially, this vqmod did not work for me on v2.2.0.0, even after removing the code as indicated above. However, after reviewing the code, I noticed that in line 6, the path to cart.php was incorrect for my installation.
Code: Select all
<modification>
<id>Fix Discounts wtih Specials</id>
<version>1.0</version>
<vqmver>1.2.3</vqmver>
<author>uksb</author>
<file name="system/library/cart.php">
My installation is in a subdirectory: /cart
I had to change the path to include my subdirectory:
Code: Select all
<modification>
<id>Fix Discounts wtih Specials</id>
<version>1.0</version>
<vqmver>1.2.3</vqmver>
<author>uksb</author>
<file name="system/library/cart/cart.php">
download/file.php?id=6570
After removing the code as indicated above, and updating the path to include my subdirectory, I can now use Special Pricing and Discount Pricing at the same time in v2.2.0.0.