News:

Support the VirtueMart project and become a member

Main Menu

plus and minus in cart [SOLVED]

Started by guardiano78, June 20, 2013, 13:41:03 PM

Previous topic - Next topic

guardiano78

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

jenkinhill

#1
The quanity change buttons are included in the default VM productdetail templates. Are you using template overrides?
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

guardiano78

#2
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

jenkinhill

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>

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


jenkinhill

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

guardiano78

i found the function in "components\com_virtuemart\assets\js\vmprices.js" but i don't know how made i to work

guardiano78

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>