A question about stock levels / availability to the customer

Open to all! Ask other shopowners for help.
cerberus
100+
Posts: 134
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 26 times
Been thanked: 7 times

A question about stock levels / availability to the customer

Post by cerberus »

Hi all,

If I add a product in admin and I only have one, I enter "1" when setting the product up.

On the main page for the item that customers see it still shows the box where they can select how many they want, even though I have only entered one item in admin for the product it will still allow the customer to select more than one and add them to cart, then the customer only realises there is less than they wanted in stock when they view their cart and have to adjust the amount until they reach "1", then they will be ok.

So is their a way to either show on the product page how many are in stock ? (one in this case), "Only one in stock"

Or make the box where the customer selects the amount they want to reflect what is actually in stock ?

Or is the only way to remove the box where the customer can select how many ?

What would be ideal is a way to show on the product page how many are in stock

Is their a addon to do that, I cannot see one, or can the code on the product page be changed to reflect how many are in stock ?

I came accross this addon "Phoenix_Sitewide_Low_Stock_Message_V1.0", but it seems a bit over the top for what I want from reading the instructions.

Thank you,
Steve

Tags:



Join The Code Co-op to get access to your library in the Code Co-op Forum
Omar_one
500+
Posts: 715
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 107 times
Been thanked: 69 times

Re: A question about stock levels / availability to the customer

Post by Omar_one »

Duplicate the Quantity Input module and adjust it to fit your need. I had a similar feature some time ago.
Stock = 1: the box and the +/- buttons are hidden and “Only one in stock” message is shown. A hidden qty=1 field is still submitted, so Add to Cart keeps working.

cerberus
100+
Posts: 134
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 26 times
Been thanked: 7 times

Re: A question about stock levels / availability to the customer

Post by cerberus »

Hi omar_one

Sorry to say that is beyond my capabilities, I found the files for the qty input module, it seems to be just 3 files ?

And I have managed to clone a module before using the Phoenix cart instructions, so I should be able to clone this one.

However I have just looked at the code for the 3 files and I would not have a clue how or where to alter them to produce the desired effect.

Its just beyond me to alter the code.

Yet in the shops cart it has a amount selection box that if you alter it (add more items) it immediately tells you if there is enough stock or not, I am not too sure why the amount selection box on the product page does not work the same way.

14Steve14
500+
Posts: 963
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 19 times
Been thanked: 113 times

Re: A question about stock levels / availability to the customer

Post by 14Steve14 »

There used to be an addon around that showed stock availability but I cant find it at the minute. I am sure it was either an older 28 days of code thing, or a pro code addon so Gary may have a version which he may let you have for a small donation to the cause. It was a simple PI module called stock_rag or something like that.

Omar_one
500+
Posts: 715
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 107 times
Been thanked: 69 times

Re: A question about stock levels / availability to the customer

Post by Omar_one »

14Steve14 wrote: ↑Sun Nov 08, 2026 7:46 am There used to be an addon around that showed stock availability but I cant find it at the minute. I am sure it was either an older 28 days of code thing, or a pro code addon so Gary may have a version which he may let you have for a small donation to the cause. It was a simple PI module called stock_rag or something like that.
It's called stock_tag (Pro Addons)
app.php/addons/supporters_code/s03e04_pi_modules

User avatar
burt
Core Team
Posts: 4916
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 296 times
Been thanked: 493 times

Re: A question about stock levels / availability to the customer

Post by burt »

Soft deleted (ie, they still exist, just hidden) some important posts more or less unrelated to the original "help me" ask.

I will bring those posts back in a new thread, later on.

MyGamesShop
100+
Posts: 156
Joined: Wed Mar 10, 2021 3:02 am
Phoenix Version: v1.1.0.6
Has thanked: 11 times
Been thanked: 5 times

Re: A question about stock levels / availability to the customer

Post by MyGamesShop »

burt wrote: ↑Tue Nov 10, 2026 1:36 pm Soft deleted (ie, they still exist, just hidden) some important posts more or less unrelated to the original "help me" ask.

I will bring those posts back in a new thread, later on.

I think this one was the best : S01e08-1.0.8.4. (Live Stock Check) this is from the PRO-Addons. It needs an update to restrict the amount input up-to the amount on hand. (Image 1 form product page.)
Then add the Amazon style cart addon so they get a notification if they add too many from the cart. (Image 2 from cart page) Which could do with and update to show the amount on hand.
You do not have the required permissions to view the files attached to this post.
Last edited by MyGamesShop on Mon Nov 16, 2026 3:06 am, edited 9 times in total.

User avatar
burt
Core Team
Posts: 4916
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 296 times
Been thanked: 493 times

Re: A question about stock levels / availability to the customer

Post by burt »

So you're actually wondering about three things, which is usually not wise as readers get a little confused. I think your post boils down to;
What would be ideal is a way to show on the product page how many are in stock
So, assuming v1.1.0.7, which is what your Version says;

cerb---.png

You already have a almost ready module.
Your Admin > Modules > Layout > "Stock".

You *could* replicate that to more closely fit your needs.



Out of the box, that core Stock module simply says one of;

Out Of Stock
or
In Stock

and it does have `$on_hand`, which is the number you need.



Whereas, you want the actual number something like so, I think;

23 In Stock

Are the jigsaw pieces starting to look like a coherent picture?
You have all the jigsaw pieces you need to make a new module.

What you might then do is upload the module you made to the addons area, as that is a way to help other users of Phoenix.
Loads of other shopowners would thank you for making such an addon and sharing it for free, I have no doubt.

--

I get that you have stated "the code is currently beyond you" or words to that effect, but if you don't have a go...it always will be, and you will always be waiting for `someone else` to make the addon you need and hoping that they then share it. Every fail...is closer to a success, remember that every single person on this forum, started where you are now...

Jigsaw Pieces

1. /includes/modules/pi/product_info/pi_stock.php
2. /includes/modules/pi/product_info/templates/tpl_pi_stock.php
3. /includes/languages/english/modules/pi/product_info/pi_stock.php

THEN

4. https://phoenixcart.org/phoenixcartwiki ... ent_Module

THEN

5. sprintf and $on_hand (in new module)
6. %d (in new language file)
You do not have the required permissions to view the files attached to this post.



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