VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: guardiano78 on June 20, 2013, 13:41:03 PM

Title: plus and minus in cart [SOLVED]
Post by: guardiano78 on June 20, 2013, 13:41:03 PM
Hello,
i need to insert in cart page the quantity control plus and minus.
I copy and paste che source code of browse page but they doesn't works :-(

How i can do this?



joomla 2.5.11 - vm 2.0.20b
Title: Re: plus and minus in cart
Post by: jenkinhill on June 20, 2013, 15:36:50 PM
The quanity change buttons are included in the default VM productdetail templates. Are you using template overrides?
Title: Re: plus and minus in cart
Post by: guardiano78 on June 20, 2013, 16:17:50 PM
Hello,
thank you for reply.
I'm using atomic template modified by me; and virtuemart template default.
But in cart i see only quantity box, update icon and delete icon.

i'm working in default_pricelist.php
Title: Re: plus and minus in cart
Post by: jenkinhill on June 20, 2013, 16:36:36 PM
You will need this code and more (from default-addtocart.php)

<span class="quantity-box">
<input type="text" class="quantity-input js-recalculate" name="quantity[]" onblur="check(this);" value="<?php if (isset($this->product->step_order_level) && (int)$this->product->step_order_level 0) {
echo $this->product->step_order_level;
} else if(!empty($this->product->min_order_level)){
echo $this->product->min_order_level;
}else {
echo '1';
?>
"/>
    </span>
<span class="quantity-controls js-recalculate">
<input type="button" class="quantity-controls quantity-plus"/>
<input type="button" class="quantity-controls quantity-minus"/>
    </span>

Title: Re: plus and minus in cart
Post by: guardiano78 on June 20, 2013, 17:44:58 PM
... and more what??
Title: Re: plus and minus in cart
Post by: jenkinhill on June 20, 2013, 18:07:01 PM
JavaScript probably
Title: Re: plus and minus in cart
Post by: guardiano78 on June 20, 2013, 18:17:12 PM
i found the function in "components\com_virtuemart\assets\js\vmprices.js" but i don't know how made i to work
Title: Re: plus and minus in cart [SOLVED]
Post by: guardiano78 on June 20, 2013, 18:30:00 PM
I soved whit this code:

<span class="quantity-controls"><input type="button" class="quantity-controls quantity-plus" onClick="javascript:this.form.quantity.value++;" /></span>
<span class="quantity-controls"><input type="button" class="quantity-controls quantity-minus" onClick="javascript:this.form.quantity.value--;"/></span>