Show "Out of stock" message on product listing pages
-
- VIP Member
- Posts: 578
- Joined: Fri Oct 25, 2019 7:01 pm
- Has thanked: 9 times
- Been thanked: 49 times
Show "Out of stock" message on product listing pages
Does anyone know of a way of adding an "Out of Stock" message/banner across an out of stock product on the product listing pages, not the actual product page.
I saw this on another non Phoenix site and thought it may be good to show a product that is out of stock, just so customers can see that the item should be stocked. Currently on my site the image can be shown when at zero stock but its not until the customers actually clicks on the product that they see it is out of stock.
Please see image for better explanation
I saw this on another non Phoenix site and thought it may be good to show a product that is out of stock, just so customers can see that the item should be stocked. Currently on my site the image can be shown when at zero stock but its not until the customers actually clicks on the product that they see it is out of stock.
Please see image for better explanation
You do not have the required permissions to view the files attached to this post.
-
- PhoenixCart Developer
- Posts: 1212
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Has thanked: 38 times
- Been thanked: 103 times
Re: Show "Out of stock" message on product listing pages
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
- VIP Member
- Posts: 578
- Joined: Fri Oct 25, 2019 7:01 pm
- Has thanked: 9 times
- Been thanked: 49 times
Re: Show "Out of stock" message on product listing pages
Thanks for that. It may work, and may also replace other older code that I have already installed on the product info page that Gary wrote ages ago.
-
- VIP Member
- Posts: 309
- Joined: Mon Oct 26, 2020 5:26 pm
- Has thanked: 42 times
- Been thanked: 9 times
Re: Show "Out of stock" message on product listing pages
@14Steve14 here's how it look on one of my Phoenix sites. I thought it was better because it was nonintrusive.
You do not have the required permissions to view the files attached to this post.
Re: Show "Out of stock" message on product listing pages
I buy online from the wholesale arm of Heineken.
They put a thin red border around the item box (card) and disable the add to basket + / - options too.
It works well with all other info options about the product still available.
They put a thin red border around the item box (card) and disable the add to basket + / - options too.
It works well with all other info options about the product still available.
-
- Lead Developer
- Posts: 2439
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 51 times
- Been thanked: 138 times
Re: Show "Out of stock" message on product listing pages
Somewhat similar would be the Supporters Code "s01e10 - Sale Sticker".
What that one does is put up a little "sticker" on product listings when the product is on a special offer.
You could rework that to look for quantity at hand and place a "sticker" or banner ...
Not super straightforward, but definitely doable.
What that one does is put up a little "sticker" on product listings when the product is on a special offer.
You could rework that to look for quantity at hand and place a "sticker" or banner ...
Not super straightforward, but definitely doable.
Gamechanger Addon: Queued Emails, try before you buy.
-
- VIP Member
- Posts: 578
- Joined: Fri Oct 25, 2019 7:01 pm
- Has thanked: 9 times
- Been thanked: 49 times
Re: Show "Out of stock" message on product listing pages
Welcome back @burt Gary. Glad to see you here again, even if not full time.burt wrote: ↑Thu Jul 08, 2021 1:20 pm Somewhat similar would be the Supporters Code "s01e10 - Sale Sticker".
What that one does is put up a little "sticker" on product listings when the product is on a special offer.
You could rework that to look for quantity at hand and place a "sticker" or banner ...
Not super straightforward, but definitely doable.
I did look at that and see that it is basically controlled by a few lines of code about the specials, but being a code idiot I have no idea where to start on how to select the out of stock items.
I may have to buy the mod recommended by Rainer and see if that can be changed. Cheap enough if its not what I want completely, but may do some of it.
-
- VIP Member
- Posts: 578
- Joined: Fri Oct 25, 2019 7:01 pm
- Has thanked: 9 times
- Been thanked: 49 times
Re: Show "Out of stock" message on product listing pages
14Steve14 wrote: ↑Fri Jul 09, 2021 11:46 amWelcome back @burt Gary. Glad to see you here again, even if not full time. I hope everything is as good as it can be.burt wrote: ↑Thu Jul 08, 2021 1:20 pm Somewhat similar would be the Supporters Code "s01e10 - Sale Sticker".
What that one does is put up a little "sticker" on product listings when the product is on a special offer.
You could rework that to look for quantity at hand and place a "sticker" or banner ...
Not super straightforward, but definitely doable.
I did look at that and see that it is basically controlled by a few lines of code about the specials, but being a code idiot I have no idea where to start on how to select the out of stock items.
I may have to buy the mod recommended by Rainer and see if that can be changed. Cheap enough if its not what I want completely, but may do some of it.
-
- Lead Developer
- Posts: 2439
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 51 times
- Been thanked: 138 times
Re: Show "Out of stock" message on product listing pages
It would be something like (changing L26 in the file), to (note, untested!):
This is targetting every "buy" button, looking at it's quantity and determining if quantity is fewer than 1, if yes, show the sticker. Obviously change the sticker appropriately in the language file.
Rainers solution likely does more, so it would be worth checking that out as the "sticker" solution is just cosmetic and requires user to have javascript turned on...
Code: Select all
<script>$('.btn-buy').each(function() { var quantity = $(this).data('in-stock'); if (quantity < 1) {
Rainers solution likely does more, so it would be worth checking that out as the "sticker" solution is just cosmetic and requires user to have javascript turned on...
Gamechanger Addon: Queued Emails, try before you buy.
Re: Show "Out of stock" message on product listing pages
//Show add to cart button
} else {
//Show sold out button
}
But I like the look of that @lecarlb sold out button. I wonder how he did that button.
You do not have the required permissions to view the files attached to this post.