I've got two products that are currently discounted on my store, and have them in the featured box module on the right column of my pages.
Here is what I have set:
Regular price for particular item: $1099
Wholesale login "discount" price for 1 unit: $1079
Regular "special" price for 1 unit: $1029
Wholesale login "special" price for 1 unit: $1009
What I get:
Price displayed for guests / retail customers: $1099 (strikethrough) $1029
Only price ever displayed for wholesale logins: $1079
What I want:
Price displayed for guests / retail customers: $1099 (strikethrough) $1029
Price displayed for wholesale customers: $1079 (strikethrough) $1009
In short, by getting moved to the wholesale group right now, you pay more for this particular item.
Is this a known bug, or is there a known workaround? Any suggestions?
Thank you,
Jared
I'm using OpenCart v 1.4.9.3 and using the free "Black Theme" or cc_carbon_tab theme.
Any help much appreciated!
Thank you,
Jared
To fix:
1. EDIT: catalog/controller/product/product.php
2. FIND:
Code: Select all
$discount = $this->model_catalog_product->getProductDiscount($this->request->get['product_id']);
if ($discount) {
$this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
$this->data['special'] = FALSE;
} else {
$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
$special = $this->model_catalog_product->getProductSpecial($this->request->get['product_id']);
if ($special) {
$this->data['special'] = $this->currency->format($this->tax->calculate($special, $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$this->data['special'] = FALSE;
}
}
Code: Select all
$discount = $this->model_catalog_product->getProductDiscount($this->request->get['product_id']);
if ($discount) {
$this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
$this->data['special'] = FALSE;
} else {
$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
}
$special = $this->model_catalog_product->getProductSpecial($this->request->get['product_id']);
if ($special) {
$this->data['special'] = $this->currency->format($this->tax->calculate($special, $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$this->data['special'] = FALSE;
}
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
if price is 10.00 for normies
first qty discount for 1 is 8.00 for wholesalies
Special is 5.00 for both
Before the fix:
if logged in as normie see
10.00 crossed out and 5.00 in red <-- correct
if logged in as wholesalie
show 8.00 with no special<--incorrect
After the fix:
if logged in as normie see
10.00 crossed out and 5.00 in red <-- correct
if logged in as wholesalie
show 8.00 crossed out and 5.00 in red <-- correct
I did not add additional checking for greater or less than.. its up to you to put items on sale for less than the price
wow took a while for that light bulb to come onQphoria wrote:actually after rethinking this, perhaps I should check which is lower. If there is a qty discount for $5 each if you buy 10, the special will force $8 each instead of $5 each
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
I've got this extra line in there:
Code: Select all
$this->data['productInfoData'] = $this->request->get['product_id'];
Code: Select all
$discount = $this->model_catalog_product->getProductDiscount($this->request->get['product_id']);
$this->data['productInfoData'] = $this->request->get['product_id'];
if ($discount) {
$this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
$this->data['special'] = FALSE;
} else {
$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
$special = $this->model_catalog_product->getProductSpecial($this->request->get['product_id']);
if ($special) {
$this->data['special'] = $this->currency->format($this->tax->calculate($special, $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$this->data['special'] = FALSE;
}
}
Thank you,
Jared
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
"data" assumes array or some additional data.. but it's just a product_id which is already available at the view level so i'd tell the modder to do a bit better. At any rate, it shouldn't be in that block of code anyway. It should be moved elsewhere outside of the pricing changes section
After this had been posted, I just assumed it would work. However, I was just now testing to make sure...and it doesn't seem as if it is
For wholesale, I've got a product "dicounted" for 1 unit to be $929.00. It is on special for $909.00. When logged in to a wholesale account, the price is $929.00. If I go to the "Specials" page, there is nothing there.
Here is my code in the catalog/controller/product/product.php file (including a little before and a little after what we have been discussing, just for good measure):
Code: Select all
$this->data['popup'] = $this->model_tool_image->resize($image, $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
$this->data['thumb'] = $this->model_tool_image->resize($image, $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
$this->data['product_info'] = $product_info;
$this->data['productInfoData'] = $this->request->get['product_id'];
$discount = $this->model_catalog_product->getProductDiscount($this->request->get['product_id']);
if ($discount) {
$this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
$this->data['special'] = FALSE;
} else {
$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
}
$special = $this->model_catalog_product->getProductSpecial($this->request->get['product_id']);
if ($special) {
$this->data['special'] = $this->currency->format($this->tax->calculate($special, $product_info['tax_class_id'], $this->config->get('config_tax')));
} else {
$this->data['special'] = FALSE;
}
$discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
$this->data['discounts'] = array();
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')))
);
}
Any idears?
Thank you again,
Jared
I just wanted to give this a gentle bump, since it seems we just about have it figured out as it seems to be working great for everyone else. I just can't seem to get it to work. In my previous post, I have pasted the relevant code as well as a few lines above and a few lines below in case that helps anything.
If anyone can spot what is going on and point it out, that'd be great! I've compared my code with the given code time and time again and I can't seem to find any discrepancies :S
Thank you,
Jared
Wanted to bump this again. I feel like I'm so close! But it still does not work? Can someone please look this over to see what the situation is? I've tried, but I don't know that well how everything works.
Thank you again,
Jared
Sorry to bring this back, but perhaps the special price should be set as percentage, not a value. And opencart should apply that special percentage to the final price, with or without discounts.Qphoria wrote:actually after rethinking this, perhaps I should check which is lower. If there is a qty discount for $5 each if you buy 10, the special will force $8 each instead of $5 each
Something like this:
Code: Select all
$special = $this->model_catalog_product->getProductSpecial($result['product_id']);
$discount = $this->model_catalog_product->getProductDiscount($result['product_id']);
if ($special)
{
if ($discount)
{
$price = $this->currency->format($this->tax->calculate($discount - ($discount * $special) / 100, $result['tax_class_id'], $this->config->get('config_tax')));
}
else
{
$price = $this->currency->format($this->tax->calculate($result['price'] - ($result['price'] * $special) / 100, $result['tax_class_id'], $this->config->get('config_tax')));
}
}
else
{
if ($discount)
{
$price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
}
else
{
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
}
}
Also, we would need to change the product array to have this:
Code: Select all
'price' => $result['price'],
'special' => $price,
Flash Ctt Tracking V2
Animated Flash Header Banner V3
Animated Flash Banner V2
Rastreamento de envios pelo CTT correios
Flash Expandable Category Side Menu module
Flash Category Side Menu Module
Flash Cart Steps Module
Animated Flash Banner Module
Animated Flash HEADER Banner Module
I have a customer that I have have implemented with your Options Plus module. It appears that the Specials no longer work after the installation of the module. Specials have been setup correctly and enabled,, etc. While the Specials box appears on the site, it does not display the product marked/priced for the special.
Any suggestions where I should be looking for the reason.
Thanks
UlyssesNZ
Qphoria is away on vacation at the moment, I am sure when he gets back and sees this he will respond when he can.ulyssesnz wrote:Hi Qphoria,
I have a customer that I have have implemented with your Options Plus module. It appears that the Specials no longer work after the installation of the module. Specials have been setup correctly and enabled,, etc. While the Specials box appears on the site, it does not display the product marked/priced for the special.
Any suggestions where I should be looking for the reason.
Thanks
UlyssesNZ
what are the codes to replace in opencart 1.5.4.1?
thanks
Users browsing this forum: No registered users and 56 guests