Post by uksitebuilder » Wed Aug 10, 2011 12:25 am

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

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by bruno05 » Tue Aug 13, 2013 2:32 pm

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.

Newbie

Posts

Joined
Tue Aug 13, 2013 2:07 pm

Post by Brynaren » Sun Jan 26, 2014 8:49 pm

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?

Newbie

Posts

Joined
Sun Jan 26, 2014 8:40 pm

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

Please could you bring this vqmod out as an extension for OC2.0.1.1 or possibly modify this version

Please....

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by moddish » Thu Apr 09, 2015 3:54 am

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>

Newbie

Posts

Joined
Thu Nov 28, 2013 3:36 am

Post by kavlito » Thu Dec 29, 2016 10:39 am

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.

Newbie

Posts

Joined
Fri Mar 11, 2016 7:43 pm

Post by kavlito » Thu Dec 29, 2016 9:35 pm

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.

Newbie

Posts

Joined
Fri Mar 11, 2016 7:43 pm
Who is online

Users browsing this forum: No registered users and 5 guests