Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    84
    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
    84
    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
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    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!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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
    84
    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. Sales tax is being calculated into product price. Just need it for a specific state
    By Inudat1966 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 8
    Last Post: 30 Aug 2010, 03:05 PM
  2. Ship only to specific list of airports?
    By ravenseye in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 24 Jun 2008, 01:19 AM
  3. Allowing access to products to specific customers only?
    By marksu in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Feb 2008, 12:04 AM
  4. Category visible only by specific groups of customers
    By sanji in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 20 Sep 2006, 02:58 AM
  5. 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR