VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: bobdxb on October 30, 2024, 12:30:52 PM

Title: How to remove ADD TO CART from category page
Post by: bobdxb on October 30, 2024, 12:30:52 PM
Hi,
I have tried some suggestions here in forum, but none worked for me. I want to remove ADD TO CART button from Category page since many products have color options before proceeding to cart.

Link to one of the categories
https://store.milmartrading.com/shop/mobile-phones-tablets

Tks for help
Title: Re: How to remove ADD TO CART from category page
Post by: iWim on October 31, 2024, 11:04:58 AM
You can create an override of ~/components/com_virtuemart/sublayouts/(bs*-)product.php and see if you can remove/hide the addtocart stuff.

For me the code looked too complicated. (Still does.)
I decided  (a long time ago) it was much easier to "just" use css.
.product .addtocart-area { display: none; }
Title: Re: How to remove ADD TO CART from category page
Post by: AH on November 22, 2024, 14:35:53 PM
Create an override to the file:
components\com_virtuemart\sublayouts\products.php

Comment out this section as shown below:

<!-- <div class="vm3pr---><?php //echo $rowsHeight[$row]['customfields'] ?><!--"> --><?php
// echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>

<!-- </div>-->