Page 1 of 1

Adding custom query

Posted: Sat Sep 07, 2013 7:56 am
by frankwho
I want to do three things:
1. add a query to check if a user has an address in my database
2. block the checkout process if there is not an address
3. add a notification to the top of all pages (logged in users) if there is no address

I want to do this because I have a Facebook Login plugin, and Facebook does offer addresses. So when someone signs up via Facebook, I do not get an address for them. Since everything is run from index.php, one correctly placed query can make this happen. Does anyone know where to place this? Also, what is the name of the logged in session?

Re: Adding custom query

Posted: Sat Sep 07, 2013 11:44 am
by rph
$this->customer->getAddressId()

Re: Adding custom query

Posted: Sun Sep 08, 2013 3:46 am
by frankwho
Thanks. Where would be a good place to put this? $this is not called in index.php and gives me fatal errors every time I try to add it in random spots.

Ive never used functions and objects in PHP so this is a little outside my range.

Re: Adding custom query

Posted: Sun Sep 08, 2013 4:11 am
by frankwho
I actually just realized that this is probably pointless anyways. Looking at the POST data history, it apparently is not sending an address with the order anyways...