Post by eNgage » Tue Aug 07, 2012 4:43 am

Hello,

I've some problems with my site..
I'm running this site in Norway, and have made a lot of code change with country/tax zones..

My problem is that:

When new users register > in their profile default values are: Country: none - Region / State: none
Then taxes don't shop up correct, but if I manually edit their account to Norway/None its all correct.

How to fix this default values when they register?
I found this sql string in customer.php:

$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "'");

- Thanks in advance guys!

Newbie

Posts

Joined
Wed Oct 08, 2008 1:12 am

Post by Avvici » Wed Aug 08, 2012 4:33 am

For example you could edit the last name in that query like this:

Code: Select all

 lastname = 'RickenBocker' ,
You don't need to use the ESCAPE function for a string you know is going in there manually. You can do that to any field you wish.

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '', firstname = '', lastname = '', company = '', '', address_2 ='', city = '', postcode = '', country_id = '', zone_id = ''");

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC
Who is online

Users browsing this forum: No registered users and 23 guests