Customers search orders or order history

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Customers search orders or order history

Post by 14Steve14 »

Does anyone know if there is anything that will allow a customer to search through their order history for a specific product or model number, without opening every order. I know Gary did an 'Already Purchased' hook but cant seem to find anything else suitable. Am I missing something.

We are doing away with all the side boxes on our next site so want the customers to be able to reorder products that they have previously purchased with having to search through every order they have placed.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Customers search orders or order history

Post by burt »

The other one that may fit your needs a bit or not, would be "s10e05 Quick Reorder" - I think this one allows the customer to reorder a whole order with one click. However, the customer does not know what is inside each order until they look.

I don't know of anything that would allow the customer to search through their orders for a model or product name. It should be fairly straightforwardish to make though, you'd have some sort of search which searches the orders_products table for the given search term - you'd need to join the orders table to ensure they are searching only their own orders.
I am not here to build for you.
I am here to build with you. Let's help each other.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Customers search orders or order history

Post by ecartz »

burt wrote: Tue Jul 04, 2023 12:40 pm you'd have some sort of search which searches the orders_products table for the given search term - you'd need to join the orders table to ensure they are searching only their own orders.
You might want to have it search the products tables joined against the two order tables. Then you'd get back all the current data, which you could pass to the product listing. Something like

Code: Select all

SELECT m.*, %s
 FROM
  products p
    INNER JOIN products_description pd ON p.products_id = pd.products_id
    INNER JOIN orders_products op ON p.products_id = op.products_id
    INNER JOIN orders o ON op.orders_id = o.orders_id
    LEFT JOIN specials s ON p.products_id = s.products_id
    LEFT JOIN manufacturers m ON p.manufacturers_id = m.manufacturers_id
    LEFT JOIN (SELECT products_id, COUNT(*) AS attribute_count FROM products_attributes GROUP BY products_id) a ON p.products_id = a.products_id
  WHERE p.products_status = 1 AND pd.language_id = %d AND o.customers_id = %d
Then you can just pass that query to sortable_product_columns.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Customers search orders or order history

Post by heatherbell »

14Steve14 wrote: Tue Jul 04, 2023 10:58 am order history for a specific product
We use this:
viewtopic.php?f=28&t=164
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Customers search orders or order history

Post by 14Steve14 »

heatherbell wrote: Tue Jul 04, 2023 3:57 pm
14Steve14 wrote: Tue Jul 04, 2023 10:58 am order history for a specific product
We use this:
viewtopic.php?f=28&t=164
@heatherbell Thanks for that I will take a look.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply