Add Product to the Cart using Product ID Programmatically
I got this problem i cant solve it
I have an Array of name proidArray in this i have some products IDs
<?php for($i=0;$i<sizeof($proidArray);$i++){
echo $proidArray[$i];
} ?>
Its displaying all Product IDs in the array But actually my goal you can
see here
<?php for($i=0;$i<sizeof($proidArray);$i++) { ?>
<button type=-"button" class="button btn-cart" id="<?php echo
$proidArray[$i]; ?>" onclick="productAddToCartForm.submit(<?php echo
$proidArray[$i]; ?>)">
<span>Add To Cart</span>
</button>
<?php } ?>
Its displaying in Frontend like this
If i click first Add To Cart button means first product should add to the
cart ..
If i click second button means second product should be add to cart
Any thing wrong i did here ?
Any ideas ?
No comments:
Post a Comment