miftikhan76 Posted March 31, 2014 Share Posted March 31, 2014 I added my module with a hook hookActionCarrierProcess. The value is not getting saved to the database. Here are the steps I followed: Added column in table ps_orders Added input control to order-carrier.tpl Added hook hookActionCarrierProcess to my module Set $cart->UserCarrierAccount = Tools::getValue('UserCarrierAccount'); in the hook Can anyone have some thoughts why UserCarrierAccount value is not being saved to ps_orders table? Link to comment Share on other sites More sharing options...
miftikhan76 Posted April 4, 2014 Author Share Posted April 4, 2014 I figured out the solution, see as follows: 1. Add same fields to both ps_orders and ps_cart 2. There is no need to add fields to order-carrier.tpl. You may use DisplayCarrierList hook. 3. Add Hook hookActionCarrierProcess and set $cart->UserCarrierAccount = Tools::getValue('UserCarrierAccount'); 4. Set values to order object from cart object in validateOrder in PaymentModule class after line number 260. Although the 4th action should be done using overriding the class PaymentModule as a best practice. But I changed the core just to save time in implementation. Can anyone comment on this? Link to comment Share on other sites More sharing options...
wallchopz Posted August 3, 2015 Share Posted August 3, 2015 Hi miftikhan76, I am not creating a module. I am adding fields to order-carrier.tpl. What file do I have to set $cart->UserCarrierAccount = Tools::getValue('UserCarrierAccount'); ? And how do I set values to order object from cart object? I know where the PaymentModule is, and have seen line number 260. Thanks. 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