VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: designthewebs on May 07, 2012, 19:26:35 pm

Title: Add to cart button in category layout
Post by: designthewebs on May 07, 2012, 19:26:35 pm
Hello guys, I am new here on the forum and have been using Virtumar 1.x for quite a long while now, as I'm new to 2.x I have a question about this version.
Is there a possibility to put an add to cart button in the category view were al the products in one category are listed, so that de customer doesn't have to go to the product page in order to add this product to the basket?

Thanks in advance.
Title: Re: Add to cart button in category layout
Post by: JtouchMobile.com on May 08, 2012, 10:50:09 am
Don't know if there already has a solution for this or not, but you can get it by making a template override
(Understanding  about VIEW in VM 2: http://forum.virtuemart.net/index.php?topic=90935.0)

- First, find the code to control "categories" layout here:
/components/com_virtuemart/views/categories/tmpl/default.php

- Then, read code of generate add to cart control, in product details view:
/com_virtuemart/views/productdetails/tmpl/default.php
and
/com_virtuemart/views/productdetails/tmpl/default_addtocart.php

Then you can easy bring the add to cart function to categories view.

I know that this is a hand-by-hand guide, but I hope that it will give you a point to do a research and then apply it for your own purpose

;)
Title: Re: Add to cart button in category layout
Post by: K&K media production on May 09, 2012, 00:16:25 am
http://forum.virtuemart.net/index.php?topic=90961.0