VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: fbc on December 04, 2015, 18:52:44 PM

Title: Showing Related Products in a linear fashion with qty and add-to-cart button
Post by: fbc on December 04, 2015, 18:52:44 PM
It seems like the way related products are displayed is in a helter skelter fashion.

I found a few examples for VM2, but the files are not longer where they say they are, and can't seem to locate them in VM3.
Like: http://forum.virtuemart.net/index.php?topic=106732.0
and: http://stackoverflow.com/questions/11346328/display-pricing-and-add-to-cart-button-in-related-products-virtuemart-2-0

Is there any way to make it look kinda like these example in the photos attached?

I'm using VM3
Title: Re: Showing Related Products in a linear fashion with qty and add-to-cart button
Post by: GJC Web Design on December 04, 2015, 22:25:38 PM
It's just templating..

in components\com_virtuemart\views\virtuemart\tmpl\default.php the sublayout products.php is called

you need to over ride this to produce what layout you want .. (1 per row)

http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
Title: Re: Showing Related Products in a linear fashion with qty and add-to-cart button
Post by: fbc on December 04, 2015, 22:39:16 PM
Quote from: GJC Web Design on December 04, 2015, 22:25:38 PM
It's just templating..

in components\com_virtuemart\views\virtuemart\tmpl\default.php the sublayout products.php is called

you need to over ride this to produce what layout you want .. (1 per row)

http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
Super!! Let me see if I can work through it tonight with this new information.. Thanks.
Title: Re: Showing Related Products in a linear fashion with qty and add-to-cart button
Post by: fbc on December 08, 2015, 16:58:27 PM
Quote from: GJC Web Design on December 04, 2015, 22:25:38 PM
in components\com_virtuemart\views\virtuemart\tmpl\default.php the sublayout products.php is called
that code appears to be for the frontpage and not the product details view.
Title: Re: Showing Related Products in a linear fashion with qty and add-to-cart button
Post by: fbc on December 08, 2015, 17:06:37 PM
I think what I want to change is in components/com_virtuemart/sublayouts/related.php

I think this is the code that controls how the related products a displayed. Now I need to figure out how to add the add to cart and qty button and change the layout.