VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: lukelee on December 10, 2012, 06:25:41 AM

Title: Disable add to cart button for certain manufacturer?
Post by: lukelee on December 10, 2012, 06:25:41 AM
How can I disable add to cart button for certain manufacturer? Thanks

I changed some code, but seems not working. someone said I can add custom field for those products, and make the add to cart disable, but not sure how to do it. anyone help? thanks.

This is the code I use, but seems not working:
if($product->virtuemart_manufacturer_id=='10'){
            echo ' ';
            }
            else {
         ?>
         <span class="addtocart-button">
            <input type="submit" name="addtocart"  class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
         </span>
            <?php } ?>
Title: Re: Disable add to cart button for certain manufacturer?
Post by: lukelee on December 10, 2012, 07:18:58 AM
Never Mind, I think I made it. On category page, if you want to remove add to cart button for certain manufacturer: use the code:

if($product->virtuemart_manufacturer_id =='10') {  <--replace your manufacture id
echo '';
}
else { ......}


On product detail page:


<?php if($this->product->virtuemart_manufacturer_id =='10') {
echo '';
}
else{ ....}