Listing all categories automatically in Zen Cart

Using this free module for Zen Cart (Categories Center Box), I wanted to be able to automatically pick up every category I have without having to type in every single one. So, here is a very simple solution for this – I present to you, automatically load up every category you have. To incorporate, you have to modify the following file: /includes/modules/category_center_box.php. After “$top_array = array();”, you can add the following mod:

if(array_values($allowed_categories[0]) == "") {
 foreach($categories_array as $category_array) {
   array_push($allowed_categories, $category_array['id']);
 }
}

 And that’s it! On your front-end, simply leave the “Categories CenterBox List” as blank, and you should be good to go.


Leave a Reply

Your email address will not be published. Required fields are marked *

*

4,455 Spam Comments Blocked so far by Spam Free Wordpress

HTML tags are not allowed.

*

pulanco-rwn@mailxu.com