VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: troysteele5 on November 17, 2014, 06:09:17 AM

Title: Remove quantity box from Product pages
Post by: troysteele5 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
Title: Re: Remove quantity box from Product pages
Post by: 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
Title: Re: Remove quantity box from Product pages
Post by: Spiros Petrakis on November 17, 2014, 16:48:21 PM
Or you can just add the following css code to your template

.productdetails .quantity-box, .productdetails .quantity-controls {
  display: none !important;
}
Title: Re: Remove quantity box from Product pages
Post by: troysteele5 on November 18, 2014, 18:45:23 PM
Thanks, just added to css file and worked!
Title: HELP HELP!
Post by: by_sead 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.
Title: Re: Remove quantity box from Product pages
Post by: GJC Web Design on January 21, 2015, 11:59:44 AM
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;
}
Title: Re: Remove quantity box from Product pages
Post by: by_sead 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 ??
Title: Re: Remove quantity box from Product pages
Post by: GJC Web Design 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
Title: Re: Remove quantity box from Product pages
Post by: jenkinhill 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
Title: Re: Remove quantity box from Product pages
Post by: irsinternet on September 17, 2018, 02:46:33 AM
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>