omgzhobbs Posted December 2, 2013 Share Posted December 2, 2013 Similar to showing featured products (module), is there a way to show certain categories on on the home page? Such as a certain brand? Any free modules for this? Or a feature im missing? Link to comment Share on other sites More sharing options...
ibndawood Posted December 3, 2013 Share Posted December 3, 2013 Hi, If you have a module that displays products from a category/manufacturer etc, you can simply hook it to home. The whole of home page is only hooks (index.tpl). Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 3, 2013 Author Share Posted December 3, 2013 Ace thanks, do you know of any modules which do this? I am unable to find one to just show products from a certain category, only featured (home) or new products. Link to comment Share on other sites More sharing options...
ibndawood Posted December 3, 2013 Share Posted December 3, 2013 Looks like a good idea to write a module. I can write one and get back to you in few hours ? 1 Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 3, 2013 Author Share Posted December 3, 2013 That'd be amazing if you could Link to comment Share on other sites More sharing options...
ibndawood Posted December 3, 2013 Share Posted December 3, 2013 (edited) Something to note here : Home is also a category and products can belong to more than one category. So if you want to add products to home you can actually tag that product to home category itself. That would work. Edited December 3, 2013 by ibndawood (see edit history) Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 3, 2013 Author Share Posted December 3, 2013 Yeah I understand this, but I need a whole new block rather than just the ones in the home cat, as this is used for featured and not select brands etc Link to comment Share on other sites More sharing options...
vekia Posted December 3, 2013 Share Posted December 3, 2013 you can duplicate homefeatured module and change one line: $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id); instead of Context::getContext()->shop->getCategory() use category id you want to display for example, you can create hidden category, attach your product there then voila 1 Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 3, 2013 Author Share Posted December 3, 2013 Where do I add the ID?Like this? $category = new Category(Context::getContext()->shop->getCategory(ID GOES HERE?), (int)Context::getContext()->language->id); Link to comment Share on other sites More sharing options...
vekia Posted December 3, 2013 Share Posted December 3, 2013 no no, instead of whole code: Context::getContext()->shop->getCategory() use just category ID number something like: $category = new Category(125, (int)Context::getContext()->language->id); where 125 is a category ID number Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 3, 2013 Author Share Posted December 3, 2013 no no, instead of whole code: Context::getContext()->shop->getCategory() use just category ID number something like: $category = new Category(125, (int)Context::getContext()->language->id); where 125 is a category ID number Ace worked a charm, since installing the second module though, now all the items on the homepage are aligned to the left? Link to comment Share on other sites More sharing options...
ibndawood Posted December 4, 2013 Share Posted December 4, 2013 I was going to suggest you can duplicate homefeatured module and change one line: $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id); instead of Context::getContext()->shop->getCategory() use category id you want to display for example, you can create hidden category, attach your product there then voila I was going to suggest that but I was worried it might confuse. There are few things to note though and if you are a programmer you can look into that : * The class names, try to keep them separate. * Line 65 and Line 82 has this configuration value : HOME_FEATURED_NBR. This stores the no of products to be displayed. You might want to use some other name so that it doesn't conflict with the home featured module. Like HOME_CATEGORIES_NBR. Ace worked a charm, since installing the second module though, now all the items on the homepage are aligned to the left? Do you have a URL so that I can take a look and suggest you what it is ? Link to comment Share on other sites More sharing options...
vekia Posted December 4, 2013 Share Posted December 4, 2013 Ace worked a charm, since installing the second module though, now all the items on the homepage are aligned to the left? it is problably realted to css styles, url will be helpful in this case, exactly as ibndawood stated above Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 5, 2013 Author Share Posted December 5, 2013 http://www.zappies.com/testdir/zappies-download-13-11-13 Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 5, 2013 Author Share Posted December 5, 2013 (edited) I changed the CSS to have a 2 on the end of each #featured-products_block_center so that it is #featured-products_block_center2 This has partly fixed the issue, just now only the new module has everything off to the left and oddly shows 'view' in blue text, which was not there previously. I am guessing its getting confused with CSS being repeated? Which is odd, but easily fixable.. just trying to figure out which bit needs to change.. Oh also for some reason the first line of products now have no price, while the second line do but its lower down and in red? Edited December 5, 2013 by omgzhobbs (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 you have to remove this "view >" from .tpl file or with css styles, method you want to use depends only on you Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 5, 2013 Author Share Posted December 5, 2013 Removing View has brought back the first line of prices, however the prices are still red and the spacing of each product is all out.. cant figure out what could be doing this, just im guessing both modules being there are confusing the css/html in loading.. Link to comment Share on other sites More sharing options...
omgzhobbs Posted December 5, 2013 Author Share Posted December 5, 2013 Ok, I managed to fix it, basically needed to remove most of the CSS or change values to 0. Bit odd this one loads the CSS totally different than the other, even though they technically are both the same content in the files.. Link to comment Share on other sites More sharing options...
Recommended Posts