cippoco Posted April 29, 2017 Share Posted April 29, 2017 Dear all, i'm tryng to apply a new specific cart rule that will discount by percentage a specific category of mine shop, if i add the rule whitout any condition it work and all the items in the shop will discounted, but if i add a condition (it can be indifferently a category, size, brand...) the rule doesn't work anymore. Someone has encounter the same problem? Attached the rule config, but the strange thing is whitout any condition it work, whit one it doesn't... Link to comment Share on other sites More sharing options...
cippoco Posted May 1, 2017 Author Share Posted May 1, 2017 Dear all, someone have a suggestion? I'm gone fool trying configurations... Link to comment Share on other sites More sharing options...
NemoPS Posted May 1, 2017 Share Posted May 1, 2017 Prestashop Version? You mean ANY condition on its own doesn't work? 1 Link to comment Share on other sites More sharing options...
cippoco Posted May 1, 2017 Author Share Posted May 1, 2017 Hi Nemo, yes, just a condition over the standard config couse the catalog rule stop to work, ps version is 1.7.1.1 and i use webservice to populate store facets and products. Link to comment Share on other sites More sharing options...
NemoPS Posted May 2, 2017 Share Posted May 2, 2017 Pretty odd, can you test a clean install locally or on the same server, and see if it has the same issue? Link to comment Share on other sites More sharing options...
cippoco Posted May 3, 2017 Author Share Posted May 3, 2017 I'm gone to create it and i let you know, i've tryed to run the rule whit the default theme and whit 3rd part modules disabled but was the same... Link to comment Share on other sites More sharing options...
cippoco Posted May 4, 2017 Author Share Posted May 4, 2017 Hi Nemo, i've created a new developing website and install theme and module as the production website and logically here work rules work fine! Is there a way to test the query the fornt office execute to display an article and check if there is something in the db corrupted? Link to comment Share on other sites More sharing options...
cippoco Posted May 6, 2017 Author Share Posted May 6, 2017 (edited) I've find a difference in a query return the specific price article between the two website installed, in the preduction website it doesn't take the id_product and doesn't return anything: SELECT SQL_NO_CACHE *, ( IF (`id_group` = 3, 2, 0) + IF (`id_country` = 10, 4, 0) + IF (`id_currency` = 1, 8, 0) + IF (`id_shop` = 1, 16, 0) + IF (`id_customer` = 1, 32, 0)) AS `score`FROM `ps_specific_price`WHERE`id_shop` IN (0, 1) AND`id_currency` IN (0, 1) AND`id_country` IN (0, 10) AND`id_group` IN (0, 3) AND `id_product` = 0 AND `id_customer` = 0 AND `id_product_attribute` = 0 AND (`from` = '0000-00-00 00:00:00' OR '2017-05-06 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2017-05-06 00:00:00' <= `to`)AND IF(`from_quantity` > 1, `from_quantity`, 0) <= 1 ORDER BY `id_product_attribute` DESC, `id_cart` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC LIMIT 1 While in develop website the id_product as a value (also a difference between the statment, production use the '=' while dev use 'IN ()' but it doesn't influence the result) SELECT SQL_NO_CACHE *, ( IF (`id_group` = 1, 2, 0) + IF (`id_country` = 10, 4, 0) + IF (`id_currency` = 1, 8, 0) + IF (`id_shop` = 1, 16, 0) + IF (`id_customer` = 0, 32, 0)) AS `score`FROM `ps_specific_price`WHERE`id_shop` IN (0, 1) AND`id_currency` IN (0, 1) AND`id_country` IN (0, 10) AND`id_group` IN (0, 1) AND `id_product` IN (0, 355) AND `id_customer` = 0 AND `id_product_attribute` = 0 AND (`from` = '0000-00-00 00:00:00' OR '2017-05-06 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2017-05-06 00:00:00' <= `to`)AND IF(`from_quantity` > 1, `from_quantity`, 0) <= 1 ORDER BY `id_product_attribute` DESC, `id_cart` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC LIMIT 1 Both query are taken from SpecificPrice.php that are the same file on both the website... Now i'm stopping at this point and i can't understand why this difference, can you suggest something? Edited May 6, 2017 by cippoco (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted May 8, 2017 Share Posted May 8, 2017 That's very odd. Something on your live site is preventing the code before the query from retrieving product ids.How many products does your catalog have on the live site? Link to comment Share on other sites More sharing options...
cippoco Posted May 8, 2017 Author Share Posted May 8, 2017 About 2000 articles, i'm going to make a brand new website, i don't know what i can do more... Link to comment Share on other sites More sharing options...
cippoco Posted May 8, 2017 Author Share Posted May 8, 2017 I've got! When i pass the 1002 articles the rule condition stop working!!! Damn, is there a limit? Link to comment Share on other sites More sharing options...
NemoPS Posted May 10, 2017 Share Posted May 10, 2017 Yes there is, the threshold is set to 1000 actually classes/SpecificPrice.php protected static function filterOutField($fieldName, $fieldValue, $threshold = 1000)Change the default threshold to like 10k insteadFabio 1 Link to comment Share on other sites More sharing options...
cippoco Posted May 10, 2017 Author Share Posted May 10, 2017 Hi Fabio, i've found it, i've created also a post under "bug report" forum section because i considered it as a bug, nowhere is explained how it work. Why there is this limit? I can change it whitout any compromise? Thank you Link to comment Share on other sites More sharing options...
NemoPS Posted May 12, 2017 Share Posted May 12, 2017 Good question, I always wondered myself and it gave me plenty of headaches before finding out what it was.Anyway I guess it's there to prevent excessive resource leakage, but if your server can handle it, no problem 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