PrestaShop Forums: Alternative for getHomeCategories() - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Alternative for getHomeCategories()


Alternative for getHomeCategories()

#1 illutic

    PrestaShop Apprentice

  • 14 Jul 2008
  • Members
  • PipPip
  • 31 posts
  • Location:The Netherlands

Posted 16 July 2008 - 10:28 PM

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

  • 14 Jul 2008
  • Members
  • PipPip
  • 31 posts
  • Location:The Netherlands

Posted 17 July 2008 - 01:45 PM

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

  • 08 Apr 2008
  • Members
  • PipPipPip
  • 827 posts
  • Location:UK

Posted 17 July 2008 - 01:51 PM

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

  • 14 Jul 2008
  • Members
  • PipPip
  • 31 posts
  • Location:The Netherlands

Posted 17 July 2008 - 01:58 PM

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

  • 08 Apr 2008
  • Members
  • PipPipPip
  • 827 posts
  • Location:UK

Posted 17 July 2008 - 02:04 PM

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

  • 14 Jul 2008
  • Members
  • PipPip
  • 31 posts
  • Location:The Netherlands

Posted 17 July 2008 - 02:22 PM

Sent you a PM with all the data :)

#7 ejectcore

    PrestaShop Addict

  • 08 Apr 2008
  • Members
  • PipPipPip
  • 827 posts
  • Location:UK

Posted 17 July 2008 - 02:58 PM

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

  • 14 Jul 2008
  • Members
  • PipPip
  • 31 posts
  • Location:The Netherlands

Posted 17 July 2008 - 07:08 PM

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

  • 14 Jul 2008
  • Members
  • PipPip
  • 31 posts
  • Location:The Netherlands

Posted 18 July 2008 - 10:38 AM

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 ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users