I am just wondering, there are many parts of the template where a list of products is used. This includes the home modules, category page, search results, etc. Is there any downside to moving the loop of code that calls and lists the products to its own .php page, and just using an include on any template file that needs a product list?
I'm mostly asking because the same exact loop is used for all of those pages, however if you want to fix the presentation of how the list looks, you would have to edit EVERY one of those pages. Simply editing one page, for example product_list.php, would be a lot easier.
I'm not asking how to do it, as I've already done it to test it out and make sure it works. I'm more so asking if there is any reason not to, and if anyone more skilled in PHP could weigh in with their own opinion.
Excellent! But for now though, if I dump all of my product list code into product_list.php and just do a
I should be good to go? I'm not sure if theres a wrong way to do it; but thought I'd get some advice first :S
Code: Select all
<?php include('product_list.php'); ?>
Who is online
Users browsing this forum: No registered users and 30 guests