News:

Support the VirtueMart project and become a member

Main Menu

'add to cart' in category view

Started by carsten888, March 15, 2012, 19:35:21 PM

Previous topic - Next topic

carsten888

I only got a couple of products in the shop, so I tried getting 'add to cart' work in category view.

I did a template override on category view and got as far as that I get the add to cart button and get the popup, but its not being added to the card.

in the category template I added under line 283
<p>
<form method="post" class="product js-recalculate" action="index.php" >
<span class="addtocart-button">
<input type="submit" name="addtocart"  class="addtocart-button" value="Add to Cart" title="Add to Cart" />
</span>
<input type="hidden" class="pname" value="<?php echo $product->product_name ?>" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="cart" />
<noscript><input type="hidden" name="task" value="add" /></noscript>
<input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->id?>" />
<input type="hidden" name="virtuemart_manufacturer_id" value="1" />
<input type="hidden" name="virtuemart_category_id[]" value="1" />
<input type="text" class="quantity-input js-recalculate" name="quantity[]" value="1" />
<input type="button" class="quantity-controls quantity-plus" />
<input type="button" class="quantity-controls quantity-minus" />
</form>
</p>


I would realy appreciate a clue as to how to get this going.  :P

Might be a nice new (optional) feature.


carsten888

thanks for the link. I don't know why that was not in my searchresults.

I tried each code, but none seems to work. I will post in the other thread.