VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: hazael on March 01, 2017, 14:45:36 PM

Title: How to change the method of selecting the quantity?
Post by: hazael on March 01, 2017, 14:45:36 PM
Standard selection of the quantity of products in "add to cart bar" is: (+/-) 1,2,3 ...

I want to do shop for printing house.
if I will sell the business cards and flyers I want to make a choice like this:
(+/-) 100,500,1000, 2000...

How to change the method of selecting the quantity of products in the cart?

Is it somehow?
Title: Re: How to change the method of selecting the quantity?
Post by: Studio 42 on March 01, 2017, 18:38:04 PM
You can modify in your template directly the quantity part in YOURTEMPLATE/html/com_virtuemart/sublayouts/addtocartbar.php
If it not exist you need to copy this from components/com_virtuemart/sublayouts/addtocartbar.php
If you need to have different layout, then you have to copy to another file eg addtocartbar2.php , using another sublayout and change this code
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));
to
echo shopFunctionsF::renderVmSubLayout('addtocart2',array('product'=>$this->product));
and do your changes in this file.

Note : You can add condition too or copy the default files and do an overrides...
Title: Re: How to change the method of selecting the quantity?
Post by: hazael on March 01, 2017, 20:46:19 PM
Thanks for the valuable clue.

I found variables:
$init = 1;
$step=1;
I can handle it :)