VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: dazmilliom on December 31, 2015, 02:40:04 AM

Title: Remove quantity box and +/- from home page only
Post by: dazmilliom on December 31, 2015, 02:40:04 AM
Hi,

I need to remove the quantity box and +/- from home page only. But i want them available on the product page itself.
Title: Re: Remove quantity box and +/- from home page only
Post by: jenkinhill on December 31, 2015, 12:40:27 PM
You do not mention your versions or if you are using the default VM templates.   http://forum.virtuemart.net/index.php?topic=128401.0

But assuming you are using VM3.0.12 with default templates and you are referring to the category listing page, then this can be done using template overrides involving the following:

components/com_virtuemart/views/category/tmpl/default.php
components/com_virtuemart/sublayouts/products.php
components/com_virtuemart/sublayouts/addtocart.php
components/com_virtuemart/sublayouts/addtocartbar.php

You may also need to add overrides for modules.

An alternative would be to add some css to hide the elements on the required pages by maybe using scoped css or in body css, although this may have browser issues.
Title: Re: Remove quantity box and +/- from home page only
Post by: dazmilliom on December 31, 2015, 16:41:42 PM
Apologies for not mentioning my VM verison which is VM3.0.12 with a bare-bones template I wrote myself.

I see class="quantity-box" for the quantity box and class="quantity-controls js-recalculate" for the +/- controls. I need this classes not to show up on the homepage categories of which I am only displaying featured products and lastest products categories. But I want when a customer clicks on the product on the homepage and is taken to the product page for the classe to show there.

I had used display: 'none' to hid both classes on the home page, But it is also hidden on the product page which is really where I need it displayed. Thanks for responding
Title: Re: Remove quantity box and +/- from home page only
Post by: GJC Web Design on December 31, 2015, 17:39:17 PM
filter your css by using classes further up the chain... excl. to home page
Title: Re: Remove quantity box and +/- from home page only
Post by: dazmilliom on December 31, 2015, 18:41:08 PM
Hi

My further up the chain classes for the front page are (div class= featured-view) and for the product page it is (div class='productdetails-view productdetails'). How do I turn off the (div class='quantity-box') in  (div class= featured-view) but leave it on in (div class='productdetails-view productdetails'). The code will be much appriciated
Title: Re: Remove quantity box and +/- from home page only
Post by: GJC Web Design on January 01, 2016, 19:16:06 PM
.featured-view .quantity-box {
display:none;
         }
Title: Re: Remove quantity box and +/- from home page only
Post by: dazmilliom on January 10, 2016, 20:34:33 PM
Thanks