Jump to content
jhnstcks

[Free Module] Homepage Categories Module

Recommended Posts

If the category has no image, then add one? I'm not sure why you would want this module if your categories don't have images set.

I'm not too sure about adding sub-categories as that would need some javascript or ajax coding.

Share this post


Link to post
Share on other sites

Hello, first of all, thanks for the module and all the work you've done.
I installed this last version correctly and I would like to display category description too.
I founded a version of this module that uses "{$category.description}" to call this info, but it doesn't work here.
Do you know if I should call anything else in the .php file?

<!-- MODULE Home categories -->
{if isset($categoryHome) AND $categoryHome}

{assign var='count' value=0} 
{foreach from=$categoryHome item=category name=homeCategories}       
   {assign var='count' value=$count+1}        
   {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)|escape:'htmlall':'UTF-8'}           
                    

getCatImageLink($category.link_rewrite, $category.id_image,'category-on-home')}" alt="{$category.name|escape:'htmlall':'UTF-8'}" />

{$category.name}

{$category.description}        

{/foreach}

{else}

{l s='No categories' mod='homecategories'}
{/if}
<!-- END MODULE Home categories -->



Thank you so much!

Share this post


Link to post
Share on other sites

Lo he instalado sin ningún problema en prestashop v1.4.

En /viajes/modules/homecategories.

 

Pero al intentar modificar el .css, no veo ningún cambio, no sé que estoy haciendo mal.

En las imágenes que adjunto os enseño como me aparece en el home, y en la siguiente imagen lo que intento integrar modificando el estilo.

 

Alguien me puede ayudar?

 

-------------------------------------------------------

I've installed without any problem prestashop v1.4.

In / travel / modules / homecategories.

 

But in trying to modify. Css, I see no change, I know I'm doing wrong.

The pictures attached you how I get on the home and in the next picture I'm trying to integrate changing the style.

 

Someone can help me?

post-279409-0-67093900-1313744950_thumb.jpg

post-279409-0-98307300-1313745089_thumb.jpg

Share this post


Link to post
Share on other sites

There is not a module that will do those buttons currently, however I cheated by just using HTML, Photoshop and the WContentMaker module I found on here to do this: see: www.dieselsurplusstore.com main page. See attached image and the module I used. Just transplant the module to the homepage content and move in the positions tab under modules.

 

The html is just the images side by side created equally in photoshop and saved as .png's

Each image just links to the catgory URL.. just click on the categories bar and copy the URL from that categories page to get each URL. Simple and gives you that control your looking for. I would keep the images very small or use a .png image compressor to keep the page loading time fast.

 

Good luck.

wcontentmaker.zip

post-89639-0-25365200-1313780194_thumb.jpg

Share this post


Link to post
Share on other sites

There is not a module that will do those buttons currently, however I cheated by just using HTML, Photoshop and the WContentMaker module I found on here to do this: see: www.dieselsurplusstore.com main page. See attached image and the module I used. Just transplant the module to the homepage content and move in the positions tab under modules.

 

The html is just the images side by side created equally in photoshop and saved as .png's

Each image just links to the catgory URL.. just click on the categories bar and copy the URL from that categories page to get each URL. Simple and gives you that control your looking for. I would keep the images very small or use a .png image compressor to keep the page loading time fast.

 

Good luck.

 

 

Actually with some css coding it would probably be possible to do that layout.

 

 

Share this post


Link to post
Share on other sites

Got to say i love this module :)

 

I did find one little problem though -- because the height is set in the CSS, and the pictures make it taller than that set height, any modules below the "home categories" box end up behind the box :(

 

 

To fix this, i made the following changes:

 

In the CSS file (homecategories.css), i change this:

 

div.home_categories{height:220px}

 

to this (added 1 new line):

 

div.home_categories{margin-bottom: 5px}
div.home_categories .cr{clear: both;border: 0px none}

 

 

And in the template file (homecategories.tpl)

 

Changed this...

 

   {/if}
</div>
<br /><br /><br />
<!-- /MODULE Home categories -->

 

To this...

 

 {/if}
   <div class="cr"></div>
</div>
<!-- /MODULE Home categories -->

 

 

This means no matter how big the pictures are, the box will just resize, and any modules below will just be pushed down.

Share this post


Link to post
Share on other sites

Just wanted to say thanks to

jhnstcks

 

for a great module. This should be included in all default installs as I'm sure others would find this module helpful.

Or maybe include it in the modules list for download. Took some time and searching to find this thread, but now I have it, well worth the time. Keep up the great work guys.

Share this post


Link to post
Share on other sites

Hello, first of all, thanks for the module and all the work you've done.

I installed this last version correctly and I would like to display category description too.

I founded a version of this module that uses "{$category.description}" to call this info, but it doesn't work here.

Do you know if I should call anything else in the .php file?

<!-- MODULE Home categories -->
{if isset($categoryHome) AND $categoryHome}

{assign var='count' value=0}
{foreach from=$categoryHome item=category name=homeCategories}	  
{assign var='count' value=$count+1}		
{assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)|escape:'htmlall':'UTF-8'}		  


[url="{$categoryLink}"]
	<img />getCatImageLink($category.link_rewrite, $category.id_image,'category-on-home')}" alt="{$category.name|escape:'htmlall':'UTF-8'}" />
[/url]

[b]	[url="{$categoryLink}"]{$category.name}[/url][/b]


{$category.description}		

{/foreach}

{else}
{l s='No categories' mod='homecategories'}

{/if}
<!-- END MODULE Home categories -->

 

Thank you so much!

 

Hi,

I'm not a programmer but I have modified the file "homecategories.php" to make it display the description of the categories.

You must add in the file "homecategories.tpl" this: {$category.description}

 

I hope that it works for you and invite developers to correct any problems in the code.

 

Sorry for my english :)

 

Greetings, Mastabrail

homecategories.php

Share this post


Link to post
Share on other sites

To add the category name to your homepage add

				
[b]	[url="{$categoryLink}"]{$category.name|truncate:35}[/url][/b]


 

into the tpl file. Change truncate:35 to whatever length yu need.

 

John - where at in the code do you put this? I tried it at the very end but i still cant see the category names. Is there somewhere specific in the tpl file this needs to go?

Share this post


Link to post
Share on other sites

 

John - where at in the code do you put this? I tried it at the very end but i still cant see the category names. Is there somewhere specific in the tpl file this needs to go?

 

This is a copy of my .tpl file

<!-- MODULE Home categories -->
<div class="home_categories">
   <h2>{l s='Shop by Brand' mod='homecategories'}</h2>
   {if isset($categories) AND $categories}
           <ul>
           {foreach from=$categories item=category name=homeCategories}
               {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}
               <li class="ajax_block_category {if $smarty.foreach.homeCategories.first}first_item{elseif $smarty.foreach.homeCategories.last}last_item{else}item{/if}">
               <div><a href="{$categoryLink}" title="{$category.legend}" class="category_image"><img src="{$img_cat_dir}{$category.id_category}-catsmall.jpg" alt="{$category.name}" title="{$category.name}" id="categoryImage"></a></div>
{$category.name}            
   </li>
           {/foreach}
           </ul>
   {else}
       <p>{l s='No categories' mod='homecategories'}</p>
       {/if}
   <div class="cr"></div>
</div>
<!-- /MODULE Home categories -->

Share this post


Link to post
Share on other sites

Hello, I am new to the forum, thank you for this module, it saves me a lot of time, i installed it and works like a charm in 1.4 version, but i have one question, is it possible to get the lower price inside one category? ex : in category ipod i would have the lowest price from it and display in frontpage category as : start at 25$ for example.

 

Thank you

Share this post


Link to post
Share on other sites

Hi, i'm trying the module and i can´t display more than one column on the home page. I´m not programmer and i am new user of prestashop, so, sorry for so simple questions.

Thanks.

Share this post


Link to post
Share on other sites

Hi, i'm trying the module and i can´t display more than one column on the home page. I´m not programmer and i am new user of prestashop, so, sorry for so simple questions.

Thanks.

 

You use what version of prestashop?

Share this post


Link to post
Share on other sites
I think it would take a complex script to search the database of products for that category and extract the lowest price and display it in this module
this script include already a query to get category, isn't there any query to get all product price from this category and filter the lowest price?

 

Share this post


Link to post
Share on other sites

It works like a charm, the only thing missing with it is the lower price, during install it creates automaticaly homecategories css forder inside themes/css/modules folder, just follow the readme files inside the module installation.

Share this post


Link to post
Share on other sites

I'm running it on 1.4.5 and haven't got any problems. http://www.snowboarding-goggles.co.uk/

 

Can you provide a link to your site?

Have you installed the files in the correct places. If the css file isn't in themes/css/modules/homecategories/ folder then it won't have any stylesheet to read from and will revert to default layout, which would be to list the categories down the page.

I don't know where was the problem. I installed again and it works perfect.

Thanks anyway.

Share this post


Link to post
Share on other sites

I'm running it on 1.4.5 and haven't got any problems. http://www.snowboarding-goggles.co.uk/

 

Can you provide a link to your site?

Have you installed the files in the correct places. If the css file isn't in themes/css/modules/homecategories/ folder then it won't have any stylesheet to read from and will revert to default layout, which would be to list the categories down the page.

 

How did you include the subcategories? i think i will use subcategories rather than "lower price" function that i don't find any solution.

Thank you

Share this post


Link to post
Share on other sites

 

Hi,

I'm not a programmer but I have modified the file "homecategories.php" to make it display the description of the categories.

You must add in the file "homecategories.tpl" this: {$category.description}

 

I hope that it works for you and invite developers to correct any problems in the code.

 

Sorry for my english :)

 

Greetings, Mastabrail

Thank you, it works for me, but you know how to get subcat list?

Share this post


Link to post
Share on other sites

Hi,

 

I installed this mod on latest presta shop version but CSS is not loading at all. Categories are displaying on front page but can't style it. Can someone please help me out with this.

 

Thank you.

Share this post


Link to post
Share on other sites
Ah, you're in right, otherwise you know how to include subcategories title in a category?, i want to list subcategories inside <li>subcat title</li> Thank you

 

Hello, did you solve this problem? Thx

Share this post


Link to post
Share on other sites

i just installed it and i doesnt work. images are not the good one and catégories are displayed with non sense.

i'm on 1.4.7.

also is it possible to choose wich catégories you want to be displayed.

i would like to show only sales, and opportunities.

thank you.

Share this post


Link to post
Share on other sites

I installed the module but on the homepage the module appears in the left hand column rather than across the entire page. In the back office positions it is under Homepage Content. What do i need to do to fix it so that the category images display across the entire page width?

 

Many thanks

Share this post


Link to post
Share on other sites

I tried deleting the Featured Products on Homepage module position from the Homepage Content and that fixed the problem. Transplanted the Featured Products on Homepage module back on to the Homepage Content and that fixed the problem.

 

Is that the best or only way to have fixed the problem?

Share this post


Link to post
Share on other sites

I've managed to change the image size and add the category title for each image, as per your instructions. How/where can I change the text (font, size colour etc).

 

Thank you for a great module

Share this post


Link to post
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

×