PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

Alternative for getHomeCategories()

8 replies to this topic
#1
illutic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 31 posts
I'm trying to make a somewhat similar module as homefeatured2 (the homefeatured with random display).
In my module I at first wanted to display a number of products (as set in the BO) randomly, from all categories.
I couldn't get that to work, so I changed it into selecting the category in the BO and display random products from that categorie.. Now I can't get that to work either..
Seems the getHomeCategories() function (blockcategories.php is referring to it too) doesn't return anything.. All I get is an empty array..

Could someone point me in the right direction (on which function to use)? For either the first or second 'solution' (preferably both, so I can make a combination of 'em ;) ).

#2
illutic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 31 posts
Okay, no matter which category function I try to use, I only end up getting an empty array...?? Does anyone know why and how to solve it?

#3
ejectcore

    PrestaShop Addict

  • Members
  • PipPipPip
  • 827 posts
I'm not quite sure what you are asking.

Are you trying to create a module for featured products in a specific category
when I can understand more about your request I can then help you come up with a solution ;-)
Filter Search 2.1 Enterprise Edition Now Available

Available Soon
Filter Search 2.1 Lite Edition

Follow us on twitter

#4
illutic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 31 posts
Currently the featured products block is only showing products from the HOME category.
Since I don't want to place any products in the Home category itself, I want it to work just like it does now, but extract the products from all categories.
Preferably random products from all categories, but I'd also settle for random products from a selected category in the Back Office.

So, instead of showing products from the HOME category, show random products from ALL categories, or show products from a selected category in the BO.

I'm stuck at making a selection-list in the BO for the categories, since I'm only getting an empty array.

Hope this is more understandable ;) (I know I can rattle from time to time ;) :P)

#5
ejectcore

    PrestaShop Addict

  • Members
  • PipPipPip
  • 827 posts
OK Please upload progress if you are working offline, I would then require your to PM FTP & Back office details.
then I will take a look to see what you are doing wrong.

It would be useful to comment the code changed within your source first that way I will know where you are upto
Filter Search 2.1 Enterprise Edition Now Available

Available Soon
Filter Search 2.1 Lite Edition

Follow us on twitter

#6
illutic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 31 posts
Sent you a PM with all the data :)

#7
ejectcore

    PrestaShop Addict

  • Members
  • PipPipPip
  • 827 posts
Give me 15mins then I will take a look ;-)
Filter Search 2.1 Enterprise Edition Now Available

Available Soon
Filter Search 2.1 Lite Edition

Follow us on twitter

#8
illutic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 31 posts
Ok.. I am not amused...
For some reason the testing with getting to view the categories, almost all categories are blank now.. Title and description only show -- (most of the products too, thank god I only had a few for testing purposes..).
No wonder I was only getting blank arrays.. the categories all lost their titles and stuff..

Back to square one I guess..

#9
illutic

    PrestaShop Apprentice

  • Members
  • PipPip
  • 31 posts
Apparently I was being blond again.. ;) (I ám blond, so I have permission to say such things :P)
I added the English language yesterday so you could at least understand the backoffice. Because I changed the language of the BO to English, the names were empty by default, but ofcourse only for the English language (just found that out ;)).
So, problem 's nowhere near being solved as I want to, but I have a solution for the meantime: enter the id for the category manually. And that does work ;)