userdeviant Posted April 1, 2012 Share Posted April 1, 2012 (edited) Hi all, I need to increase all prices of everything by 5% and for some customers I need to decrease prices by 30%. So first group of customers will have 105% when the second ones will have 70% of original prices. I do not know where are prices calculated, I am not good programmer so my solution is add negative value (-5%) for group of customers which will have increased prices. I did it manually to ps_group table. Eeverything seem to be ok and prestashop seems to by ok etc. so my question is not about solution but about "what I did by that". Did I something wrong when I added negative value to that table? Is any possibility to tell me if prestashop will crash or something when it will use that negative percent? Thank you for any answers Note: I have Prestashop 1.4.7.0 EDIT: Or, if somebody could tell me where exactly is calculated price vs. group discount and which way is result used for display and another actions. Maybe name of files and row in that files ... and I will try look myself if there could be any problem. Thank you Edited April 2, 2012 by userdeviant (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted April 2, 2012 Share Posted April 2, 2012 You can configure group price reduction inside the group configuration. Just edit the group and enter the discount in percent. You cannot enter an increase here however (like 105%). Why not just start with your prices 5% higher, and then reduce appropriately for the other group? Link to comment Share on other sites More sharing options...
userdeviant Posted April 2, 2012 Author Share Posted April 2, 2012 Thank you for your reply I can not do what you wrote. I need prices inside shop at their 100% value and then: - one group have 5% higher (only way for me is place negative value to database, because at BO it can not be done) - second group will have 30% discount Problem is, that 30% discount is from 100% price. If I use prices at their 105% value as 100%, then 30% from that value is not same of course. If I want discount from 105% value same as described above, so it is in real 33.3333333.........%, but prestashop uses only 33.33% and when price is little higher, there is little difference ... and of course next problem is round of value with that 33.33% discount. If you know which file I could check to decide if calculating of discount with -5% is or is not a problem for another parts of shop, I will look myself, thank you very much Link to comment Share on other sites More sharing options...
hsmonline Posted May 24, 2013 Share Posted May 24, 2013 Did you end up finding a solution for this, I also really need to figure out how to do this, thanks! Link to comment Share on other sites More sharing options...
ricky11 Posted March 13, 2014 Share Posted March 13, 2014 Hi, interesting option in editing the db directly, i am still looking where the math code calculation is for group price reduction ... Link to comment Share on other sites More sharing options...
ricky11 Posted March 13, 2014 Share Posted March 13, 2014 I think i may have found it in classes/product.php You can try to edit the following code : // Group reduction if ($use_group_reduction) { $reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group); if ($reduction_from_category !== false) $price -= $price * (float)$reduction_from_category; else // apply group reduction if there is no group reduction for this category $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100); } simply reverse + / - Try changing last line to $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100);. For me this works and works in product lists and should also work in product page. However for me i am using a attribute grid module on the product page and it's not working there. But hope this helps for you guys!..... 1 Link to comment Share on other sites More sharing options...
PrestaShark Posted October 1, 2014 Share Posted October 1, 2014 I think i may have found it in classes/product.php You can try to edit the following code : // Group reduction if ($use_group_reduction) { $reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group); if ($reduction_from_category !== false) $price -= $price * (float)$reduction_from_category; else // apply group reduction if there is no group reduction for this category $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100); } simply reverse + / - Try changing last line to $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100);. For me this works and works in product lists and should also work in product page. However for me i am using a attribute grid module on the product page and it's not working there. But hope this helps for you guys!..... Life saver to add margin for all prices imported via dropship wholesale integration! Link to comment Share on other sites More sharing options...
PrestaSOO Posted October 2, 2014 Share Posted October 2, 2014 (edited) Your default Prestahop doesn't meet your requires. In fact, you have to create some groups and assign a promotion rule . Try SOO Prestashop Discount module - it could creates several promotion rules for several groups - not only price increase by group. Edited October 2, 2014 by DeJour (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted October 13, 2014 Share Posted October 13, 2014 You can consider to use the M4 Category discount module to set surcharges (and discounts) for customer group & category combinations. All at one page, in bulk. Link to comment Share on other sites More sharing options...
joseantgv Posted March 15, 2016 Share Posted March 15, 2016 Please check this module: http://addons.prestashop.com/en/7422-price-increment-reduction-by-groups-categories-more.html Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now