VirtueMart 3.6.10 Default Theme.
Joomla! 3.9.14
I know this was in the earlier versions, but I can't seem to find it, also can't find it searching the forums..
I want customers to be forced to hit product details then have the ability to add to cart..
uncheck -> vm admin -> shopfront- > Show product customfields in browse views
Hum.. that didn't do it...
There is a way to do this in your over rides if you are able to edit the php file, it be in a path such as html/com_virtuemart/sublayouts/products.php
There is a part in products.php that shows the add to cart button for category view something like following...
<div class="vm-addtocart-button vm3pr-<?php echo $rowsHeight[$row]['customfields'] ?>">
<?php echo shopFunctionsF::renderVmSubLayout('addtocartcats',array('product'=>$product,'rowHeights'=>$rowsHeight[$row])); ?>
</div>
@hotrod, GJC's solution seems not to work in current versions - and does require that you use custom fields for each product. The simplest way to remove addtocart from browse views is to edit and override components/com_virtuemart/sublayouts/products.php (assuming you don't already use overrides), as intimated by Phil.
Simply remove the following div:
<div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'] ?>"> <?php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>
</div>
Save the edited file as templates/[your Joomla template]/html/com_virtuemart/sublayouts/products.php so it does not get overwritten by subsequent VM updates
Thank You, That worked.
Just a little confused on where to put that file. I'm not showing those folders in my template file.
Quote from: hotrod on January 26, 2020, 13:37:19 PM
I'm not showing those folders in my template file.
Then add them! Use FTP or cPanel to do that.
That's what I was thinking, Its ok to leave the file in the folder it was? or just move it over to the new folder ..
I answered my own question. I renamed the old one and I'm assuming it's now pulling from the other location as a template override..
Thank You!!
You should NOT rename the old file, in some cases the extension checks if the original file exists and stops there if not found :)
Not sure about what VM does in this case. The normal order is check template, if there is an override use it, but as I said I have seen bad behaviour before. Simply leave the original in place and make a copy to override. This is normal Joomla behaviour.
Jörgen @ Kreativ Fotografi
Ok thanks Jörgen