Jump to content

How to make group discount that not affect special products


Recommended Posts

HI community,

I have 10% of Customer group discount. Only thing I want is when i make special discount for specific product (special product) that 10% customer discount to be not applyed.

 

If I have 50% discount on specific product when user is loged as customer discount will be 60% BUT I want to be 50%

 

How to make this? Thanks.

Link to comment
Share on other sites

Hi sazz,

 

After checking the code here and there, I believe this is actually simple:

 

edit file /classes/Product.php  (Make Backup!!! Or even better, make an override)

 

 

Find function:

public static function priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $zipcode, $id_currency,
$id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, &$specific_price, $use_group_reduction,
$id_customer = 0, $use_customer_price = true, $id_cart = 0, $real_quantity = 0)
 
 
In there, you will find the following code (Sample form PS1.6.0.8), and add the red code
 
if ($use_reduc)
  $price -= $specific_price_reduction;
 
// Group reduction
if ($use_group_reduction && !$specific_price) // No group discount for already reduced prices...
{
  $reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group);
  if ($reduction_from_category !== false)
    $group_reduction = $price * (float)$reduction_from_category;
  else // apply group reduction if there is no group reduction for this category
    $group_reduction = (($reduc = Group::getReductionByIdGroup($id_group)) != 0) ? ($price * $reduc / 100) : 0;
}
else
  $group_reduction = 0;
 
 
I believe this is all. What it does: It checks if the current user is of a group that has group reduction. If the product has NO specific discount, it will apply the general group reduction. if it HAS a reduction already, the group reduction will not be applied.
 
 
Be careful with products that have a lower discount than the general group discount, as the customer may get upset that it doesn't get his/her XX group discount "that she always gets"!
Example:
special discount 5%
VIP group discount 10%
 
the customer of group VIP only gets a 5% discount on that article, as the group discount is not applied.
(To fix this, you could make a special cart rule for that product that applies only to the VIP group, with will then get a 10% discount or so.)
 
Hope this helps,
pascal.
Link to comment
Share on other sites

  • 4 months later...
  • 5 months 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...