Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Display 'In Stock' message but not quantity?
Next Page
Author « Topic »
Page: of 2

RJB
Ecommerce Template Expert

United Kingdom
780 Posts

Posted - 10/26/2022 :  10:25:52  

I would like to display an 'In Stock' message on the proddetail.php pages for items which are in stock, without displaying the quantity in stock. Is this possible?

$showinstock=TRUE; appears to show the 'in stock' message on all proddetail pages regardless of whether the item is in stock and also it shows the quantity which I don't want.

Richard.

Vince
Administrator

42488 Posts

Posted - 10/28/2022 :  03:42:23  
Hi Richard
How about if you add this to your style.css style sheet...

div.detailinstock{
color:#FFF;
}
span.detailinstocklabel{
color:#333;
}

This will set the color of the actual stock level to the same as the background color but set the color of the label to something visible. Customers will be able to see the stock level if they do a "Select All" on the page for instance to select the stock level text, but I'm not sure if that is important.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

RJB
Ecommerce Template Expert

United Kingdom
780 Posts

Posted - 10/28/2022 :  04:09:24  
Hi Vince, Thanks for the suggestion although this isn't ideal as I think this would still show the 'In Stock' message if the stock level is zero, also I would prefer to turn off the stock level display completely or at least set to display: none; but this doesn't seem to be possible.

I realise this probably doesn't seem like an important feature, but after getting a lot of enquiries from customers recently asking to confirm if items are in stock, and noticing that my main competitors websites all have this feature I thought maybe it would be worth adding.

Richard.

John M
Advanced Member

457 Posts

Posted - 10/28/2022 :  05:25:00  
Most sites can set a threshold where it says "in stock", if the stock quantity is greater than the threshold
Otherwise it displays a message, for example:
"Only quantity in stock. Order now"

John

dbdave
ECT Moderator

USA
10290 Posts

Posted - 10/28/2022 :  08:22:11  
There is a parameter that might help

quote:
For items where you don't want to display to the public the stock you have or where the stock level is irrelevant, use the following

stockdisplaythreshold=1000 (asp)
$stockdisplaythreshold=1000; (php)

...where any stock above 1000 units won't show the In Stock message and quantity in stock to the public.


Personally, I use this along with some javascript to do what John M suggests.

David

Edited by - dbdave on 10/28/2022 08:23:15

Vince
Administrator

42488 Posts

Posted - 10/28/2022 :  10:08:29  
Hi Richard
quote:
I realise this probably doesn't seem like an important feature, but after getting a lot of enquiries from customers recently asking to confirm if items are in stock, and noticing that my main competitors websites all have this feature I thought maybe it would be worth adding.
Yes, I think this is worth adding and I'll sort something out asap.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

RJB
Ecommerce Template Expert

United Kingdom
780 Posts

Posted - 10/28/2022 :  12:04:00  
That would be great, thank you.

Richard.

Vince
Administrator

42488 Posts

Posted - 10/30/2022 :  09:19:56  
Hi Richard
Ok, I've made some changes to the v7.5 updater for this, so after updating if in the $productpagelayout or $detailpagelayout parameters you use "instockmsg" instead of "instock" then you will get the $xxInStoc text displayed if the stock is greater than zero. You can also add a "%s" to $xxInStoc that will be replaced by the stock level if required. So for instance you could put...
$xxInStoc='In Stock!! Only %s left!!';

Does that sound ok? Please let me know now if you think there is anything else we can add to this.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

midvalleydrifter001
Ecommerce Template Expert

USA
914 Posts

Posted - 10/30/2022 :  10:41:50  
Hi Vince,

I just applied this but am getting

UNKNOWN LAYOUT

OPTION:instockmsg

Vince
Administrator

42488 Posts

Posted - 10/30/2022 :  11:06:35  
Hi midvalleydrifter001
That would kind of indicate that the modified files didn't make it to your server. Could you double check you copied everything?

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

midvalleydrifter001
Ecommerce Template Expert

USA
914 Posts

Posted - 10/30/2022 :  11:28:44  
Thanks for pointing that out. Yes.. I left out one line.

So this works great when you don't have any options.

https://www (DOT) slixprings.com/proddetail.php?prod=Slix-TTN-Top-Lever-Spring

But what about pages that use Options?

https://www (DOT) slixprings.com/proddetail.php?prod=SliX-Bead-Shotgun-Sights

Edited by - midvalleydrifter001 on 10/30/2022 11:33:54

RJB
Ecommerce Template Expert

United Kingdom
780 Posts

Posted - 10/30/2022 :  16:47:16  
Hi Vince,

Thank you for the update ..I have installed this and the 'in stock' message is mostly working as intended.

Like midvalleydrifter001 I have some products where the stock levels are set by options and the message does not appear regardless of stock availability which is a shame although I imagine this would be more difficult to implement. I wondered if it would be possible to show the 'in stock' message on the proddetail pages where stock is available for one or more of the options? I think this would be better. I noticed that the add to cart / notify when back in stock button appears to change according to stock availability in this way.

Richard.

Edited by - RJB on 10/30/2022 16:48:47

Vince
Administrator

42488 Posts

Posted - 11/01/2022 :  12:32:52  
Hi Richard
quote:
I wondered if it would be possible to show the 'in stock' message on the proddetail pages where stock is available for one or more of the options?
Sure thing and this is done now.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

RJB
Ecommerce Template Expert

United Kingdom
780 Posts

Posted - 11/01/2022 :  12:57:22  
Thanks ..which files do I need to update?

Richard.

Vince
Administrator

42488 Posts

Posted - 11/01/2022 :  14:56:44  

midvalleydrifter001
Ecommerce Template Expert

USA
914 Posts

Posted - 11/01/2022 :  15:39:02  
Hey Vince,

Thanks for working on this. It works great except for one thing.

When using it like this all is good. $xxInStoc='In Stock !!';

When using it with Product Options to also show Quantity it displays a random Quantity. $xxInStoc='In Stock !! Qty %s';

On products without options the Quantity is correct.

Patrick

midvalleydrifter001
Ecommerce Template Expert

USA
914 Posts

Posted - 11/01/2022 :  15:57:30  
... actually looking at this further it is not working.

On the pages that have options with NO inventory it is showing "In Stock"

RJB
Ecommerce Template Expert

United Kingdom
780 Posts

Posted - 11/01/2022 :  15:59:30  
Hi Vince,

The 'In Stock' message is working perfectly now ..Many thanks for this!

Richard.

midvalleydrifter001
Ecommerce Template Expert

USA
914 Posts

Posted - 11/01/2022 :  16:31:45  
Now I'm really confused...

It works fine on one website but not the other....

I'm looking into what is different.

You still can't use this feature with Options though: $xxInStoc='In Stock !! Qty %s';

It gives some random Quantity.

Patrick

Edited by - midvalleydrifter001 on 11/01/2022 16:59:13

midvalleydrifter001
Ecommerce Template Expert

USA
914 Posts

Posted - 11/01/2022 :  17:38:31  
So I've narrowed it done some...

On one of my websites if ALL options are at "0" Quantity the "Notify when in Stock" button is visible.

On the site in question if ALL options are at "0" Quantity it still shows the "Add to Cart" button... BUT if you try to select an Option... THEN the "Notify when in Stock" button appears.

I thinks that is why this is not working on the one site.

Not sure where to go from here.

Patrick

Vince
Administrator

42488 Posts

Posted - 11/02/2022 :  06:34:49  
Page: of 2 « Topic »  
Next Page
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000