wallchopz Posted July 29, 2015 Share Posted July 29, 2015 (edited) I have a radio group added on step #4 of the checkout page (order-carrier.tpl). I need the selected radio to be inserted into the database. Radio items has name=variable and id=variable. Here's what I did, so far: 1. Create new column in ps_orders. Data type is text. 2. Override order.php: Add public $variable; Add to the array :: 'variable' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 3. Override paymentmodule.php: Add inside foreach ($packageByAddress as $id_package => $package) function :: $order->variable = Tools::getValue('variable'); On the order confirmation page, $order->variable is NULL. Therefore, it can't be saved to the database. What am I missing? Edited July 30, 2015 by wallchopz (see edit history) Link to comment Share on other sites More sharing options...
wallchopz Posted July 30, 2015 Author Share Posted July 30, 2015 Any solution for this? Link to comment Share on other sites More sharing options...
wallchopz Posted July 30, 2015 Author Share Posted July 30, 2015 Anyone? Link to comment Share on other sites More sharing options...
wallchopz Posted August 3, 2015 Author Share Posted August 3, 2015 UP! Still no solution? PrestaShop moderators? Link to comment Share on other sites More sharing options...
coroner Posted August 19, 2015 Share Posted August 19, 2015 I'm new to PrestaShop, but not to SQL tables. An SQL table containing null values is usually not possible, so you must set a non-null value such as '0' to represent null as a default. That way you have data no matter what. It's a shot in the dark here, but it may solve the null value problem for you. You will then have to ensure you have not used '0' to represent something else. Hope it helps, Mark Link to comment Share on other sites More sharing options...
NishantVadgama Posted August 20, 2015 Share Posted August 20, 2015 I have a radio group added on step #4 of the checkout page (order-carrier.tpl). I need the selected radio to be inserted into the database. Radio items has name=variable and id=variable. Here's what I did, so far: 1. Create new column in ps_orders. Data type is text. 2. Override order.php: Add public $variable; Add to the array :: 'variable' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 3. Override paymentmodule.php: Add inside foreach ($packageByAddress as $id_package => $package) function :: $order->variable = Tools::getValue('variable'); On the order confirmation page, $order->variable is NULL. Therefore, it can't be saved to the database. What am I missing? for this I think following link helps you. https://www.prestashop.com/forums/topic/463223-variable-smarty-in-controller-to-a-tpl/ 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