Besides, I have another problem with "Default Group Discount" of "Customer group".
Can you tell me how to make it work and what's the function on it?
Regards,
Eric
It's feasible, but unnecessary IMO...madimar wrote:AvantOsch,
I'm finally testing your contribution. I'm just thinking about again to the nested category point. It could be really great if a discount set to a category could be propagated to all its nested categories. At the moment, for my needs, this is a fundamental point.
Do you think it could be feasible?
You can go to Catalog --> Categories, Select the parent category and all it's children, and set the discount(s) for those categories from there using the Discounts Dialog...
Hello Eric,eric_hsu wrote:I've solved my problem after installing the "clear cache" extension. it's really the catch problem.
Besides, I have another problem with "Default Group Discount" of "Customer group".
Can you tell me how to make it work and what's the function on it?
It's meant so set a Default discount for all Categories/Products/Options for a certain customer group.
If the discount-percentage should be the same throughout the catalog, you can set it with the "Default Group Discount".
This discount will be applied if no other discount is set for a Category/Product/Option.
Hi, AvanOsch,AvanOsch wrote:Hello Eric,eric_hsu wrote:I've solved my problem after installing the "clear cache" extension. it's really the catch problem.
Besides, I have another problem with "Default Group Discount" of "Customer group".
Can you tell me how to make it work and what's the function on it?
It's meant so set a Default discount for all Categories/Products/Options for a certain customer group.
If the discount-percentage should be the same throughout the catalog, you can set it with the "Default Group Discount".
This discount will be applied if no other discount is set for a Category/Product/Option.
I found that there is a bug when the category discount is set to empty string.
When category discount is set to empty string, the group discount won't be calculated, the product price will no longer show the special price.
the source code in system/library/customer.php is
Code: Select all
public function getDiscount($pId) {
$discount = false;
$group_id = ($this->customer_group_id) ? $this->customer_group_id : (!$this->config->get('config_discount_login') ? $this->config->get('config_customer_group_id') : false);
$query = $this->db->query("SELECT DISTINCT category_id as id FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$pId . "'");
if ($query->num_rows && $group_id) {
$query = $this->db->query("SELECT DISTINCT discounts FROM " . DB_PREFIX . "category WHERE category_id = '" . (int)$query->row['id'] . "'");
if ($query->row['discounts'] && strpos($query->row['discounts'], '|')) {
$discounts = explode(' ', $query->row['discounts']);
foreach ($discounts as $group) {
$group = explode('|', $group);
if ($group[0] == $group_id) $discount = 1 - ((float)$group[1] / 100);
}
}
}
if (!$discount) {
$discount = 1;
if ($group_id) {
$query = $this->db->query("SELECT DISTINCT discount FROM " . DB_PREFIX . "customer_group WHERE customer_group_id = '" . (int)$group_id . "'");
if ($query->num_rows) $discount = 1 - ((float)$query->row['discount'] / 100);
}
}
return $discount;
}
if ($group[0] == $group_id) $discount = 1 - ((float)$group[1] / 100);
When the category discount is set to empty string, the $group[1] will be the empty string. And hence you can't calculate an "empty string divide by 100" <-- non sense.
So the $discount will always be set to some value, and cause the group discount failed to calculate.
Or the bug is caused by the category table has dirty discounts?!
I mean when I clear all content inside the category discount page, I found the category table in the database still have some value like "1| 2| 3|" in the discounts field.
And this situation cause the line
if ($query->row['discounts'] && strpos($query->row['discounts'], '|')) {
go pass to inside statements... perhaps
The temporarily solution I use is to set category discount to 100% when I need a pure group discount, so that the special price is shown up correctly.
Hope there will be a bug fixed version for this.
Sincerely,
Micky
I have installed your mod on a site of mine but having two issues.
1. The discount on options for customer groups isnt being applied. I can log in as a trade customer go to a product, the base price is reduced from the discount assigned to the customer group but no discount applied to the options.
2. if I add a product to the shopping basket it adds it at the default price not the discounted one.
Any insight would be appreciated.
Thanks
Chris
Thanks for the bug-report, Micky. (As that is indeed a bug)mickyp wrote: I found that there is a bug when the category discount is set to empty string.
When category discount is set to empty string, the group discount won't be calculated, the product price will no longer show the special price.
..............
We should focus on this line
if ($group[0] == $group_id) $discount = 1 - ((float)$group[1] / 100);
When the category discount is set to empty string, the $group[1] will be the empty string. And hence you can't calculate an "empty string divide by 100" <-- non sense.
So the $discount will always be set to some value, and cause the group discount failed to calculate.
Or the bug is caused by the category table has dirty discounts?!
I mean when I clear all content inside the category discount page, I found the category table in the database still have some value like "1| 2| 3|" in the discounts field.
..................
Sincerely,
Micky
I'm thinking the problem is with the "dirty" tables... (As (float) 0 divided by 100 is still 0) (0/100=0)
There should be no saved values after deleting the discount (making them empty, not "0")
I'll look into this.
Dunn123, I think (hopedunn123 wrote: 1. The discount on options for customer groups isnt being applied. I can log in as a trade customer go to a product, the base price is reduced from the discount assigned to the customer group but no discount applied to the options.
2. if I add a product to the shopping basket it adds it at the default price not the discounted one.

However... problem 1 seems different...
Are you sure the options don't have discount 0% set? (instead of an empty value?)
I'll look into these problems too...
I'm having a little trouble finding the time, as I also have a day job.
Amma get to it asap.
Thanks for your reply.
Solved it. Think it was a combination of things. the default % was set to zero instead of blank. All though this did not initially change anything I cthen leared the vqcache ( I had already cleared the system cache to no avail) closed and restarted firefox and tried again with success. All seems to work fine.
Thanks again.
Chris
I am wondering if there is a way to assign an option price by customer group with a fixed amount not a % discount.
The scenario I have is my client has 4 customer groups.
Default, Perfomrers - 20% off, Education 25% off and Wholesale fixed amount by product. This is fine apart from on options that change the price.
Your mod works great for the % based discounts but I am struglling with the fixed price discount. Any ideas would be appreciated.
Regards
Chris
Hi Chris,dunn123 wrote:Hi
I am wondering if there is a way to assign an option price by customer group with a fixed amount not a % discount.
.............
Your mod works great for the % based discounts but I am struglling with the fixed price discount. Any ideas would be appreciated.
Sorry, only % based discounts...
That's the way this mod works. It takes the normal price, and "multiplies" it with the set discount...
Thanks to "Product Specials" we are able to set multiple fixed prices for products.
As there is no such thing for Options, this is (currently) not possible.
Adding this functionality would require A LOT of code changes to A LOT of files... (No plans for adding this feature)
I understand your point but if you have a lot of categories it can be complicate. What I'd like to have is something the following:AvanOsch wrote:It's feasible, but unnecessary IMO...madimar wrote:AvantOsch,
I'm finally testing your contribution. I'm just thinking about again to the nested category point. It could be really great if a discount set to a category could be propagated to all its nested categories. At the moment, for my needs, this is a fundamental point.
Do you think it could be feasible?
You can go to Catalog --> Categories, Select the parent category and all it's children, and set the discount(s) for those categories from there using the Discounts Dialog...
PARENT with 20 children: CHILD-1, CHILD-2, ... CHILD-20
I set a discount to PARENT of 10% and the discount is generally inherited to all children.
I set a discount only on CHILD-15 of 20%. This discount overrides the inherited discount.
This mechanism should apply also with more level of nested categories.
M
-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------
Hi great AvanOsch, I know your work is free and you don't have too much time to work on it, but... are you going to work on a fix for caching problem? Just to know,AvanOsch wrote: Dunn123, I think (hope) those bugs have to do with the previously reported cache-problem.
Amma get to it asap.
thank you really for your work,
M
-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------
Hi M,madimar wrote:are you going to work on a fix for caching problem?
Yes I am.
I'll also have a look into the possibility of getting the parent category's discount, when a child has no discount set.
I don't know if that is simple to add, or a whole lot of work...
I'll need to have a look....
Caching problem is first though.
M
Sent from my DesireHD.
-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------
- Caching problems should now be solved.
- Added "Child inherits discounts from Parent" as Madimar suggested.
- I compared the code with OpenCart v1.5.3.1 too, and made sure vQMod validates there too.
I did not test in v1.5.3.1 yet though...
Let me know what you think.
Just installed customer group discount and just what I wanted. Thanks for the free mod.
I'm zero in codings hence don't know how to solve.
1) I believe this is a case of mod clashing where this error comes out on top of my homepage and product page at the frontend and in my system error log.
http://vvcap.net/db/MBJ6XfUrfzOqV8w3ufK9.htp
I think its clashing because once I uninstalled the ''customer group name' mod, or once I logged in as a customer (when its the mod is installed) the error disappears.
This mod just basically shows the customer group name in brackets next to the customer name.
http://vvcap.net/db/jphCW3xLz30hZkOF4SPt.htp
2) My vqmod error log on the other hand shows another error (with or without the clashing mod installed)
---------- Date: 2012-07-01 21:47:25 ~ IP : ... ----------
REQUEST URI : /defaultcart/admin/index.php?route=module/vqmod_manager/vqmod_install&token=54f9939257a30263071abdd465679502&vqmod=customer_id_home_page
MOD DETAILS:
modFile : /home/.../defaultcart/vqmod/xml/GroupDiscounts.xml
id : Customer Group Discounts
version : 1.0.3
vqmver : 2.1.5
author : The Wizard of Osch, for www.CrystalCopy.nl
Could not resolve path for [admin/language/dutch/catalog/category.php] (SKIPPED)
Could not resolve path for [admin/language/dutch/catalog/option.php] (SKIPPED)
Could not resolve path for [admin/language/dutch/sale/customer_group.php] (SKIPPED)
Could not resolve path for [admin/language/dutch/setting/setting.php] (SKIPPED)
Could not resolve path for [admin/language/dutch/setting/store.php] (SKIPPED)
----------------------------------------------------------------------
Though this error do me no harm but its filling up my vqmod error log
May I know anyway I can fix both of these?
Thanks!
Users browsing this forum: No registered users and 1 guest