burt wrote: ↑Tue Jun 24, 2025 8:52 am
14Steve14 wrote: ↑Sun Jun 22, 2025 10:51 am
I now have a working hook that allows a page to show any products which are back in stock, so items from zero back to something, which should delete automatically after 14 days. Lets hope that bit works. Then may be worth trying to get any updated products with a stock increase to show. Something to play with later and if it works may be worth installing on my live site.
I like this idea. Make a copy of (eg) products_new.php and make the SQL (that finds what products to show) to do this;
show products
with stock > 0 [as newly updated products might sell quickly within the 14 day period]
AND
restock date within the last 14 days
For a shop that does NOT regularly add *new* products, but instead *restocks* products a lot, this page would be farrrrr more useful than products_new.php for customers.
Hi Gary
@burt .
I copied the featured products main page and language file and had AI make the changes for a back in stock column in the database. It was then a case of getting the hook right to do as you say. Any out of stock product with a quantity of zero, when updated shows in this new page. We can adjust the date range that products show for. Once a product hits the date for removal it just does not show on the page, but the date remains in the database column. It could be made to clear apparently but we have not looked into this yet.
We are also thinking of adjusting the hook so any stock that is increased on any product will show in the page as we have low stock o lots of products that we update before they totally run out.
The only other thing we did was to create a new module based on one of the other ones so a link shows in the navbar on the site pages, which was just an easy copy, adjust and update type of thing. So easy that even I could do it.
The whole point of this page was originally to replace a load of product listings in our weekly newsletter. We have found out that a single button is pressed more times that individual buttons to specific products, hence the need for a single page showing all restocked products.
I tried doing this using AI as more of a trial thing and it did eventually get most of it right, but there was a need for help here in this forum as the last little but it just could not get right. More part of me not knowing what was the right way to do something.
As the idea evolved there are thoughts of adding a module to show on the index pages, again similar to the featured products which show on different category pages, but that is only an idea at the moment and may make something simple quite hard and overly coplicated
I am sure that you could improve the idea 10 fold.