Danimt Posted November 9, 2012 Share Posted November 9, 2012 (edited) Hey, What I'm trying to accomplish is the following: If Products don't have a price, show "Request price" [Done] If the user clicks on "Request price" it sends an e-mail with the product reference, description, url and client name [Done] Create a new database column for saving the "Request price" status, and keeping users from flooding with massive clicks on the same product request [Done]. Interaction in frontend with database column (read proccess only) [Done] Save state (from false to true) in the product column [This is where I need help] Example on some products there is "Requisitar preço" (Request price), when you click it will send an e-mail to us with the product info and user name. (You won't be able to see it, as it only shows to registered users) http://loja.tavrol.pt/pt/20 Now I need to save "true" (bool) into the DB column for the selected product. Any ideas? Thanks Edited November 21, 2012 by Danimt (see edit history) Link to comment Share on other sites More sharing options...
Danimt Posted November 11, 2012 Author Share Posted November 11, 2012 Any ideas? Is this even possible? Link to comment Share on other sites More sharing options...
Danimt Posted November 19, 2012 Author Share Posted November 19, 2012 Bump? If you don't have the solution you could leave some tips... Link to comment Share on other sites More sharing options...
vekia Posted November 19, 2012 Share Posted November 19, 2012 you can create module, with simple form where you put the request id, then module change the "status" value to true 1 Link to comment Share on other sites More sharing options...
Danimt Posted November 19, 2012 Author Share Posted November 19, 2012 you can create module, with simple form where you put the request id, then module change the "status" value to true Thank you for your answer. I'll dig deeper into creating modules and see how that turns out. Link to comment Share on other sites More sharing options...
vekia Posted November 19, 2012 Share Posted November 19, 2012 Thank you for your answer. I'll dig deeper into creating modules and see how that turns out. moreover - you can create module with simple php script. For example when you open page like "your.domain.com/module/your_module/status.php?request_id=id module will change status to "true" in your shop database. You can add this link in mail with request, it's simplest than module with form, because you can change request status by one mouse click 1 Link to comment Share on other sites More sharing options...
Danimt Posted November 19, 2012 Author Share Posted November 19, 2012 (edited) moreover - you can create module with simple php script. For example when you open page like "your.domain.com/module/your_module/status.php?request_id=id module will change status to "true" in your shop database. You can add this link in mail with request, it's simplest than module with form, because you can change request status by one mouse click I was hoping to maintain my current php file I use to handle the ajax post request and do the SQL update from there by including the necessary DB connection files but i'm not finding much info on that. Any idea on how to enable database querys and execution from a php file included in the template directory? (what files do I need to include to have access to Db::getInstance();) Edited November 19, 2012 by Danimt (see edit history) Link to comment Share on other sites More sharing options...
Danimt Posted November 21, 2012 Author Share Posted November 21, 2012 I was hoping to maintain my current php file I use to handle the ajax post request and do the SQL update from there by including the necessary DB connection files but i'm not finding much info on that. Any idea on how to enable database querys and execution from a php file included in the template directory? (what files do I need to include to have access to Db::getInstance();) This question was solved here! http://www.prestashop.com/forums/topic/205661-solved-accessing-dbgetinstance-from-new-file/ 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