how to use increment quantity in magento


jQuery(document).ready(function($){
// Your code here

jQuery(“div.quantity”).append(”).prepend(”);
jQuery(“.plus”).click(function()
{
var currentVal = parseInt(jQuery(this).prev(“.qty”).val());

if (!currentVal || currentVal==”” || currentVal == “NaN”) currentVal = 0;

jQuery(this).prev(“.qty”).val(currentVal + 1);
});

jQuery(“.minus”).click(function()
{
var currentVal = parseInt(jQuery(this).next(“.qty”).val());
if (currentVal == “NaN”) currentVal = 0;
if (currentVal > 0)
{
jQuery(this).next(“.qty”).val(currentVal – 1);
}
});
});

getProduct(); ?>
__(‘Add to Cart’); ?>
isSaleable()): ?>

isGrouped()): ?>

<input type="text" name="qty" id="qty" maxlength="12" value="getMinimalQty($_product) ?>” title=”__(‘Qty’) ?>” class=”input-text qty” />

<button type="button" title="” class=”add-to-cart ” onclick=”productAddToCartForm.submit(this)”>
getChildHtml(”, true, true) ?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s