News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove Add To Cart In Catagory View

Started by hotrod, January 26, 2020, 03:35:13 AM

Previous topic - Next topic

hotrod

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..
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

GJC Web Design

uncheck -> vm admin -> shopfront- > Show product customfields in browse views
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

hotrod

Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

phil147

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>




jenkinhill

@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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

hotrod

Thank You, That worked.
Just a little confused on where to put that file. I'm not showing those folders in my template file.
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

hotrod

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 ..
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

hotrod

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!!
Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0

Jörgen

#9
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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

hotrod

Bronze Member
VirtueMart 4.2.4 10922
Joomla!  ‎4.3.4
PHP 8.0