News:

Support the VirtueMart project and become a member

Main Menu

Disable add to cart button for certain manufacturer?

Started by lukelee, December 10, 2012, 06:25:41 AM

Previous topic - Next topic

lukelee

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 } ?>

lukelee

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{ ....}