Asking about variables:
A couple months ago, I began using an includes statement to incorporate boilerplate into my product descriptions. I first began using the statement (incorporated into my tpl_product_info_display.php file) with boilerplate specific to individual manufacturers, so I used the manufacturers_name db field to specify the exact boilerplate that should be loaded, thus:
So far this has worked well: If there's a boilerplate file, the server configures it into the product description; if not, the server just ignores this line of code and proceeds merrily along.Code:<?php include ('includes/partners/' . $manufacturers_name . '/' . $manufacturers_name . '-boilerplate.php'); ?>
Now, I've come to realize that I could use the same approach to great advantage for boilerplate related to specific categories rather than specific manufacturers, so I tried adding this line of code to my product info display:
It doesn't work, though, I strongly suspect because I haven't properly defined the $categories_id variable. (When I inserted the code for manufacturer boilerplate, I assume that — just by dumb luck — I chose a variable that had already been defined.) I've muddled about for a couple weeks trying to get the second line of code (for categories boilerplate) to work, so far with no luck. I have tried instead using category names as the file variable, as I noticed that the functions_lookups.php included a zen_get_categories_name function, but with no better luck.Code:<?php include ('includes/partners/' . $manufacturers_name . '/' . $categories_id . '-boilerplate.php'); ?>
If there's a guide for managing this variable definition task, and someone could point me to it, I would be grateful. If on the other hand this is a customization task that really needs to be handled by a professional programmer, I would appreciate knowing that as well. Sometimes it's not clear when I should recognize that a programming task is beyond me.
Thanks,
Ken Baker


Reply With Quote
