Jump to content

How to display supplier products on product.tpl


Recommended Posts

Hi i need show products from supplier on product page. I create override ProductController like 

<?php

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        parent::initContent();
        
        if ((int)$this->product->id_supplier) {
            $this->context->smarty->assign(
                'product_supplier',
                new Supplier((int)$this->product->id_supplier, (int)$this->context->language->id)
            );
        }
    }
}

But this works only for desc, name, and others info. But didnt work for products. 

In product tpl i try with: 

 {if isset($product_supplier)}
    {if $products}
    	{include file="./product-list.tpl" products=$products}
    {/if}
{/if}

Its look similar to supplier.tpl :) Any idea how to include products from supplier?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...