News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove quantity box from Product pages

Started by troysteele5, November 17, 2014, 06:09:17 AM

Previous topic - Next topic

troysteele5

Hello just wondering how to remove the quantity box entirely from product pages in Virtuemart 2.9.9.4  as im selling a digital product.

Thanks

GJC Web Design

with a template over ride  - just comment out the quanity box section and add a hidden field with the quanity = 1
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

Spiros Petrakis

Or you can just add the following css code to your template

.productdetails .quantity-box, .productdetails .quantity-controls {
  display: none !important;
}
Joomla templates and extensions development
https://www.yourgeek.gr

troysteele5

Thanks, just added to css file and worked!

by_sead

greeting
i have a big problem with quantity box in virtuemart 2.6.14.
how do i remove a quantity box with each product that can not appear on the frontend website
thanks in advance.

GJC Web Design

as Spyros said->

QuoteOr you can just add the following css code to your template
Code: [Select]

.productdetails .quantity-box, .productdetails .quantity-controls {
  display: none !important;
}
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

by_sead

in which css file to put this code have 20 css files ??

in which css file to put this code have 20 css files ??

GJC Web Design

1. do some googling as to how css works

2. in any css file that is loaded on the views you want to effect
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

jenkinhill

It could be added to the last css file loaded or a custom css file created specially,  but my preference for VM specific styles is to include any changes in an override.  http://docs.virtuemart.net/tutorials/templating-layouts/106-override-vmsite-ltr-css.html
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

irsinternet

#9
Quote from: GJC Web Design on November 17, 2014, 12:59:29 PM
with a template over ride  - just comment out the quanity box section and add a hidden field with the quanity = 1

I know this is a really old thread, but I'm looking to do the same. Here is what to do:

Create these folders:
/your_domain/templates/your_template/html/com_virtuemart/sublayouts/

Copy addtocartbar.php from /components/com_virtuemart/sublayouts/ to the new folder you created.

Approx line 97, comment out (<!--):
<input type="<?php echo $editable ?>" class="quantity-input js-recalculate" name="quantity[]"
                       data-errStr="<?php echo vmText::('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>"
                       value="<?php echo $init?>" init="<?php echo $init?>" step="<?php echo $step?>" <?php echo $maxOrder?> />

Insert this:
<input type="hidden" class="quantity-input js-recalculate" name="quantity[]"
                       data-errStr="<?php echo vmText::('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>"
                       value="<?php echo $init?>" init="<?php echo $init?>" step="<?php echo $step?>" <?php echo $maxOrder?> />


Comment out the +/- (couple lines down):
<?php if ($product->orderable) { ?>
                <span class="quantity-controls js-recalculate">
<input type="button" class="quantity-controls quantity-plus"/>
<input type="button" class="quantity-controls quantity-minus"/>
</span>