Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    86
    Plugin Contributions
    0

    Default Need list of customers only in specific state

    Hey all,

    I need to pull the email addresses for customers in a few specific states as we have a promotion that we want to inform them about that is only available ina few states. This is not something I have to do often so I dont mind running a query in phpMyAdmin. I am not too familiar with SQL and did notice that the customers email address is in one table (zen_customers) while their email address is in (zen_address_book).

    Has anyone done this before and can anyone help me with the syntax or know if a way this can be done within the zencart admin? We do have the newsletter export mod so we can export all our customers but I do not belive there is a way to filter by states.

    I have been playing with it but cant get it to work. I had something like this but it keeps pulling every cusomer not just the ones in the states I want:

    SELECT `customers_email_address` FROM `zen_customers`, zen_address_book WHERE `entry_state` = "MA" or "NH" or "RI" or "ME" or "VT"

  2. #2
    Join Date
    Dec 2007
    Location
    New Jersey
    Posts
    76
    Plugin Contributions
    0

    Default Re: Send Email only to customer's in specific state?

    hi dcfxking.... try this. i got this to work on my db. you just have some quotes around things you don't need:

    SELECT `customers_email_address`
    FROM zen_customers, zen_address_book
    WHERE entry_state = "MA"
    OR "NH"
    OR "RI"
    OR "ME"
    OR "VT"
    LIMIT 0 , 30
    hmmn. really?

  3. #3
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    86
    Plugin Contributions
    0

    Default Re: Send Email only to customer's in specific state?

    Thanks Elastic,

    That query runs but it doesnt filter out only customers in those states, it actually lists the email address for every single customer still.

  4. #4
    Join Date
    Jan 2004
    Posts
    58,264
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: Send Email only to customer's in specific state?

    Zen Cart doesn't store a state name if the customer's address fits within a defined zone. Instead, it stores the zone number in entry_zone.
    You could do a join on the zones table to match up with the state codes you desire.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    86
    Plugin Contributions
    0

    Default Re: Send Email only to customer's in specific state?

    Quote Originally Posted by DrByte View Post
    Zen Cart doesn't store a state name if the customer's address fits within a defined zone. Instead, it stores the zone number in entry_zone.
    You could do a join on the zones table to match up with the state codes you desire.

    Thans that makes sense why nothing I was trying as working. Can you explain the ones a little more? Is there a zone # for each state? If I go into my customers section in admin and open up a customer it does have a state...where is this data stored?

    Can you give an example of how that query would look in order to grab customers mail addresses only if they are in a certain group of states?

 

 

Similar Threads

  1. No taxes for out of state customers
    By JayC in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 4
    Last Post: 15 May 2008, 11:26 PM
  2. Zone More Specific Than a US State
    By phrogger in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 15 May 2008, 05:37 PM
  3. State List
    By alja in forum General Questions
    Replies: 2
    Last Post: 3 Dec 2007, 10:18 PM
  4. Replies: 3
    Last Post: 18 Aug 2006, 09:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •