VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Roderic on December 16, 2014, 19:06:34 PM

Title: disable the add-to-cart field from category view
Post by: Roderic on December 16, 2014, 19:06:34 PM
I'm trying to disable the add-to-cart field from category view when there are custom field dropdowns in VM3. In VM1 I had it working like this.
Does anyone have an idea how to get this working?
Title: Re: disable the add-to-cart field from category view
Post by: AH on December 16, 2014, 20:43:39 PM
Vm1 did not show the add to cart in the category view if there were customfields

The great thing about vm3 is that it allows customfields to be displayed and selected

If you want to disable these you will need to do a sublayout override
Title: Re: disable the add-to-cart field from category view
Post by: Roderic on December 16, 2014, 23:31:07 PM
Quote from: Hutson on December 16, 2014, 20:43:39 PM
Vm1 did not show the add to cart in the category view if there were customfields

The great thing about vm3 is that it allows customfields to be displayed and selected

If you want to disable these you will need to do a sublayout override

And that's exactly what I've been trying to achieve but I didn't get it to work after a few hours of trying...
So I was now hoping for someone to come up with the proper code or a tip/hint. This is what I have been trying in sublayouts/products.php:

<?php //echo $rowsHeight[$row]['price']

    
 
?>

<div  class="vm3pr-<?php echo $rowsHeight[$row]['price'?>" style="display:table-cell; min-width:110px; padding-right:15px"> <?php
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$product,'currency'=>$currency)); ?>

</div>
<?php //echo $rowsHeight[$row]['customs'] ?>
<div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'?>" style="display:table-cell; min-width:110px; padding-right:15px"> <?php
  if (!empty($product->customfields)) { 
    echo 
"<p>has custom fields</p>";
}
else{
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row]));
?>

</div>
Title: Re: disable the add-to-cart field from category view
Post by: Roderic on December 18, 2014, 14:03:17 PM
I added code to my previous post, but I have a feeling people who al ready read my post before that, won't see it. So I'm bumping my topic.