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
Forum Search
Google Site Search
Author « Topic »  

midweb
Starting Member

United Kingdom
14 Posts

Pre-sales questions only
(More Details...)

Posted - 04/18/2024 :  08:31:30  
Can you remove the buy button for a single product without it saying out of stock?

ITZAP
Ecommerce Template Guru

Australia
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 04/18/2024 :  19:21:07  
This may be an option for you to consider.

I have a Retail Client who advertise Products & Prices with "0 zero In Stock" because they are selling In Store as well as Online. Thus actual Stock levels are never certain. So in this case the "[green]Add to Cart[/green]" button is replaced with the advice "Enquire to confirm availability".

To achieve this, enter the following parameters into your[maroon] includes.asp[/maroon] configuration file and upload to server.

(1) Prevent snippet reporting availability http://schema.org/InStock AND http://schema.org/OutOfStock
[size=3][font=Courier New]setschemaavailability=FALSE[/font=Courier New][/size=3]

(2) Change Out Of Stock message
[size=3][font=Courier New]'xxOutStok'='Enquire to confirm availability'[/font=Courier New][/size=3]

(3) Change Ask a Question button text.
[size=3][font=Courier New]'xxAskQue'='Enquire'[/font=Courier New][/size=3]

(4) Note that you also need to define [url="https://www.ecommercetemplates.com/help/social-media.asp"][blue]Social Media Buttons and detailpagelayout >>[/blue][/url]

I presume that ASP code is correct.
View a [url="https://www.bairnsdalecamping.com.au/proddetail.php?prod=smoker"][blue]sample webpage here >>[/blue][/url]
Run that URL through the [url="https://search.google.com/test/rich-results"][blue]Google Rich Results Test Tool >>[/blue][/url]

Gary
[img]https://itzap.com.au/pics/logo/itzap-website-design-works-mini-logo.png[/img]

dbdave
ECT Moderator

USA
10593 Posts

Posted - 04/18/2024 :  19:47:03  
Hi, I think (Gary), that would impact all products, no?

Back many years ago, I published a tip here that may do what you want - https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=100929


I think this is what you want - an updated variation of my old code.
<%if escape_string(productid) = "Product-Id-Here" then
nobuyorcheckout=true
end if%>


That should be placed in your proddetail.asp page before the <!--#include file="vsadmin/inc/incproddetail.asp"--> line

Let me know if it doesn't work.
If Gary's solution is not global, maybe it's better.

Thanks,
David

dbdave
ECT Moderator

USA
10593 Posts

Posted - 04/18/2024 :  19:51:27  
Just to add, I force customers to the product detail page to add to cart.
I realize many stores to have the add to cart set on the products page. This would be more complicated if that's the case.
Thanks,
David

ITZAP
Ecommerce Template Guru

Australia
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 04/18/2024 :  20:10:50  
David, YES. My solution is a fairly simple GLOBAL config change that will impact all products that are "Out Of Stock". That rich snippet is optional.

Your solution would involve editing the [maroon]proddetail.asp[/maroon] page code on every occasion you had another ProductID to add.

Gary
[img]https://itzap.com.au/pics/logo/itzap-website-design-works-mini-logo.png[/img]

dbdave
ECT Moderator

USA
10593 Posts

Posted - 04/19/2024 :  07:39:51  
Thanks for the clarification Gary.

David

Phil
ECT Moderator

United Kingdom
7794 Posts

Posted - 04/20/2024 :  01:41:46  
Hi Wayne,
Try this
add a custom css entry to the product you wish to hide these elements

go to product admin > list products > from the quick entry drop down choose > custom css > add 'nobuyorstock' without the quotes

then add this to your css file

.nobuyorstock .addtocart, .nobuyorstock .detailtocart, .nobuyorstock .outofstock, .nobuyorstock .detailoutofstock {display:none;}



*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

dbdave
ECT Moderator

USA
10593 Posts

Posted - 04/20/2024 :  08:07:24  
Well there you go.
I was thinking there might be another way.
Kudos Phil, I like that one best.

David

midweb
Starting Member

United Kingdom
14 Posts

Pre-sales questions only
(More Details...)

Posted - 04/20/2024 :  08:21:36  
Thank you all so much for the advice. The solution is perfect!

LadyM
ECT Moderator

1741 Posts

Posted - 12/02/2025 :  08:07:16  
This works perfectly. Is there a way to remove the price also?

Phil
ECT Moderator

United Kingdom
7794 Posts

Posted - 12/02/2025 :  08:15:36  
Hi LadyM,
Just add two more additions to the css rule and force a page refresh

.nobuyorstock .addtocart, .nobuyorstock .detailtocart, .nobuyorstock .outofstock, .nobuyorstock .detailoutofstock, .nobuyorstock .prodprice, .nobuyorstock .detailprice{display:none;}



*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

Edited by - Phil on 12/02/2025 08:16:21

LadyM
ECT Moderator

1741 Posts

Posted - 12/02/2025 :  08:19:22  
Perfect. Thanks Phil

LadyM
ECT Moderator

1741 Posts

Posted - 12/08/2025 :  07:37:31  
Another challenge for me. I tried to figure out the formula but it's not working well. I now need to remove the Product ID and the Ask a question from those detail pages. Can you help?

Phil
ECT Moderator

United Kingdom
7794 Posts

Posted - 12/08/2025 :  07:51:47  
Hi LadyM
Take a look here - https://www.ecommercetemplates.com/help/css-layouts.asp#proddetailorder

In your vsadmin/includes.asp you should have the detailpagelayout parameter, just remove productid from that list

For the askaquestion look for this line in your vsadmin/includes.asp - socialmediabuttons="askaquestion,emailfriend, facebook,linkedin,twitter,google,pinterest,custom" and remove the askaquestion



*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

LadyM
ECT Moderator

1741 Posts

Posted - 12/08/2025 :  08:14:07  
I only need this in one category, rather than global though. Like the css above. I don't want it removed everywhere. It's a regular cart but there is a new category for teacher bios that doesn't need the regular stuff. The teachers will change annually so getting it set up right now is important.

Phil
ECT Moderator

United Kingdom
7794 Posts

Posted - 12/08/2025 :  08:24:34  
add this to the custom css for all the products in that one category - nodetailidask

add this to your css
.nodetailidask .detailid, .nodetailidask .smaskaquestion{display:none}





*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

LadyM
ECT Moderator

1741 Posts

Posted - 12/08/2025 :  08:26:15  
That's exactly what I needed Phil, thanks.
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.04 seconds. Snitz Forums 2000