Jump to content

[FREE MODULE] Responsive Category Blocks in homepage


Recommended Posts

Hello everyone,

 

I am learning creating Prestashop modules and I made this module in my free time. Feel free to use or share it. If you find any bugs or you think you have a good idea how to improve the module you can type it here. Also you can find instructions in attached PDF on how to use the module.

Module attaches selected categories as a block in homepage. You can specify which categories you want to show and it shows the first 6 products in the category. For each category block you can specify accent color and upload a custom image.

 

Important! Tested only on version 1.7.6.7

 

Here are some marketing goodies I made :) 

box-png.thumb.png.2608dd6591035521ce1e23a40b1809a3.pngad-2.thumb.jpg.585b262873a0bc1f1cd29c76f89e41b7.jpgad-3.thumb.jpg.51927eb3f783208339f30f10f8a89b7e.jpgad-4.thumb.jpg.19e406e16676d0b9fb34feb55fa7347c.jpgad-5.thumb.jpg.a19bfd15ec7d175222cc5256a67cac21.jpgad-6.thumb.jpg.c45b85ba48860ccb296c39172f03a64d.jpg

 

Enjoy!

 

mslt_cblocks.zip

instructions.pdf

Edited by MSLT
Changed description (see edit history)
  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Hi,

 

Looks very promising. I havent tested it yet but based in your description quick question. Why only 6 products per category? Wouldn't it better to specify how much products you want to show per each category. Having some input per category would be better i think.

Also how about default prestashop categories like: new, sale... would be cool to have them there too...

 

Thanks

Share this post


Link to post
Share on other sites
15 minutes ago, Verlonimo said:

Hi,

 

Looks very promising. I havent tested it yet but based in your description quick question. Why only 6 products per category? Wouldn't it better to specify how much products you want to show per each category. Having some input per category would be better i think.

Also how about default prestashop categories like: new, sale... would be cool to have them there too...

 

Thanks

Hi, 

 

I chose 6 products specifically to fit the block design I made. I migt add an option to specify number of products to be displayed when I have more free time.

Thanks for the suggestion.

  • Like 1

Share this post


Link to post
Share on other sites

Hi MSLT, I just found your module after specifically searching for one

to display categories on my main page.  It installs easily and is very

easy to configure.

Can I ask for/suggest a few adjustment/additions please.

1. When the category only has 2 products it is still showing the gap for the 2nd row, can this be

changed so it is an option please.

2. Although I like the idea of the image on the right of each category, is it possible to have

an option to disable it please, I could edit your html but I know it would be better to have

it disabled from within your module configuration.

 

Thank you for providing a great categories module, I recommend it to anyone who is looking to place their categories

at the main front end of their store.

All the best.

Paul

Share this post


Link to post
Share on other sites
  • 3 months later...

Hi MSLT,

nice modul, thanks for it!

Found a small bug: In case of multilanguage it shows the category names of all languages separated by comma.

Have a small hint?

Greetz,

Prestachio

 

Share this post


Link to post
Share on other sites

I found a solution by adjusting file modules/mslt_cblocks/views/templates/hook/cblocks.tpl:

Somewhere before the first loop I added:

{$lang = (int)Context::getContext()->language->id}

Then I replaced:

<h1 style="color:{$c.category_color}" class="megamenu-category-name">{$c.category_name}</h1>

with the following:

{$catnames = explode(',', $c.category_name)}
{$catname = $catnames[$lang-1]}
<h1 style="color:{$c.category_color}" class="megamenu-category-name">{$catname}</h1>

 

That is working fine, however I doubt that this is the normal approach..

I struggled to get the localized name or category id of $c and spent hours on searching for it...... does someone know how to do that?

 

I'm using ps 1.7.6.9 and it's great :D

Share this post


Link to post
Share on other sites
  • 2 months later...

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

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More