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

disable the add-to-cart field from category view

Started by Roderic, December 16, 2014, 19:06:34 PM

Previous topic - Next topic

Roderic

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?

AH

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
Regards
A

Joomla 4.4.5
php 8.1

Roderic

#2
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>

Roderic

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.