• Resolved frogandfrond

    (@frogandfrond)


    Hello! I was adding rules to a shipping method. After Rule #46, it wouldn’t let me save any more new rules. I can change the order of the rules or change the details, but cannot add a new rule. Is 46 the maximum number of rules I can add to one shipping method? Thank you for your help in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wp-centrics

    (@wpcentrics)

    Hi, @frogandfrond, there isn’t limits for number of rules, I suspect there is related with the PHP max_input_vars limit:

    https://www.php.net/manual/en/info.configuration.php#ini.max-input-vars

    …some hosting providers allow users to change this value on PHP.ini preferences, but not all…

    However, I think 72 conditional rules are so much, and you/we should find a better way to do what you need in a better/clearer/efficient way… please, open another topic asking the better way to configure whatever your shop needs

    Kind regards,
    Carles Martin
    wp-centrics support team

    Thread Starter frogandfrond

    (@frogandfrond)

    Thank you for your quick response, Carles. I’ll look into it.

    It was not 72 rules, I got stuck at #46. ??

    Thread Starter frogandfrond

    (@frogandfrond)

    Hi Carles,
    I changed the PHP max_input_vars limit from 1000 to 3000 and restarted the server. It still doesn’t let me add any rules after #46. I have also noticed that it’s not only the rules I cannot add, but I cannot add any criteria/selectors within existing rules after a certain point.

    What exactly happens is, that when I try to add a new rule or new selector, I can actually add one, but when I click the “Save Changes” button, it disappears. “Your settings have been saved” message near the top of the screen is also missing.

    46 or 72 rules might sound a lot, but each rule is simple and clear at least to me and it would be wonderful if I could add as many rules as I like to provide my customers with optimal shipping rates. Thank you!

    Plugin Author wp-centrics

    (@wpcentrics)

    Hi @frogandfrond, sorry about 46/72 mistake. In any case: there is more/less fields on each rule depending of which settings are set on each (MIN/MAX fields, actions, etc.). The Fish and Ships interface works in JavaScript, and you can add/duplicate infinite rules, without any limitation, and when you click on “Save changes” button, this values will be sento to the webserver as any other form, in the same way WooCommerce built-in shipping methods does.

    I tested it in a XAMPP local environment, duplicating all rules every time, and I was able to save up to 48, next duplication (96) has been ignored, like you say.

    On the local webserver log errors, I found this message:

    Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0

    I changed the limit to 3000 and restarted, adding this lines into PHP.ini:

    suhosin.get.max_vars = 3000
    suhosin.post.max_vars = 3000
    suhosin.request.max_vars = 3000
    max_input_vars = 3000

    Following this article: https://www.enquerer.com/what-is-max-input-vars-and-how-to-change-it/

    And then I was able to save the 96 rules without any problems.

    Please, check your log errors on your server, and check any limitation by doing a phpinfo(), some other module may lock the max vars:
    https://kinsta.com/knowledgebase/phpinfo/

    In any case: I think there is too much rules, maybe rules can be set in a more general way, you can open a new thread about if you want help about it.

    Kind regards,
    Carles Martin
    wp-centrics support team

    Plugin Author wp-centrics

    (@wpcentrics)

    After a while, I close this topic.

    Please, open another one if your question persists

    Regards,
    Carles Martin

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Limit on the number of rules?’ is closed to new replies.