Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8120901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:18:23+00:00 2026-06-06T05:18:23+00:00

We are trying to collect data on each person that used a certain coupon

  • 0

We are trying to collect data on each person that used a certain coupon code “NEWCUSTOMER”. We are trying to get the order details including their name, email address, and what they ordered.

Is the rule_id connected to an order in any way in the database? The magento databases don’t seem to be all that friendly when you are trying to write your own mySQL statement to figure this information out.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:18:25+00:00Added an answer on June 6, 2026 at 5:18 am

    This is similar to your previous question which i have also answered for you: Find the name and email address of non-members who used coupon code in Magento

    The coupon code used on an order is actually a property of the order: coupon_code

    It sounds from your question that you are directly querying the db, if so then you are looking for the coupon_code field in the sales_flat_order table.

    Here is the sql:

    SELECT `customer_firstname`, `customer_lastname`, `customer_email` FROM `sales_flat_order` WHERE  `coupon_code` = 'your_awesome_coupon_code' AND `customer_group_id` = 0
    

    Or, via magento…

     $orderCollection = Mage::getModel('sales/order')->getCollection()
            ->addAttributeToSelect('customer_firstname')
            ->addAttributeToSelect('customer_lastname')
            ->addAttributeToSelect('customer_email')
            ->addAttributeToSelect('customer_group_id')
            ->addAttributeToSelect('coupon_code')
            ->addAttributeToFilter('customer_group_id', Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)
            ->addAttributeToFilter('coupon_code', 'NEWCUSTOMER');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: Tag.find_all_by_company_id(4).each.collect{|tag| tag.name }.join(,) (Essentially I'm trying to build a
I am trying to create a script in Python that will collect data put
I am trying to collect some data from multiple subsets of a data set
With Node I am trying to collect user data from an LDAP server and
I'm trying to find and collect all the elements that meet these requirements: var
Suppose I am trying to collect data from sensors at a high rate, and
I'm trying to collect statistic data in one SQL query for the convenience of
I am trying to write some code that does AES decryption for an SSL
I've been trying to collect analytics for my website and realized that Google analytics
I am trying to find a way to collect data using sql aggregate functions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.