Jump to content

Clientes que usan descuentos


Surkana

Recommended Posts

Hola a tod@s. Necesito saber que clientes han usado descuentos específicos.

Por ejemplo ahora en el Black Friday, no todas las compras han usado código de descuento y quería saber los que sí han usado el código.

Como puedo generar ese listado???

Mil gracias!

Link to comment
Share on other sites

Utilice la consulta a continuación para obtener los detalles del cliente que ha utilizado el cupón de descuento.

Consulta :

SELECT o.`id_order` AS `id`,
    CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) AS `Customer`,
    CONCAT(LEFT(ad.`firstname`, 1), '. ', ad.`lastname`) AS `Del_Name`,   
c.`email` AS `email`,
    o.`payment`,
    o.`date_add` AS `Date`,
    o.`total_discounts` AS `Discount`
FROM `ps_orders` o
LEFT JOIN `ps_customer` c ON (o.`id_customer` = c.`id_customer`)
LEFT JOIN ps_address ad ON (o.id_address_delivery = ad.id_address)
LEFT JOIN `ps_order_cart_rule` cr ON (o.`id_order` = cr.`id_order`)
LEFT JOIN `ps_currency` cu ON (o.`id_currency` = cu.`id_currency`)
where cr.name='COUPON_NAME';

Utilice amablemente el nombre del cupón, en lugar del cupón.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...