Post by samdz » Sat Nov 17, 2012 5:23 am

Hello Guy,

I need sam help,

I have add a column to the coupon database, and I named customer_email.

I went when a customer use the coupon I get his email to the new column (that I named : customer_email).
Also I need tosee it on the history a coupon in a new column with customer email.

Please guy, help me;

Thank in advance,

Sam

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am

Post by straightlight » Sat Nov 17, 2012 12:58 pm

The customer email address is already stored into the order table which the coupon history table can already fetch based on the related order ID.

For instance, you could run the following query in PHPMyAdmin to see if the order has been completed before using the email address:

Code: Select all

SELECT o.`email`
FROM `oc_order` o
INNER JOIN `oc_coupon_history` ch ON (ch.`order_id` = o.`order_id`)
WHERE o.`order_status_id` = '5';
This should display all completed orders with your required email addresses. Take note that: oc_ as the table prefix may be different for you in your case depending on which table prefix name you chose to have from the OpenCart installation.

If you want to see the results by languages:

Code: Select all

SELECT o.`email`, o.`name` AS `language_name`
FROM `oc_order` o
INNER JOIN `oc_coupon_history` ch ON (ch.`order_id` = o.`order_id`)
INNER JOIN `oc_language` l ON (l.`language_id` = o.`language_id`)
WHERE o.`order_status_id` = '5'
AND o.`language_id` = '1';
Which the value '1' would be the English version from the default installation of OpenCart. You can even take out this line:

Code: Select all

AND o.`language_id` = '1';
if you want to see the results for all languages related to coupons.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by samdz » Sat Nov 17, 2012 4:23 pm

Hi,
thank's for your interet;

But I only went display in the coupon history in the Admin panel, by adding a colomn before date added column.
And if possible to add a column in the coupon_history database table for the customer email.

Also I can't make the detail in you reponse.

regards

Thank's
Sam

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am
Who is online

Users browsing this forum: Semrush [Bot] and 2 guests