Post by danny1515 » Tue Aug 13, 2013 1:29 pm

Om een of andere reden wordt het aantal stuks niet verrekend in de winkelwagen.
Bij klikken op toevoegen neemt ie maar 1 stuk ipv het aantal ingevuld.
code hiervan:

Code: Select all

 	
<tr>
<td class="prijs-box">
</script> 
<script type="text/javascript"><!--
jQuery(document).ready(function(){
    // This button will increment the value
    $('.qtyplus').click(function(e){
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        quant = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+quant+']').val());
        // If is not undefined
        if (!isNaN(currentVal)) {
            // Increment
            $('input[name='+quant+']').val(currentVal + 1);
        } else {
            // Otherwise put a 0 there
            $('input[name='+quant+']').val(1);
        }
    });
    // This button will decrement the value till 0
    $(".qtyminus").click(function(e) {
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        quant = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+quant+']').val());
        // If it isn't undefined or its greater than 0
        if (!isNaN(currentVal) && currentVal > 1) {
            // Decrement one
            $('input[name='+quant+']').val(currentVal - 1);
        } else {
            // Otherwise put a 0 there
            $('input[name='+quant+']').val(1);
        }
    });
});

//--></script> 
<div class="cart">
<div><?php echo $text_qty; ?>
    <input type='button' value='-' class='qtyminus' field='quantity' />
    <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" class="qty" ;/>
	
    <input type='button' value='+' class='qtyplus' field='quantity' >
  <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
<input type='hidden' value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
                       
	<a onclick="addToCart('<?php echo $product_id; ?>');"><div class="button-product">Toevoegen aan winkelmandje</div>
<a onclick="addToCompare('<?php echo $product_id; ?>');"><div class="button-vergelijking">Toevoegen aan productvergelijking</div></a>

</td>
</tr>

 </table>
</div>

Ook zou het "aantal vakje" binnenin het "toevoegen aan winkelmandje moeten komen"
Kan iemand mij helpen met het aanpassen van de code.
Last edited by danny1515 on Thu Oct 03, 2013 10:04 pm, edited 7 times in total.

Newbie

Posts

Joined
Fri Aug 02, 2013 8:52 pm

Post by victorj » Wed Aug 14, 2013 4:11 am

probeer eerst eens wat er gebeurt, als je tijdelijk even test met default template.
werkt het daar wel, zo ja dan is het een template probleem.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland
Who is online

Users browsing this forum: No registered users and 5 guests