Jump to content

[SOLVED] Get address from checkout


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...