Author Topic: Remove quantity box from Product pages  (Read 3594 times)

troysteele5

  • Beginner
  • *
  • Posts: 13
Remove quantity box from Product pages
« on: November 17, 2014, 06:09:17 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8151
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Remove quantity box from Product pages
« Reply #1 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Spyros Petrakis

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 101
    • OlympianThemes
  • VirtueMart Version: Always latest Stable
Re: Remove quantity box from Product pages
« Reply #2 on: November 17, 2014, 16:48:21 pm »
Or you can just add the following css code to your template
Code: [Select]
.productdetails .quantity-box, .productdetails .quantity-controls {
  display: none !important;
}
Fast and simple to use templates with fanatical support
https://www.olympianthemes.com

troysteele5

  • Beginner
  • *
  • Posts: 13
Re: Remove quantity box from Product pages
« Reply #3 on: November 18, 2014, 18:45:23 pm »
Thanks, just added to css file and worked!

by_sead

  • Beginner
  • *
  • Posts: 3
HELP HELP!
« Reply #4 on: January 21, 2015, 02:30:39 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8151
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Remove quantity box from Product pages
« Reply #5 on: January 21, 2015, 11:59:44 am »
as Spyros said->

Quote
Or 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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

by_sead

  • Beginner
  • *
  • Posts: 3
Re: Remove quantity box from Product pages
« Reply #6 on: January 21, 2015, 12:16:34 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8151
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Remove quantity box from Product pages
« Reply #7 on: January 21, 2015, 12:24:28 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26992
  • Always on vacation
    • Jenkin Hill Internet
Re: Remove quantity box from Product pages
« Reply #8 on: January 21, 2015, 12:27:48 pm »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12

irsinternet

  • Beginner
  • *
  • Posts: 25
  • A beginner
Re: Remove quantity box from Product pages
« Reply #9 on: September 17, 2018, 02:46:33 am »
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 (<!--):
Code: [Select]
<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:
Code: [Select]
<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):
Code: [Select]
<?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>