DARKF3D3 Posted January 9, 2011 Share Posted January 9, 2011 Hello, i need to have in my shop's home 2 "featured products" module, estetically the same but with different product.I have try to copy the fratured products folder but obviously it dowsn't work, there's something to modify, but i don't know what... someone could help me?Thanks Link to comment Share on other sites More sharing options...
shokinro Posted January 9, 2011 Share Posted January 9, 2011 At least, you need to change do following things1. Change the folder, for example homefeatured12. Change related file name to a different ones. for example homefeatured.php ->homefeatured1.php and homefeatured.tpl ->homefeatured1.tpl3. Change the class name of copied module class to HomeFeatured1 class HomeFeatured1 extends Module 4. change the modules name to different, for example $this->name = 'homefeatured1'; 5. If don not want to share the parameters, you have to change the parameter name for example, HOME_FEATURED_NBR1 Configuration::updateValue('HOME_FEATURED_NBR1', intval($nbr)); 3 Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 9, 2011 Author Share Posted January 9, 2011 EDIT Link to comment Share on other sites More sharing options...
shokinro Posted January 9, 2011 Share Posted January 9, 2011 It should work if you have done everything correctly. I have done this for some modules.Please try to set 'display_errors' to 'on' in /config/config.inc.php file. See if there is any error displayed on the top of your page. It will give some hints where/what goes wrong. Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 9, 2011 Author Share Posted January 9, 2011 Ok, now it works, i have 2 modules.But now when i modify the number of displayed product of one module it modify also the setting of the other module... i don't undestand why. EDITED:I have changed some variable name and now it works, but now i have a problem that i have no idea how to solve it.This is my situation:BLOCK Featured 1: 6 products showedBLOCK Featured 2: 3 products showedThe 3 products of the second module is the the same as the fisrt three of the module 1.Theres a way to put into the second module 3 different product?In attachments there's the modified module.Thanks homefeatured2.zip Link to comment Share on other sites More sharing options...
shokinro Posted January 9, 2011 Share Posted January 9, 2011 It seems that I missed some instructions in my previous post. I have updated them.These steps should work for most modules. But got HomeFeatured module, you need to do something more. This is my situation:BLOCK Featured 1: 6 products showedBLOCK Featured 2: 3 products showedThe 3 products of the second module is the the same as the fisrt three of the module 1.Theres a way to put into the second module 3 different product? Why the problem occurs is that HomeFeatured module are getting data from product category "Home".If you want load completely different data, you need use another category and for the 2nd module, load data from different category. Change the following "1" to your new category id, for example, 111.code before change $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); code after change $products = $category->getProducts(intval($params['cookie']->id_lang), 1111, ($nb ? $nb : 10)); Link to comment Share on other sites More sharing options...
shokinro Posted January 9, 2011 Share Posted January 9, 2011 One more thing, please don't forget to change the line that load tpl file.For the new module, you need to load new tpl file that is homefeatured1.tplreturn $this->display(__FILE__, 'homefeatured1.tpl'); Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 10, 2011 Author Share Posted January 10, 2011 EDIT Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 10, 2011 Author Share Posted January 10, 2011 Now i deed to edit height of the module and top bar, i want a different one for the new module.There a way to not copy all that code but change only these 2 rows?background: transparent url('../img/block_header_large.png') no-repeat top left;height: 370px; Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 11, 2011 Author Share Posted January 11, 2011 Now i want that the module show at random 3 of the product in offer with the "V" Display "on sale" icon on product page and text on product listing.How can i do that? Link to comment Share on other sites More sharing options...
DARKF3D3 Posted January 14, 2011 Author Share Posted January 14, 2011 No one know how can i show product in offer instead the product assigned to the home category? Link to comment Share on other sites More sharing options...
noesac Posted September 24, 2011 Share Posted September 24, 2011 At least, you need to change do following things 1. Change the folder, for example homefeatured1 2. Change related file name to a different ones. for example homefeatured.php ->homefeatured1.php and homefeatured.tpl ->homefeatured1.tpl 3. Change the class name of copied module class to HomeFeatured1 class HomeFeatured1 extends Module 4. change the modules name to different, for example $this->name = 'homefeatured1'; 5. If don not want to share the parameters, you have to change the parameter name for example, HOME_FEATURED_NBR1 Configuration::updateValue('HOME_FEATURED_NBR1', intval($nbr)); Great tip! You're also missing this, you need to change this one too: return $this->display(__FILE__, 'homefeatured1.tpl'); 2 Link to comment Share on other sites More sharing options...
Sergiu75 Posted November 6, 2012 Share Posted November 6, 2012 Is this working for Adsense module too? Thank you. Link to comment Share on other sites More sharing options...
shokinro Posted December 6, 2013 Share Posted December 6, 2013 Is this working for Adsense module too? Yes.the basic rules are the same. Link to comment Share on other sites More sharing options...
johnme Posted March 13, 2014 Share Posted March 13, 2014 it is possible to Assign diffrent Categories for Different home featured modules Link to comment Share on other sites More sharing options...
shokinro Posted March 13, 2014 Share Posted March 13, 2014 the general rules should work for all modules. Link to comment Share on other sites More sharing options...
johnme Posted March 14, 2014 Share Posted March 14, 2014 (edited) the general rules should work for all modules. Hi Bro How to assigned Selected Category for Home Featured 1 , 2 , 3 For example . a category callled Promotion . Only this Promotion category need to show home featured Edited March 14, 2014 by johnme (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted March 14, 2014 Share Posted March 14, 2014 hello you mean that you want to display products from several categories? Link to comment Share on other sites More sharing options...
johnme Posted March 14, 2014 Share Posted March 14, 2014 hello you mean that you want to display products from several categories? NO . i mean home featured, home 2 featured, home 3 featured home featured > assign category called > Today Promotions home 2 featured > Assign category called > Own Development Products home 3 featured > Assign category called > Electo products i want to selected or show Only some categories which i want to show in index page Link to comment Share on other sites More sharing options...
johnme Posted March 15, 2014 Share Posted March 15, 2014 any expect please help me Link to comment Share on other sites More sharing options...
Om Developers Posted February 9, 2015 Share Posted February 9, 2015 (edited) How to add New table and its add,edit,delete functionality within prestashop??? Edited February 9, 2015 by Om Developers (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now