Search the Community
Showing results for tags 'order input checkout'.
-
Hi ! So what I want to do seems quite simple : allowing the customers to choose a precise hour of delivery for their order (to be displayed in the back-office). I did some research and this is what I did so far : - Added "myVariable" to ps_cart table. - Added public $myVariable in Cart.php - Added 'myVariable' => array('type' => self::TYPE_DATE) in $definition in Cart.php - Created a module : <?php if (!defined('_PS_VERSION_')) exit; class heureLivraison extends Module { public function __construct() { $this->name = 'heurelivraison'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'COLIN Théotime'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.6'); $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Heure livraison'); $this->description = $this->l('Permet aux clients de choisir une heure de livraison précise.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('HEURELIVRAISON_NAME')) $this->warning = $this->l('No name provided'); } public function install() { if (!parent::install()) return false; return true; } public function uninstall() { if (!parent::uninstall()) return false; return true; } public function hookActionCarrierProcess($params) { $cart = $params['cart']; $cart->myVariable = Tools::getValue('myVariable'); } } - Installed it and hooked it to ActionCarrierProcess. - Added an input on the check out page. Though, the variable isn't added to the table. I think my module isn't working as even with a fixed date, nothing is added. Thanks for help ! May give away a little reward (Amazon gift card or anything else) if anyone can help me figure this out.