Jump to content
jhnstcks

[Free Module] Homepage Categories Module

Recommended Posts

make sure that you've got image defined under the preferences > images tab in your back office

Share this post


Link to post
Share on other sites

Vekia - I know where to configure images in the back office but which image are you referring to?

Sorry for my ignorance

Bitmess

Share this post


Link to post
Share on other sites

you need to define / change image named "large"

if this image type doesnt exist on your list there, you have to define it.

Share this post


Link to post
Share on other sites

nope, "large_default" isn't the same. You have to define this image type (large) and then - regenerate thumbnails for this image type

  • Like 1

Share this post


Link to post
Share on other sites

nope, "large_default" isn't the same. You have to define this image type (large) and then - regenerate thumbnails for this image type

 

Perfect, You saved me again

Thank you!

Share this post


Link to post
Share on other sites

$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('

SELECT c.*, cl.*

FROM `'._DB_PREFIX_.'category` c

LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.')

LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)

WHERE level_depth > 1 And level_depth < 3

AND c.`active` = 1

AND cg.`id_group` = '.$id_group.'

ORDER BY `level_depth` ASC, c.`position` ASC');

 

change c.`position` ASC to cl.`name` ASC

  • Like 1

Share this post


Link to post
Share on other sites

hi

i wanted to change medium image to large.

i changed homecategories.tpl but not work.

after that i delete all line in homecategories.tpl file and see that it worked i think that it must not work.

please help me to change medium image.

???????

Share this post


Link to post
Share on other sites

can you show what you changed exactly and why "it doesnt work?" you've got some error messages? 

Share this post


Link to post
Share on other sites

A LOT..

 

of people can find their solution if they have will to read and understand, not only wait for someone to help them. Instead of posting same questions again and again, read this: http://www.prestashop.com/forums/topic/121735-free-module-homepage-categories-module/?view=findpost&p=1158460

Hi Vankata,

 

Thanks for your solution. Could you please share the end result?

 

Thanks

Share this post


Link to post
Share on other sites

 

 

hook not work in backend

can you shed some more light on this please? what you exactly mean by "hook not work in backend" ?

Share this post


Link to post
Share on other sites

Hi, i've got a problem with order of the category images. I want them to be sorted by ID (or position in Prestashop categories section) of category (ascending). Everything is fine except for that first three categories are in the last row. How can i fix it? Here is a link to my website: http://ekomiejsce.com/

 

And homecategories.php :

 

  SELECT c.*, cl.*
  FROM `'._DB_PREFIX_.'category` c
  LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.')
  LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)
  WHERE level_depth > 1 And level_depth < 3
  AND c.`active` = 1
  AND cg.`id_group` = '.$id_group.'
  ORDER BY `level_depth` ASC, c.`position` ASC');

 

Anyone has an idea how to fix it?

Regards

Edited by ekomiejsce (see edit history)

Share this post


Link to post
Share on other sites

Hi

 

Have installed and edited module and all works well with one exception.

 

I have 2 rows of 4 columns and want to increase the spacing between the rows, anyone have any suggestions?

 

Thanks

Share this post


Link to post
Share on other sites

Hi

 

Have installed and edited module and all works well with one exception.

 

I have 2 rows of 4 columns and want to increase the spacing between the rows, anyone have any suggestions?

 

Thanks

if your website is online - please share url

it will be helpfull in this case due to the fact that this is related to css styles.

Share this post


Link to post
Share on other sites

in module directory you've got homeceategories.css file

 

there is a code:

div.home_categories li {
float: left;
position: relative;
width: 240px;
}

you can add there padding param, then you will increase spacing

  • Like 1

Share this post


Link to post
Share on other sites

you can use this simple code:
 

.ajax_block_category a {margin-top:10px!important; display:block;}

where the margin-top:10px; is a value of spacing

  • Like 1

Share this post


Link to post
Share on other sites

Hello

 

I installed the module on my shop www.tabakado.net

 

unfortunately, I get all categories doubled. I think the problem comes from the multishop function that is activated (I have 2 shops)

 

How can I define the Shop ID in the php code ?

 

Thank you for your help and Happy Christmas to all !

  • Like 1

Share this post


Link to post
Share on other sites

After installing the free module homecategories ( which i highly recommend as a great module) is it possible to have a different picture on the actual category page than is displayed on the home page?


 


Home page


http://fotograaf-noord-brabant.com/


 


Wanting to display a different picture at top of this page


http://fotograaf-noo...en/9-huisdieren


 


Thanks


Share this post


Link to post
Share on other sites

this module displays category cover image, the same file as you uploaded in category definition page in back office.

unfortunately, there is no feature to upload different picture.

 

you can modify category.tpl file (remove there code for display image)

and in category edit page you can add picture in description. it will appear on page you mentioned

IkC8QHb.png

Share this post


Link to post
Share on other sites

I have updated this module so that you dont need to alter any core modules and have also added CCC compatibility for prestashop v1.4.

 

There is now a css file that contains all the formatting for the module.

 

Images are currently set to display at 100px x 100px, but that is easily changeable by altering the css at lines 3,4 + 6.

 

Also if any wants to provide translations, send them to me or post them here and i will update the module.

 

Module updated v1.2 - Uploadable through the modules import on back-office. Category titles added. Css included in the module folder and NOT in themes/css/module/homecategories folder. Positioning improved (thanks to @itsallgood )

 

Module updated v.1.3 - Compatible with Prestashop v1.5.*

 

Note: You will need to uninstall the old module first and then upload the new module and reinstall it to update the module on your server.

 

attachicon.gifhomecategories for v1.4.zip

attachicon.gifhomecategories for v1.5.zip

For better ordering (if you make your ordering in 1.5.6, than you need my modification) please use this select in file "homecategories.php":

  $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
    SELECT c.*, cl.*
    FROM `'._DB_PREFIX_.'category` c
    LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.')
    LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)
    LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category`)
    WHERE level_depth > 1 And level_depth < 3
    AND c.`active` = 1
    AND cg.`id_group` = '.$id_group.'
    ORDER BY `level_depth` ASC, cs.`position` ASC');
  • Like 1

Share this post


Link to post
Share on other sites

and how it is related to homepge categories module?

Share this post


Link to post
Share on other sites

Hi

 

Is it possible to hide a specific category from the module whilst still displaying in top menu?

 

Pete

Share this post


Link to post
Share on other sites

Anyone able to help? :rolleyes:

 
            {foreach from=$categories item=category name=homeCategories}
		{if $category.id_category != 32}
                	{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}-large_default.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a>
				</div>
                		<a href="{$categoryLink}" title="{$category.legend}">{$category.name|truncate:35}</a>
                	</li>
		{/if}
            {/foreach}

Hi Pete,

 

Add the highlighted lines to homecategories.tpl. Replace 32 with the category's ID you don't want to appear.

 

Sorry, code doesn't highlight, it's the 2nd and the last but one line, with the IF.

Edited by hzolika (see edit history)

Share this post


Link to post
Share on other sites

This module is avalaible for PS 1.5.6.1 ?

 

Best regards!

 

Yes, it works fine on 1.5.6.1

Share this post


Link to post
Share on other sites

increase width of div.home_categories li element (to width:123px;)

  • Like 1

Share this post


Link to post
Share on other sites

increase width of div.home_categories li element (to width:123px;)

thank you wary mutch!) im chenge different sizes, bat not 123 px) how do you calculate it?

Share this post


Link to post
Share on other sites

Hi! Sorry, i'm learning english.

 

I installed the module., But does not show categories.

Once, I installed it and it worked fine, but then uninstalled it. Today I installed it but it says: No Categories.
 

Note: I have not made any changes to module's code

Share this post


Link to post
Share on other sites

maybe it's related to some caching problems, try to clear cache in your shop (adv. paramters > performance tab)

Share this post


Link to post
Share on other sites

Thanks for your reply Vekia,
Ready, I cleared the cache (adv. paramters > performance tab), but now disappeared categories = O

Now I can not create categories. Disappeared in the category tree, I can not see the category Home.

 

Attach a image.cat.jpg

 

PLEASE!!!! HELP ME!

Share this post


Link to post
Share on other sites

it's definitely not default behaviour in prestashop.

have you changed something in catalog categories tree?

also, when you click on [+] do you see subcategories?

Share this post


Link to post
Share on other sites

Thanks for your reply, again.

 

 
. 1 - I have not changed anything in the categories tree.
  2.- when I click on (+) I can't see categories.
 
This occurred when I cleaned the cache

Share this post


Link to post
Share on other sites

more than strange.

you've got cache ON? if so, try to disable it and also turn on force compile under adv. paramters > performance tab in your bo

Share this post


Link to post
Share on other sites

Hey Vekia,

 

After disabling the cache, force compilation, and sleep 8 hours xD, I can create categories. But not displayed in BO. However, in FO I can see the category created, in the module Home Categories too.

 

When I want to create a category, I can see categories tree:

Example:

 

- Home

      |- Category 1

 

But, not displayed in BO. What can I do?

Share this post


Link to post
Share on other sites

Hi,

 

Now, I'm re-creating the categories tree. Homecategories Module is working fine, but in landing page, show an error:

 

Warning: Function addCSS() is deprecated in /home/xxxx/public_html/store/modules/homecategories/homecategories.php on line 34
in /home/xxxx/public_html/store/classes/Tools.php on line 2137

 

Somebody help me?

Share this post


Link to post
Share on other sites

Hi,

 

Now, I'm re-creating the categories tree. Homecategories Module is working fine, but in landing page, show an error:

 

Warning: Function addCSS() is deprecated in /home/xxxx/public_html/store/modules/homecategories/homecategories.php on line 34

in /home/xxxx/public_html/store/classes/Tools.php on line 2137

 

Somebody help me?

 

 

this is only internal prestashop message, it doesn't cause any "crash" problems, 

turn off error reporting, and this message will disappear

 

this message means that your module isn't fully compatibile with 1.5 version (it just uses old method to include css files) but in fact, old method also works in 1.5.

Share this post


Link to post
Share on other sites

Hi, i have a problem with the module, the images of the categories are smaller than they had to be and i want to hide the category name, is this possible? Thanks!

Share this post


Link to post
Share on other sites

Hi,

 

 I faced with a problem. I have installed this module, but as I create a category and upload an image it doesnt show any images on the homepage. 

 

It should show these categories images, but instead it shows like this (what could be the problem?) :

 

aaaaa.jpg

Share this post


Link to post
Share on other sites

 

Hi,

 

 I faced with a problem. I have installed this module, but as I create a category and upload an image it doesnt show any images on the homepage. 

 

It should show these categories images, but instead it shows like this (what could be the problem?) :

 

Hi, Sorry for my english.

 

This issue happens because homecategories.tpl refers to incorrect image category folder. Please check this:

in .../modules/homecategories/homecategories.tpl

<!-- MODULE Home categories -->
<div class="home_categories">
    <h2>{l s='Categories' 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}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>
                <a href="{$categoryLink}" title="{$category.legend}">{$category.name|truncate:35}</a>

                </li>
            {/foreach}
            </ul>
    {else}
        <p>{l s='No categories' mod='homecategories'}</p>
  {/if}
    <div class="cr"></div>
</div>
<!-- /MODULE Home categories -->

Around, line 9:

                <div><a href="{$categoryLink}" title="{$category.legend}" class="category_image"><img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>

 

This line refers image category.

In my case, I changed this:

{$category.id_category}-large.jpg    -------> {$category.id_category}.jpg

 
I just eliminated -large.jpg
 

Try it! I hope that you could understand me.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, Sorry for my english.

 

This issue happens because homecategories.tpl refers to incorrect image category folder. Please check this:

in .../modules/homecategories/homecategories.tpl

<!-- MODULE Home categories -->
<div class="home_categories">
    <h2>{l s='Categories' 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}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>
                <a href="{$categoryLink}" title="{$category.legend}">{$category.name|truncate:35}</a>

                </li>
            {/foreach}
            </ul>
    {else}
        <p>{l s='No categories' mod='homecategories'}</p>
  {/if}
    <div class="cr"></div>
</div>
<!-- /MODULE Home categories -->

Around, line 9:

                <div><a href="{$categoryLink}" title="{$category.legend}" class="category_image"><img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>

 

This line refers image category.

In my case, I changed this:

{$category.id_category}-large.jpg    -------> {$category.id_category}.jpg

 
I just eliminated -large.jpg
 

Try it! I hope that you could understand me.

 

It helped. Now everything works properly, thanks ;)

Share this post


Link to post
Share on other sites

Can someone help me?

i have a problem with the module, the images of the categories are smaller than they had to be and i want to hide the category name, is this possible? Thanks!

Share this post


Link to post
Share on other sites

Hey Revy94,

 

1.- Can you attach a screenshot of the module? or show the url of your store.

2.- Do you want hide the categorie's name and show only categorie's image?

Share this post


Link to post
Share on other sites

Hey Revy,

 

I'm sorry for late answer

 

1.- To change image size, set values in css file.

div.home_categories img{width:100px;height:100px}
div.home_categories li{float:left;margin:5px;width:100px;height:130px;}
div.home_categories h5 a:hover{text-decoration:underline;color:#444}
div.home_categories div{width:100px;border:1px outset black}

2.- To show pictures and hide names, try it:

 

In homecategories.tpl delete next line:

<a href="{$categoryLink}" title="{$category.legend}">{$category.name|truncate:35}</a>

Try it!

Edited by Epuyao (see edit history)

Share this post


Link to post
Share on other sites

Great module. Works perfectly.

But (there's always a 'but') what if I have too many categories and wish to implement some sort of Ajax pagination?

Would that be possible?

Share this post


Link to post
Share on other sites

hi i have a problem

 

get duplicated categories

 

 

To solve the duplicate categories showing up in multi-shop configurations, modify in /modules/homecategories/homecategories.php:

 

Replace

function hookHome($params)
{
  global $smarty, $cookie, $link;
 
  $id_customer = (int)$params['cookie']->id_customer;
  $id_group = $id_customer ? Customer::getDefaultGroupId($id_customer) : _PS_DEFAULT_CUSTOMER_GROUP_;
  $id_lang = (int)$params['cookie']->id_lang;
  $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
  SELECT c.*, cl.*
  FROM `'._DB_PREFIX_.'category` c
  LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.')
  LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)
  WHERE level_depth > 1 And level_depth < 3
  AND c.`active` = 1
  AND cg.`id_group` = '.$id_group.'

With 

function hookHome($params)
{
  global $smarty, $cookie, $link;
 
  $shop_id = (int)$this->context->shop->id;
  $id_customer = (int)$params['cookie']->id_customer;
  $id_group = $id_customer ? Customer::getDefaultGroupId($id_customer) : _PS_DEFAULT_CUSTOMER_GROUP_;
  $id_lang = (int)$params['cookie']->id_lang;
  $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
  SELECT c.*, cl.*
  FROM `'._DB_PREFIX_.'category` c
  LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.')
  LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)
  WHERE level_depth > 1 And level_depth < 3
  AND c.`active` = 1
  AND cg.`id_group` = '.$id_group.'
  AND cl.`id_shop` = '.$shop_id.'

  • Like 3

Share this post


Link to post
Share on other sites

Hi, firstly thanks for a great module and its free too ! I'm a newbie to prestashop and sorry for probably overlooking the answer in the umpteen pages beforehand but I just dont understand it. I am using 1.5.4 but the images come out as question marks on the home page but display correctly on the next page after selection. Here is my url 

http://xtended.co.uk

 Click on the amor capelli category and you will see the image displays ok, I just want the same image on the home page. I know I'm probably doing something wrong. Please help. Thanks again for your patience. Colin

Share this post


Link to post
Share on other sites

Hi!

 

Uhhmmmm.....Please, can you paste the code of homecategories.tpl here?

Share this post


Link to post
Share on other sites

Hi, took me a while to find the .tpl file, I did say I was a newbie lol. Here it is :

 

<!-- MODULE Home categories -->
<div class="home_categories">
    <h2>{l s='Categories' 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}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>
                <a href="{$categoryLink}" title="{$category.legend}">{$category.name|truncate:35}</a>

                </li>
            {/foreach}
            </ul>
    {else}
        <p>{l s='No categories' mod='homecategories'}</p>
  {/if}
    <div class="cr"></div>
</div>
<!-- /MODULE Home categories -->

 

Thanks for assisting. Colin

Share this post


Link to post
Share on other sites

Hey colin,

Try it,

<!-- MODULE Home categories -->
<div class="home_categories">
    <h2>{l s='Categories' 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}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>
                <a href="{$categoryLink}" title="{$category.legend}">{$category.name|truncate:35}</a>

                </li>
            {/foreach}
            </ul>
    {else}
        <p>{l s='No categories' mod='homecategories'}</p>
  {/if}
    <div class="cr"></div>
</div>
<!-- /MODULE Home categories -->

Around, line 9:

                <div><a href="{$categoryLink}" title="{$category.legend}" class="category_image"><img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>

 

This line refers image category.

In my case, I changed this:

{$category.id_category}-large.jpg    -------> {$category.id_category}.jpg

 
I just eliminated -large.jpg
 
Try it!!!
  • Like 1

Share this post


Link to post
Share on other sites

Hiya Epuyao

 

Thanks for the swift response. It worked perfectly. Thank you so much for your help. Its much appreciated. Kind Regards Colin

Share this post


Link to post
Share on other sites

I have three more queries and then I'm done I think - sorry but I'm new to this but learning fast !

1. I want to change the category titles to capitals. Where do I change that and what do I change?

2. I want to change the text colour from the default grey to another colour. How do I do that please?

3. The category titles are too close underneath the image. How can I increase the gap between them?

Thanks for your help as always. Kind regards Colin

Share this post


Link to post
Share on other sites

I have three more queries and then I'm done I think - sorry but I'm new to this but learning fast !

1. I want to change the category titles to capitals. Where do I change that and what do I change?

2. I want to change the text colour from the default grey to another colour. How do I do that please?

3. The category titles are too close underneath the image. How can I increase the gap between them?

Thanks for your help as always. Kind regards Colin

 

Hi,

 

here are the answers to your questions:

 

First of all, look for the global.css file of your theme.

 

1. Search for the line responsible for adjusting the links and add "text-transform:uppercase;";

2. On the same line you should see that it sets the color, changing that info it should alter the title color;

3. Open the file homecategories.css and search for the line 6. Over there you can add a "margin-bottom:5px;" and it should be enough;

 

Hope it helps.

Share this post


Link to post
Share on other sites

Hi mfsilva,

 

Many thanks for your help. Took me a while to do it but its working well. Thanks again  :) 

Share this post


Link to post
Share on other sites

Hi All,

 

I have been using this module on 1.5 but I need to build a 1.6 shop.. anyone know is this will work? It install ok but it doesn't display right.. it overlaps with other modules below it. 

Share this post


Link to post
Share on other sites

Hi , thanks for good module, I wan to have categories in home page with picture, and when you click one category you see subcategories with pictures, if it's possible how to translate in persian.

Share this post


Link to post
Share on other sites

Hi everybody!

First of all, thanks for a good module. :)

I've used this module with 1.5.x versions, and it's great, but at 1.6 everything works, except images.

I think that there might be some kind of a problem with code, but I don't know where it can be. :(

Please help!

 

I think this line of code need to be edited, it's around line 18 in homecategories.tpl:

<div><a href="{$categoryLink}" title="{$category.legend}" class="categoryImage"><img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>

basically I think that we should change this:

<img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />

to smth like this (I found this in category.tpl from 1.6):

url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) 0 bottom no-repeat; background-size:contain; min-height:{$categorySize.height}px;

It's around line 48, here's the full part:

<!-- Category image -->
                    <div class="content_scene_cat_bg" {if $category->id_image}style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) 0 bottom no-repeat; background-size:contain; min-height:{$categorySize.height}px;" {/if}>

I tried to do it in a few ways, but it's not working. I'm not really understand what I'm doing, so...

Any help would be hugely appreciated!  :)

Edited by 1RONMAN© (see edit history)

Share this post


Link to post
Share on other sites

Update for my last post. I've found that when I use this code:

<div><a href="{$categoryLink}" title="{$category.legend}" class="categoryImage"><img src="{$link->getCatImageLink($category->id_image, 'category_default')|escape:'html':'UTF-8'}" /></a></div>

Images are not shown, but I found one thing, chrome dev tools show error 404 for images and link look like this:

../yoursite/img/c/category_default.jpg

 

 

But it should look like this:

../yoursite/c/12-category_default/category_name.jpg

 

Don't know what to do. I'm just a noob in Prestashop development..)) But maybe it'll be helpful for those who know how it works and what to do..)

Edited by 1RONMAN© (see edit history)

Share this post


Link to post
Share on other sites

Hello,

 

I'm using prestashop 1.5.6.2 and I tried to install this interesting module. However, I get a repetition of these errors. I use a purchased template, but this can not cause the error I suppose. My site is not online yet but on localhost. I have cleared the cache repeatedly, both in back end as manually bu deleting the files in the cache folder. But this does not help.

Is there somebody who could help me out?

Thanks

Vicef

 

Errors:

Undefined index: legend in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 54PHP Notice:  Undefined index: categorySize in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 59PHP Notice:  Trying to get property of non-object in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 59PHP Notice:  Undefined index: categorySize in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 60PHP Notice:  Trying to get property of non-object in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 60PHP Notice:  Undefined index: legend in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 63PHP Notice:  Undefined index: legend in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 54PHP Notice:  Undefined index: categorySize in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 59PHP Notice:  Trying to get property of non-object in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 59PHP Notice:  Undefined index: categorySize in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 60PHP Notice:  Trying to get property of non-object in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 60PHP Notice:  Undefined index: legend in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 63PHP Notice:  Undefined index: legend in C:\inetpub\wwwroot\loulechien_ps\cache\smarty\compile\c2\a7\e6\c2a7e69bc817dafa48ae092c28aa454559e913d9.file.homecategories.tpl.php on line 54

Share this post


Link to post
Share on other sites

Hi,

 

I'm looking for home categories to prestashop v1.6. If You have, could You attach here ?

  • Like 1

Share this post


Link to post
Share on other sites

Hello folks

 

If you are still having a problem with images. Download the attached tpl and upload it into the homecategories folder & your pictures will work.

HERE

Edited by Rich Walker (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Sure

 

open the tpl file and look at line 9. 

 

<a href="{$categoryLink}" title="{$category.legend}" class="category_image"><img src="{$img_cat_dir}{$category.id_category}-medium_default.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a>

 

Swap the code that is in bold above to the image name ( you can find this under Preferences - > Images )

 

Make sure you have Categories enable for that name. If you have it will work. If it doesn't, enable it and then hit Regenerate Thumbnails.

 

Shout if you need anything else  :)

  • Like 1

Share this post


Link to post
Share on other sites

Hello. First let me say thank you for your module - HOMEPAGE CATEGORIES.

I instaled this module in PrestaShop™ 1.6.0.6 .

But the images from CATEGORIES doesn't show, is there something in the homecategories.tpl that I need to change to be compatible.

 

You can view a preview here:http://cloudsidea-design.com/fbi-store/index.php.

 

Thank you.

Cloudsidea

Share this post


Link to post
Share on other sites