silversurfer5150 Posted March 3, 2011 Share Posted March 3, 2011 Hey there,I am a programmer whom is new to prestashop, I am a decent enough SQL, JQUERY and PHP developer and I wish to use the core functionality of prestashop but to make some integral additions to the way in which orders are stored and presented by the cms system. I have recently learnt smarty and am just getting used to the Prestashop API structure.I have some products which each need a specific price plan to be taken from a mySQL table of data & prices.1. I want to add a field in the order details table for the price plan which would initially be empty. 2. I want to create a new and separate table of data & prices into which I would input the data manually, the csv option is not necessary as this is only a small amount of data.3. I want to give the user the option to select which price plan at checkout and insert this into the order detail database.4. I then want this selected price plan data to be sent with the order confirmation.If you have experience of manipulationg this API in this manner, please could you let me know how to go about it or indeed direct me to a more detailed API documantation for this sort of thing.kind regardsSilversurfer5150 Link to comment Share on other sites More sharing options...
Burhan BVK Posted March 3, 2011 Share Posted March 3, 2011 I think it would be easier for you to modify the customization feature. You can already let the customer enter some custom text to a product before checkout, and it will display nicely in the order details.You just need to modify the tpl to change it to a list instead of text field. Link to comment Share on other sites More sharing options...
silversurfer5150 Posted March 3, 2011 Author Share Posted March 3, 2011 Hey thanks for that,I have found it but am having difficulty with the exact meaning of the relevant section of code, mainly due to my lack of experience with this API. Can anyone help?What I want to do now is change the text area into a set of radio button options and send that data to the relevant part of the API so that this new data is diplayed where the old customer message would have once been. if (Tools::isSubmit('message') AND !empty($_POST['message'])) { if (!Validate::isMessage($_POST['message'])) $errors[] = Tools::displayError('invalid message'); elseif ($oldMessage = Message::getMessageByCartId(intval($cart->id))) { $message = new Message(intval($oldMessage['id_message'])); $message->message = htmlentities($_POST['message'], ENT_COMPAT, 'UTF-8'); $message->update(); } else { $message = new Message(); $message->message = htmlentities($_POST['message'], ENT_COMPAT, 'UTF-8'); $message->id_cart = intval($cart->id); $message->id_customer = intval($cart->id_customer); $message->add(); } } } Link to comment Share on other sites More sharing options...
silversurfer5150 Posted March 3, 2011 Author Share Posted March 3, 2011 Sorry thats an exxageration, I understand which objects, methods this code references but what I want to know is in what part of the shop is this message data then retrieved and displayed? I need to use this page to check as I make changes, although I am not sure if I can reach this part of the logic as I am on localhost and cannot proceed to the payment gateway. 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