News:

Support the VirtueMart project and become a member

Main Menu

Remove quantity box and +/- from home page only

Started by dazmilliom, December 31, 2015, 02:40:04 AM

Previous topic - Next topic

dazmilliom

Hi,

I need to remove the quantity box and +/- from home page only. But i want them available on the product page itself.

jenkinhill

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.
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

dazmilliom

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

GJC Web Design

filter your css by using classes further up the chain... excl. to home page
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

dazmilliom

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

GJC Web Design

.featured-view .quantity-box {
display:none;
         }
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