VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Kuubs on July 23, 2019, 11:31:22 AM

Title: Change related sublayout (multiple sublayouts for related products)
Post by: Kuubs on July 23, 2019, 11:31:22 AM
Hello,

I am making a website in Virtuemart but I am stuck in regarding the related products. I have this setup in my cart popup, but I also want to add these related products to my product details page. The thing that bothers me is that there is 1 file that has the code for the related products (related.php in sublayouts). But I need to change the code for the productdetails page, it's different from the padded.php. How can I load in the other related file? I don't see any option in the line of code that adds the related products:

echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'related_products','class'=> 'product-related-products','customTitle' => true ));

Anyone knows how to fix this?
Title: Re: Change related sublayout (multiple sublayouts for related products)
Post by: Studio 42 on July 23, 2019, 23:48:46 PM
You have https://shop.st42.fr/en/products/extra-product.htm.
See demo https://pro.st42.fr/en/demo/extra-product/extra-product-demo.html
You have 2 different layouts to show as related products (and 4 for addtocart) and this can be override in your templates.