Is there a simple way in which I can remove the 'Add to Cart' button for specific products? For example if a product was 'In store only'.
I've located the code which displays the button ..hot_furniturestore/html/com_virtuemart/productdetails/default.php
What next???
Use an override in joomla_root/templates/(your_template)/html/com_virtuemart/productdetails/
Set the override as Product Details Page for each required product or as Default Product Details Page if to be used for all products in a category.
References here:
http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system
http://www.ostraining.com/blog/joomla/overrides
http://forum.virtuemart.net/index.php?topic=90935.0
http://forum.virtuemart.net/index.php?topic=106459.0
And more.....
:)
Quote from: jenkinhill on March 01, 2013, 16:01:11 PM
Use an override in joomla_root/templates/(your_template)/html/com_virtuemart/productdetails/
Set the override as Product Details Page for each required product or as Default Product Details Page if to be used for all products in a category.
References here:
http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system
http://www.ostraining.com/blog/joomla/overrides
http://forum.virtuemart.net/index.php?topic=90935.0
http://forum.virtuemart.net/index.php?topic=106459.0
And more.....
Thanks for the pointers - I've solved the problem :)
There is already an override Products Details Page in the location you suggested. I located this code :
if (!VmConfig::get('use_as_catalog',0)) { ?>
and changed to
if (!VmConfig::get('use_as_catalog',0) && $this->product->product_in_stock<>'2001' ) { ?>
Setting the 'In Stock' level for a product to 2001 hides the 'Add to Cart' button for that item :)
Neat solution!
QuoteThere is already an override Products Details Page in the location you suggested. I located this code :
if (!VmConfig::get('use_as_catalog',0)) { ?>
and changed to
if (!VmConfig::get('use_as_catalog',0) && $this->product->product_in_stock<>'2001' ) { ?>
Setting the 'In Stock' level for a product to 2001 hides the 'Add to Cart' button for that item
This works great on the products page to make the "Add To Cart" button disappear I have tried this on the category default.php file to make the "Add To Cart" button disappear, but it doesn't seem to work?
Any ideas?
if (!VmConfig::get('use_as_catalog',0) && $product->product_in_stock<>'2001' ) { ?>
Maybe it's time to check those sticked thread in this forum section (Template overrides and Co)?
Quote
Thanks for the pointers - I've solved the problem :)
There is already an override Products Details Page in the location you suggested. I located this code :
if (!VmConfig::get('use_as_catalog',0)) { ?>
and changed to
if (!VmConfig::get('use_as_catalog',0) && $this->product->product_in_stock<>'2001' ) { ?>
Setting the 'In Stock' level for a product to 2001 hides the 'Add to Cart' button for that item :)
I used the above code for the product details page. It worked. I am trying to accomplish the same thing for the category page.
I've got the add to card button on showing for each product on the category page but I want it to only show under the same circumstances as above.
I'm not a php developer and really have no idea what i'm doing. Can someone help me out please.
Thank You,