Post by livemedia » Thu Jul 16, 2020 12:25 am

Hello,
can you help me by displaying a repeat number of a user with the same name and phone number?

Example: if user Ivan Ivanov with number +359998877, has three requests in the system, then next to his name in the list:
Ivan Ivanov (3)
Repetition counter in the database for the same name and phone number ...

Newbie

Posts

Joined
Tue Jul 14, 2020 10:49 pm

Post by sandraolt » Wed Aug 12, 2020 4:30 am

You could do this with a mysql query in your database (assuming you are using mysql) Once you have designed the query and have it reporting what you want, you could in theory add it to your dashboard, but that is a bit more complicated...

A basic query that would give you contact info for people who have ordered multiple times is

Code: Select all

SELECT firstname, lastname, telephone, COUNT( telephone ) AS x 
FROM `oc_order` 
WHERE order_status_id >5 
Group by telephone 
HAVING x  >  1 
ORDER BY `x` DESC 

New member

Posts

Joined
Thu Aug 01, 2013 2:51 am

Post by livemedia » Wed Aug 12, 2020 1:48 pm

Can I have some more information?
To which file should this code be added?

Newbie

Posts

Joined
Tue Jul 14, 2020 10:49 pm

Post by sandraolt » Fri Aug 14, 2020 11:55 pm

Typically I would create this as a separate password protected file and put a link to it in my opencart dashboard (rather than change a page in opencart that I the have to change again each time I upgrade). Read https://www.w3schools.com/php/php_mysql_select.asp to see how to create a connection to your database and select the data to show it on your page. The query I created could be used instead of their basic select query.

Sandra

New member

Posts

Joined
Thu Aug 01, 2013 2:51 am
Who is online

Users browsing this forum: No registered users and 3 guests