Error in listing customers who did not make Opencart purchases

Asked

Viewed 28 times

0

I have a problem I can’t solve in any way. I am trying to list only customers who have never made purchases, ie by checking in the order table if there is no purchase associated with the customer id, I am using the query:

SELECT * FROM `" . DB_PREFIX . "customer` AS c INNER JOIN `" .
DB_PREFIX . "order` AS o ON (c.customer_id = o.customer_id) INNER JOIN
`" . DB_PREFIX . "address` AS a ON (c.address_id = a.address_id) WHERE
o.customer_id is null"

So is my model: https://pastebin.com/ecA0HY4z

The controller: https://pastebin.com/YwEpULC3

And the view: https://pastebin.com/FGS4Dcj4

When I remove Where to test only the listing, these errors appear: https://pastebin.com/yWJ8zhTC

But it does not return the values, I believe I used Where wrong in this query. How can I solve?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.