Vania Elizondo Posted July 22, 2020 Share Posted July 22, 2020 (edited) I need to get the address typed in checkout. I need it for the checkout-delivery-step, so I'm using displayBeforeCarrier but this hook is ran before the user inputs the data. Anyone knows how to do this? Thanks Edited July 23, 2020 by Vania Elizondo (see edit history) Link to comment Share on other sites More sharing options...
Vania Elizondo Posted July 23, 2020 Author Share Posted July 23, 2020 In case anyone wants to know, I could make a query to the db based on the parameters passed to the displayBeforeCarrier hook. The hook is called throughout the checkout process, so I could get the id_address_delivery from the parameters and look for all the info in the database. So the code is kind of like the following public function hookDisplayBeforeCarrier($params) { $queryDestination = Db::getInstance()->getRow('SELECT a.`company`, a.`firstname`, a.`lastname`, a.`address1` address, a.`postcode`, a.`city`, a.`phone`, st.`iso_code` state, c.`iso_code` country FROM `'._DB_PREFIX_.'address` a LEFT JOIN `'._DB_PREFIX_.'country` c ON (c.`id_country` = a.`id_country`) LEFT JOIN `'._DB_PREFIX_.'state` st ON (st.`id_state` = a.`id_state`) WHERE a.`id_address` = '.(int)$params['cart']->id_address_delivery); } Happy coding :) 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