Joomla 3.9.15
PHP 7.2.33
Virtuemart 3.6.10
On the products in a category the "Add to Cart" button is showing how do I remove this from being visible in the products in the categories, I just want it to display on the product page.
vm->config->config->shopfront
uncheck _> Show product customfields in browse views
I have that unchecked but the "Add to Cart" button still shows. (attached)
Even if I change to a different template it shows. (attached)
Then you have to edit the categories.php file in your template. remove the call to addtocart
Jörgen
components/com_virtuemart/views/category/tmpl/categories.php
defined('_JEXEC') or die('Restricted access');
if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
} ?>
....only that is inside the categories.php
Maybe this is found somewhere else? I think it might load from components/com_virtuemart/views/category/view.html.php but I am not seeing where in there though. I don't see anything related to a "cart" I could edit out that would remove the button.
Edit and override components/com_virtuemart/sublayouts/addtocartbar.php
Remove the whole addtocart-bar div.
Jenkins, I think this will remove it from product page to, or am i mistaken?
Jörgen @ Kreativ Fotografi
AARGH yes Jörgen you are right. On the site I'm thinking of I used multiple sublayout overrides. I do remember getting in a mess with them initially.
No,
you must comment this code:
<?php //echo $rowsHeight[$row]['customs'] ?>
<div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'] ?>"> <?php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>
</div>
inside:
components/com_virtuemart/sublayouts/products.php
or as override
templates/TEMPLATE/html/com_virtuemart/sublayouts/products.php
(Don't forget on sublayouts - products_horizon.php and products_slim.php if you need).
P.S.
But we use in our eshop another code, because this sublayout we loaded inside own modules or popup Add to cart or megamenu.
Rudolf you are right, products.php is the correct place to change.
Jörgen
Yes, it worked, thanks for the help Grandmaster Joomla Ninjas. ;D
Glad it worked out for you, sorry that I mislead you. Kudos to Rudolf.
Jörgen @ Kreativ Fotografi
Quote from: pinochico on August 22, 2020, 14:55:00 PM
No,
you must comment this code:
<?php //echo $rowsHeight[$row]['customs'] ?>
<div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'] ?>"> <?php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>
</div>
inside:
components/com_virtuemart/sublayouts/products.php
or as override
templates/TEMPLATE/html/com_virtuemart/sublayouts/products.php
(Don't forget on sublayouts - products_horizon.php and products_slim.php if you need).
P.S.
But we use in our eshop another code, because this sublayout we loaded inside own modules or popup Add to cart or megamenu.
Another question for you, on that same page is the category header, is the line of code to remove this in products.php as well? (attached what I am referring to) I am looking at all of the PHP above the add to cart button that I removed on that page but I don't see a reference to this header so I can remove it.
all these things are template dependent but probably in the over ride for components\com_virtuemart\views\category\tmpl\default.php
templates\xxxxxx\html\com_virtuemart\category\default.php
QuoteAnother question for you, on that same page is the category header, is the line of code to remove this in products.php as well? (attached what I am referring to) I am looking at all of the PHP above the add to cart button that I removed on that page but I don't see a reference to this header so I can remove it.
Is not sample answer
without URL eshop and analyze and definitely the first option is not tmpl default.php for the category.
Maybe is Title for Category or maybe a title for hidden menu or maybe another option