News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

remove the add to cart button only if the category i'm browsing is child of virtuemart_category_id 4

Started by sorema, April 26, 2017, 22:38:28 PM

Previous topic - Next topic

sorema

i'm building an override for category view in my VM3 and want to remove the add to cart button only if the category i'm browsing is child of virtuemart_category_id 46
how can i do this?
i'm trying with no success
<?php if($product->category_parent_id!=46 ) :?>
            <div class="product-add-btn" title="Add to Cart">
                        <?php  echo shopFunctionsF::renderVmSubLayout('addtocart_grid',array('product'=>$product,'rowHeights'=>$rowsHeight[$row])); ?>
                     </div>
            <?php endif; ?>

thank you in advance!


sorema

not in category view! i can achieve this and it works:

<?php if(($product->virtuemart_category_id!=51) && ($product->virtuemart_category_id!=52)&& ($product->virtuemart_category_id!=53) && ($product->virtuemart_category_id!=54)&& ($product->virtuemart_category_id!=55)&& ($product->virtuemart_category_id!=56)) :?>
<div class="product-add-btn" title="Add to Cart">
<?php  echo shopFunctionsF::renderVmSubLayout('addtocart_grid',array('product'=>$product,'rowHeights'=>$rowsHeight[$row])); ?>
</div>
<?php endif; ?>

but i'm looking for a way to simplify all things! all those categories are child of virtuemart_category_id=46 so there must be a way to code that "all the categories, belonging to..."