Jump to content

Configuring group discounts per category: Please help


Recommended Posts

Hi,

 

I'm trying to set up a group where I can give members of the group 15% discount on products in 2 of my categories.

 

I set up the main discount for the group to be 0% (Will automatically apply this value as a discount on ALL shop's products for this group's members.)

 

At the bottom of the configuration page, I then added a 'New Group Discount' of 15% for each of the categories that I want the discount applied to.

 

What I thought this would do would be to apply 15% discount to only the 2 categories that I configured that way, all other categories would have 0% discount by default.

 

The problem is that when a customer in that group logs in, they do not see the discount. The products in those categories set up to be 15% discount actually show up as 0%. So it seems that the 0% discount is being applied to all categories, and it's not picking up the 2 categories with 15% discount applied.

 

Am I setting it up wrong? Any help or pointers much appreciated.

 

Cheers,

 

Bern

Link to comment
Share on other sites

  • 2 weeks later...

I have the same problem in parts of my testing.

 

PrestaShop 1.4.6.2 Testing Customer Group and Group Category Discount Percentages:

(example group foo)

-you can define a customer group with a global discount percentage price to all your shop products.

-optionally assign each category a specific discount percentage, categories not specifically defined use the main group discount.

-adding a group discount on subcategory not directly under home was overridden by parent discount, and did not work in our testing. (to do: bug report)

Test example:

1. add customer group foo

2. add main discount for group foo at 30%

3. add group category discount in foo of 80% (category laptops)

4. assign test customer to group foo

5. log in as test customer assigned to group foo

Result (worked): 30% on all products not in category laptops, category laptops 80% discount

1. Changed main group discount foo to 0% from 30% (this test to prove reported bug not in 1.4.6.2)

Result (worked) all products 0% discounted except laptops which were discounted 80%

Using this method you can set up your wholesale prices using base PrestaShop.

What did NOT work in testing:

Add a subcategory to a parent category (other than home) in this example ipods with discount percentage.

1. Add catalog subcategory foo to parent category ipods

2. Added a product to subcategory foo

3. edit customer group foo

4. add new group discount, subcategory foo, global discount 40%

5. add group to test customer

6. login in as test customer

Result (not working) prestashop discounted the product under subcategory foo with the value in group discount for parent category ipods.

 

Require more testing but my brain is frita...

  • Like 1
Link to comment
Share on other sites

Could you give me your back office credentials in PM so I can take a look?

 

Hi, Carl, re. my post above, I will send you credentials after a little more testing on my side. Here is the code in 1.4.6.2 classes/GroupReduction.php called by product.php. I can only imagine that $id_group is not getting set properly.

 

the code in classes/Product.php

 // Group reduction
 if ($use_groupReduction)
 {
  if ($reductionFromCategory = (float)(GroupReduction::getValueForProduct($id_product, $id_group)))
   $price -= $price * $reductionFromCategory;
  else // apply group reduction if there is no group reduction for this category
   $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100);
 }

classes/GetReduction.php

public static function getValueForProduct($id_product, $id_group)
{
 if (!isset(self::$reductionCache[$id_product.'-'.$id_group]))
  self::$reductionCache[$id_product.'-'.$id_group] = Db::getInstance()->getValue(
		    'SELECT `reduction`
		    FROM `'._DB_PREFIX_.'product_group_reduction_cache`
		    WHERE `id_product` = '.(int)($id_product).' AND `id_group` = '.(int)($id_group));
 return self::$reductionCache[$id_product.'-'.$id_group];
}

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I do not know if you have found a solution to your problem but I found that the following method seems to work:

 

1)Set the main discount of the group to 0 and click the save button.

 

2)Under "New Group Discount" create the discount for the specific category that you want and then click the "add" button.

 

**IMPORTANT** Do not click the "save" button again. If you do it will not recognize your individual category discounts you created.

Every time you click on the "Save" button it will only apply your main discount and you will have to redo your individual category discounts.

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

I'm having the same issue with PS 1.5.6.0

I tried just adding adding the category discount in the group without saving later, recommended by (lnsnifty) but it doesn't work for me.

Any of you have this working on PS1.5? 

ElPatron - What do you recommend?  Same fix you suggested for PS 1.4.6.2?

Link to comment
Share on other sites

I'm having the same issue with PS 1.5.6.0

I tried just adding adding the category discount in the group without saving later, recommended by (lnsnifty) but it doesn't work for me.

Any of you have this working on PS1.5? 

ElPatron - What do you recommend?  Same fix you suggested for PS 1.4.6.2?

 

make sure the customer is only in the group with discount, (the one you are testing from)...I don't think it will work if customer is also in default group.

Link to comment
Share on other sites

make sure the customer is only in the group with discount, (the one you are testing from)...I don't think it will work if customer is also in default group.

 

Thank you for your reply El Patron.  The groups that I'm testing with are non-default, these are new groups added by me.  In this case my test is being done with a customer who is only in the one group I'm adding the Category Discount to.  Pricing doesn't change at all.

Link to comment
Share on other sites

Thank you for your reply El Patron.  The groups that I'm testing with are non-default, these are new groups added by me.  In this case my test is being done with a customer who is only in the one group I'm adding the Category Discount to.  Pricing doesn't change at all.

make sure you have this fix...

 

https://github.com/PrestaShop/PrestaShop/commit/fef8d2beac37271fb2161d7f7ece1bceb2bfb76e

Link to comment
Share on other sites

 

Thank you El Patron.  I had tried this fix before to no avail.  I still tried it again, made sure I deleted cache files, deleted and re-added the group discount, logged out and back in.  It still doesn't work. What else can I try?

Link to comment
Share on other sites

Thank you El Patron.  I had tried this fix before to no avail.  I still tried it again, made sure I deleted cache files, deleted and re-added the group discount, logged out and back in.  It still doesn't work. What else can I try?

 

Please open up a bug report here.  Please  post the but report link here so we can vote it up.

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...