superskyman100 Posted July 4, 2020 Share Posted July 4, 2020 (edited) Hello, Prestashop 1.7.6.4 I've spend hours on that problem, there is no solution on google/forums/github, so i'm desperate and post here.... CONTEXT : Apart from 'static' discounts, shops create dozens of new/dynamic cart rules per day, due to usual marketing modules - affiliate discounts - sponsor discounts - social link discounts - newsletter discounts - abandoned cart reminders discounts....... - etc etc etc..... PROBLEM : with Prestashop, new discounts are always created compatible with all others, even if the 'compatibility' checkbox is unchecked. This is a subtle bug that leads to big complications.... When the 'compatibility with other cart rules' box is unchecked, the corresponding cart rule SHOULDN'T be compatible with others (actually this is not the case !) so that users may CHOOSE in between two opposite automated behaviors. ILLUSTRATION : Case 1 : the 'compatibility with other cart rules' is uncheked.... the cart rule is compatible with others (bug) Case 2 : we check the 'compatibility with other cart rules' checkbox >>> the discounts will be set as.... compatible too, by default....... 😕 CORRECTION : Just logics...... - if 'compatibility with other cart rules' is unchecked : the corresponding cart rule must be incompatible by default with all others cart rules (newly created or existing) >>> this is the bug that needs to be fixed - if 'compatibility with other cart rules' is checked : the corresponding cart rules must be compatible by default with all existing or created new rules, and we can finely tune its eventual uncompatibility >>> this is the actual behavior I think someone who know a bit the Prestashop controllers or PHP or whatever in coding could fix that problem in few minutes... It took me hours to write this damn message and look on internet.... Thanks !! Edited July 6, 2020 by superskyman100 must make clearer (see edit history) 1 Link to comment Share on other sites More sharing options...
razaro Posted July 6, 2020 Share Posted July 6, 2020 Hi First sorry I have to start from end of your message: it took you hours to write it but you expect someone can fix it in few minutes ? It just does not work like that, just to warn you if you expect quick results. And about issue it is true, it can create big issues because of default settings. And while they might work fine for stores that use small amount vouchers/car rules for stores that use different kind of vouchers like you mention it can cause big problems. We had similar issue with one client, they wanted to import 3 x 100.000 voucher codes. And import module took long time and eventually crashed server. Reason: ps_cart_rule_combination table was about 20GB Because of numbers of vouchers it exponentially grows. We had to find custom solution for that by making dynamic vouchers, added only on use and incompatible with other rules. So what you can do ? I advice you take this directly with PrestaShop developers team by creating new issue on https://github.com/PrestaShop/PrestaShop/issues if there is not any similar already. For forum I found this so maybe can be used to change CartRule class but needs testing. P.S. Please do not bump topic after an hour and also do change topic title, by editing first post, because using Caps is against forum rules. Link to comment Share on other sites More sharing options...
superskyman100 Posted July 6, 2020 Author Share Posted July 6, 2020 (edited) Hi Razaro, thank you for your answer, yes you are completely right, it might take a bit more than few minutes to solve such issue Sorry for the caps, i will change title tomorrow so that the post won't bump too fast. For solutions, on Github, some guys recomend to do this SQL command line : UPDATE ps_cart_rule SET cart_rule_restriction = '1' WHERE ps_cart_rule.id_cart_rule > 0 Only problem, is that : 1/ i would need to automatize/run that command line every hour or so, do you think this would be possible through cronjob ? (that may sound stupid question but i'm no programmer) 2/ i have to adapt a bit this command line so that ONLY SOME SPECIFIC cart rules names would become incompatibles, but only some of them. ex : some cart rules with name "SEXYCODE" (cart rule with name SEXYCODE have random generated code) . Maybe you can help to give me the SQL query line i could write to do so (sorry again, but i'm beginner for programming) ? I think if i can combine kindda Cronjob + SQL query this should be sufficient. I won't have 20Gb of cart rules OMG, your customer is a big fish ! Thanks, have a good day Edited July 6, 2020 by superskyman100 (see edit history) 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