xaviour Posted December 4, 2012 Share Posted December 4, 2012 HI, I need to check the postcode where I am going to deliver before accepting payment. if the post code matched then proceed to payment else display an error message. I know its a very easy thing and am sure one of you can help me figure this out. Thank you. Link to comment Share on other sites More sharing options...
tomerg3 Posted December 4, 2012 Share Posted December 4, 2012 It's not such a quick fix, especially if you do it right and not use a simple Javascript for it. One approach would be to modify the function that validates a zipcode, and return an invalid response if the post code does not match the ones you wish to use. Keep in mind that it requires some coding language, and may have other effects that I am not thinking about at the moment. A simpler option would be the following shipping module http://www.prestashop.com/forums/index.php?/topic/148747-module-localized-shipping-set-shipping-rates-by-country-state-or-zipcode-range-or-wildcard/ It lets you specify shipping by country state or post code (including ranges and wildcard), which would allow you to limit shipping only to certain post codes, without having to modify any code. Link to comment Share on other sites More sharing options...
xaviour Posted December 6, 2012 Author Share Posted December 6, 2012 Hmm.. ya but that would just complicate things for me as of today. However, is it possible As currently I am only delivering in one pin-code area and city. I wanted to know if its possible to set the city and pincode to a default value and prevent the customer from editing it (disable in form). Link to comment Share on other sites More sharing options...
tomerg3 Posted December 6, 2012 Share Posted December 6, 2012 Everything is possible, you would have to edit some core files or create overrides. You may be able to only modify the address class to always return the same zip & city. Link to comment Share on other sites More sharing options...
xaviour Posted December 7, 2012 Author Share Posted December 7, 2012 Ya that's what i am trying to do now but getting errors like a blank screen. Think you can give me a pointer or two on how to do it. Thanks in advance. Link to comment Share on other sites More sharing options...
tomerg3 Posted December 7, 2012 Share Posted December 7, 2012 I already gave a pointer, I cannot write the code for you. If you get a black screen, try to turn on error reporting in /config/config.inc.php line #28. If you have any specific questions, we'll try to answer them. Link to comment Share on other sites More sharing options...
xaviour Posted December 7, 2012 Author Share Posted December 7, 2012 Hmm... thanks for your help but I had figured that class based on my limited programming lang but don't know how to set the values, that's why I posted here. Hoping someone might have a better solution. As I am not a programmer but an entrepreneur. Link to comment Share on other sites More sharing options...
tomerg3 Posted December 7, 2012 Share Posted December 7, 2012 I gave you the most simple and easy solution, which uses a module for postcode based shipping, that requires no programming skills. Link to comment Share on other sites More sharing options...
xaviour Posted December 8, 2012 Author Share Posted December 8, 2012 LOL! ya.. no worries i'll figure something out. Thanks for your help. Link to comment Share on other sites More sharing options...
xaviour Posted December 11, 2012 Author Share Posted December 11, 2012 OK! Solved! All I needed to do was edit the isPostCode($postcode) & isCityName($city) in Validate.php to check the city name and post code entered. Preferably override it. well tomreg this was easier wasn't it Link to comment Share on other sites More sharing options...
tomerg3 Posted December 11, 2012 Share Posted December 11, 2012 Sure was, and I'm sure you get more satisfaction from figuring it out (which is always the way I chose to go). However, it didn't sound like you were interested in doing any changes before, but rather have someone else do them for you (which is the easiest way) Link to comment Share on other sites More sharing options...
xaviour Posted December 11, 2012 Author Share Posted December 11, 2012 LOL! I only post here only after trying out everything I know about programming and searching the forum about similar topics. As far as I know the whole point of having a forum is to help users out (programmers & "merchants") but currently the whole point of this forum is to sell modules irrespective of the users needs.I am not criticizing this approach as its a very effective way of selling but trying to highlight that a certain level of discretion is necessary. PS: you had just told me to look into Validate.php ,I would have done the rest as I did not know where the code gets validated. Link to comment Share on other sites More sharing options...
tomerg3 Posted December 11, 2012 Share Posted December 11, 2012 The forum is indeed for helping people, which is often done with a module, especially when the question is not really a specific code related question, but rather a "how do I do X and Y", rather than "I tried X and Y and got the following error" While those also get answered, as I did trying to point you in the right direction, and told you how to troubleshoot the white screen you got, you never mentioned an error you got, or any of the things you tried to do. Instead you took the "I'm not a developer approach" which is not likely going to get you many answers. I can't speak for others, but I try to help people that seem to want help resolving issues and not have others solve their problems... 1 Link to comment Share on other sites More sharing options...
Zen_j1 Posted January 2, 2013 Share Posted January 2, 2013 OK! Solved! All I needed to do was edit the isPostCode($postcode) & isCityName($city) in Validate.php to check the city name and post code entered. Preferably override it. well tomreg this was easier wasn't it Hi there, I would like accept order from City ABC only What changes I should do in validate.php or in isCityName($city) to make this work. Looking forward for your help. Thanks in advance 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