Hello all PHP/Zen Cart gurus,
My client wants the category description to display only on the first page of any group of products that has more than one page. Subsequent pages should only list the products from that category.
I have done extensive searching of the forum and discovered that this functionality cannot be set from within the ZC admin and will require custom PHP coding by overriding the tpl_index_product_list.php file.
While my PHP skills are not great, I believe I understand the logic that will need to be set up for this to work properly but I am unsure how I might set the script to trigger only on pages that number greater than 1.
I think that if I wrap the $current_categories_description variable in a conditional statement that will identify the current page as greater than or equal to 2, I can get it to display on just the first product listing page of each category and no other.
What I need help with is how to determine the condition I have specified. I believe that this can be accomplished with something like the following:
Code:
if (page_count_variable >=2) {echo $current_categories_description;}
I have already successfully tested a similar script to see if this will work by testing a specific category number (to the exclusion of others) against the the $current_category_id variable but have not been able to figure out a straightforward way to capture current page number. The answer seems to be dependent on the number of products to be displayed on each page and displays only in the URL which is a string of several parameters. I would like the script to recognize any changes to the number of displayed products as specified in the admin.
Any help would be greatly appreciated. I will post the solution as a "How to" in the downloads as this will help others who have searched for this feature.
Thanks,
cpk
Bookmarks