Jump to content

Riya

Recommended Posts

in homefeatured.php file you have to define new products arrays:

 

there is a funciton hookDisplayHome with code:

$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
$nb = (int)Configuration::get('HOME_FEATURED_NBR');
$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));

define additional "categories" with code:

$category2 = new Category(15, (int)Context::getContext()->language->id);
$products2 = $category2->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));

where 15 is a category number. You can define as many variables with products as you want.

 

then add new viariables to smarty array:

$this->smarty->assign(array(
'products' => $products,
'products2' => $products2,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
));

Now in .tpl file (homefeatured.tpl) you can create additional foreach loop on new variables.

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...