Add to cart in product shortened template


https://forum.kartris.com/Topic6554.aspx
Print Topic | Close Window

By Supermac - Thu 16 Jun 2016
Would it be a big work to add a quantity selector and an "add-to-basket" button to ProductTemplates?
Particularly I would add it to the ProductTemplateShortened (customer who asked this to me has only single version products) to allow users to add items to basket avoiding the click to enter product detail's page (where add-to-basket feature actually is)...
By Paul - Thu 16 Jun 2016
I think the best way would be to try modifying the 'extended' product template. That handles displaying products with their versions (or options products) within product listings pages. You'd just need to work on the CSS to lay things out more like the shortened format. But that template has the code you need so that if your products are set as single version products, you'd get an 'add' button, and that functionality is all there.
By Supermac - Tue 21 Jun 2016
Good practice doubt:
I wont to modify ProductTemplateExtended (I use it in product detail page) so I made my own UC starting from ExtendedTemplate as you suggested and registered it in web.config, then I changed configuration telling Kartris to use extended template when browsing products in category pages (frontend.products.display.default=e) and finally I modified CategoryProductsView.ascx telling the page to use my UC instead of standard ExtendedTemplate.
It all works perfectly, I just would know if is this the right procedure or had I to follow a better way.
By Paul - Tue 21 Jun 2016
Perfect, even better than modifying the existing one.
By Supermac - Wed 22 Jun 2016
Thank you!