WebPT Posted February 13, 2017 Share Posted February 13, 2017 This is getting anoying, I have a lot of products on a certain category and some users simply change the URL and manual imput the number of products that I have in that category making the website slow in each refresh. Is there any easy way I can avoid this? The max value shown to customers is 100 on the dropdown box, but they simply can change the url Example: xxxxxxxx?id_category=11111&n=20 they change to xxxxxxxx?id_category=11111&n=123123123 In this example the 123123123 is the number shown to customers on how many products there are in a certain category, when they change the URL they can see all products on same page, now imagine a bunch of people doing the same over and over Thanks in advance! Link to comment Share on other sites More sharing options...
Doulas Akula Posted February 13, 2017 Share Posted February 13, 2017 Is the main problem the website being slow or you dont want customers to be able to edit url parameters. If the website is slow - there are optimisation measures you could take to make it faster even if users type parameters directly on the address bar. However if you need to change such that the parameters cant be seen on the address bar and therefore uneditable - It might mean changing the way the parameters are passed to prestashops core from get to something like post. - but this if the issue is speed wont be worth the effort Link to comment Share on other sites More sharing options...
WebPT Posted February 13, 2017 Author Share Posted February 13, 2017 Is the main problem the website being slow or you dont want customers to be able to edit url parameters. If the website is slow - there are optimisation measures you could take to make it faster even if users type parameters directly on the address bar. However if you need to change such that the parameters cant be seen on the address bar and therefore uneditable - It might mean changing the way the parameters are passed to prestashops core from get to something like post. - but this if the issue is speed wont be worth the effort Thank you for your reply. One of the main issues is the site being slow because right now it's sitting on a shared server, but the plan is to move it to a dedicated server. All optimizations i've tried don't cause significant changes. Any good material here on the foruns about optimizations or somewhere on the web I may have missed? I'm currently using 1.6.1.11 Link to comment Share on other sites More sharing options...
Doulas Akula Posted February 14, 2017 Share Posted February 14, 2017 What does your site score on pingdomtools (https://tools.pingdom.com) and on gtmetrix (gtmetrix.com). Check and share the scores or action some of the high priority recommendations Link to comment Share on other sites More sharing options...
Geo Burlibasa Posted February 14, 2017 Share Posted February 14, 2017 You could make an override to encode that variable in base64, then decode it back Link to comment Share on other sites More sharing options...
bellini13 Posted February 14, 2017 Share Posted February 14, 2017 You can make a server side change, so that the value passed into the URL cannot exceed a certain number. I believe this would be controlled in the FrontController class, which has a function named pagination. It retrieves the value of 'n' from the URL. So if you override this class/function, you can check the value of n, and if it is higher than xx, then you can change it back to 100 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