Jump to content

[SOLVED] Not able to transplant the "featured products" module of home page to reight or left column


Recommended Posts

I am new to prestashop.. actually i am having a problem the the "featured products" module in home page is not getting transplanted to right or left column.also it on removing from "display home" module is getting dis-appeared.. I checked the css and the tpl files.. please will any one help me? i want my slider covering the center, my featured products each 3 in 2 rows, and the right side column in its place i.e contact block, new products, etc in the right block only.... does any one have the solution?

Link to comment
Share on other sites

you need to modify this module. It's necessary to add left / right hook support.

 

just create funcitons like:

 

public function hookDisplayLeftColumn($params)

{
         
if (!$this->isCached('homefeatured.tpl', $this->getCacheId('homefeatured')))
{
$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));
            $products = array_reverse($products);
$this->smarty->assign(array(
'products' => $products,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
));
}
return $this->display(__FILE__, 'homefeatured.tpl', $this->getCacheId('homefeatured'));
}

 

and:

 

public function hookDisplayRightColumn($params)

{
         
if (!$this->isCached('homefeatured.tpl', $this->getCacheId('homefeatured')))
{
$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));
            $products = array_reverse($products);
$this->smarty->assign(array(
'products' => $products,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
));
}
return $this->display(__FILE__, 'homefeatured.tpl', $this->getCacheId('homefeatured'));
}
Link to comment
Share on other sites

Thank you for your answer... but i'm having a silly question that where have i to create these functions?

and after creating the functions what other changes have i to do?

sorry for such silly questions, but i'm totally confused for this so asking such questions...

Edited by ujita tharani (see edit history)
Link to comment
Share on other sites

thank u very much for the answer... but i want my featured products exactly below the slider so i'm not able to do it... will you please tell me how to do it? i mean when i move it to right column it goes down the slider in a vertical column and if i move it to left column it comes above the slider..

Edited by ujita tharani (see edit history)
Link to comment
Share on other sites

thank u very much for the answer... but i want my featured products exactly below the slider so i'm not able to do it... will you please tell me how to do it? i mean when i move it to right column it goes down the slider in a vertical column and if i move it to left column it comes above the slider..

 

you can manage position of the modules under modules > position tab. Just find module on list (displayLeft & displayRight modules list). Moreover i don't know where you've got slider. you wanted to know how to transplant module to left/right hook.

Link to comment
Share on other sites

sure i can :)  im going to mark this topic as [solved] 

your question is not related to main case in this topic, so please create separate thread with your question, i will definitely help you

(sorry for bothering, but it is due to the forum rules 1 topic = 1 question)

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