Hi. I see here: http://forum.virtuemart.net/index.php?topic=113527.msg381835
But dont work for me. I have joomla 2.5.8 and VM 2.0.14
And use flexibledesign cleanmart template.
in the my-tempalte/html/com_virtuemart/productdetails/default.php have this code about add-to-cart
<?php
if ($params->get('productdetails_ajax',1) and !empty($this->product->customfieldsCart)) {
foreach ($this->product->customfieldsCart as $field) {
if ($field->field_type == "A") {
$doc = JFactory::getDocument();
$doc->addScriptDeclaration('
jQuery(document).ready(function(){
jQuery.fn.FlexibleChildAjax();
});
');
}
}
}
// Add To Cart Button
echo $this->loadTemplate('addtocart');
?>
how i can change this code to hide add-to-cart, if my product will be on stock "-1"? All product have in stock "0" and no mor action in config. In any new product i need have product page with prize, but withou ad-to-cart for any time to grand open and start selling it :)
PS: Sry for my bad english
Those versions are very old and insecure, so I doubt if anyone here will be using them or that particular commercial template. http://forum.virtuemart.net/index.php?topic=118683.0
Instead of changing existing overrides I would use "Displays 'Notify Me' instead of 'Add To Cart' button" for Action when a Product is Out of Stock and hide the 'Notify Me' using css
thx. but all m yproduct have stock 0 :(
Add stock to all products except those where you don't want add to cart?
Hi,
if you want hide button for negative stock
if($this->product->product_in_stock > -1) {
echo $this->loadTemplate('addtocart');
}
Quote from: Studio 42 on December 01, 2016, 11:03:23 AM
Hi,
if you want hide button for negative stock
if($this->product->product_in_stock > -1) {
echo $this->loadTemplate('addtocart');
}
thx. i will try it :)