Quote Originally Posted by carlwhat View Post
joe,
i would like to stay on point, which goes back to post #5: you have updated on the admin side, but you cannot display it on the customer side. i then quoted 2 possibilities, which is you are either not modifying the correct template file or you are not getting the data correctly from the database.
I think the problem was a bit of both. I ran into a couple of problems with the database that I still don't fully understand being new to working with phpMyAdmin and databases. Not sure if I had to set a field as a primary, or index, or what that means exactly... but whatever I did got the edit, copy and delete options to appear next to the fields on the table I created like other tables in the DB appear. Then I had a table populating problem; discovered when I tried to add a new format field value. The database wouldn't accept an id value because it wasn't unique. And of course, I also had to populate some products with values for the new field so they could ultimately show in the store.

Then in the scripts, there was a lot of confusion. It took me a bit of time to realize that the the admin handles the store's back end, and the includes basically deal with the way the store looks (yes ZC 101 but I still wasn't there yet).
I used that print command you gave me above to verify I was working with the right template, and $products_format_name was the right variable. It wasn't mimicking the way the artist field was displaying values, but at least I now knew what code could produce the value I wanted and where it was getting placed. Experimenting with the code I knew was responsible for handling the artist field, and applying it to the format field ultimately worked. I apparently wasn't calling the values correctly, so they were either producing output I didn't want (like the "mess" I described earlier) or nothing at all. One attempt produced an all caps name from the DB next to the field value I wanted (so on the right track). I determined it was a confusion of using "media_format" vs. "format" in some of the values called in the script. The working combination was finally this in the tpl_product_music_info_display.php file:
Code:
<?php echo (($flag_show_product_music_info_media_format == 1 and !empty($products_format_name)) ? '<li>' . TEXT_PRODUCT_FORMAT . $products_format_name . '</li>' : '') . "\n"; 
?>
I had the same problem getting the Record Company field to appear (which is a field included in ZC but appears to be handled differently). The same process worked for that.
based on the information provided, $products_format_name is correctly populated, and can be used on the template page. your title and OP says you are having difficulty displaying new product field data on product pages. and yet your code suggests that by echoing that var, you can safely use that element, which would say "vinyl". have you tried using that variable on the product info page? is that the correct value for that variable for this product?
That comment and your two questions were a major help because I'm still developing a concept of how ZC works.

so you have incorrectly populated that table or incorrectly constructed the above sql statement.

in addition, the populating of the first table seems to be missing some fields as the date modified and date added have no values.
I think it was all of the above.

with regards to not modifying core ZC files, good luck with that! (said sarcastically....) as i have previously stated, i do not think what you are trying to do is easy.
Especially as a beginner's lesson!
and it is not handled easily in other shopping cart systems that provide overrides and field creation and the like.... my opinion previously stated is to put as much as possible in your own extra_functions file and then call needed functions, most likely from the template file to preserve as much of the ZC core as possible. and if you truly want to have an audit trail of what you are doing, i would put all source under a source version control system, ie git, so that you can see what you did. (mind you, learning git is a major job in and/of itself; but well worth the value in the long run...)
I've only had any real success with template overrides so far.
After straightening out the problem with calling the information to the page, the addition/correction of a configuration_title and configuration_key in the DB Table: product_type_layout fixed the problem I was having with layout controls (turning on /off).
I believe this mod has the full functionality I was looking for. I can enter the new field values when creating a new product. The field value shows up on the store page, handled the same way the artist field is, and is linkable/searchable. The Admin's layout controllers handle inclusion/exclusion as expected.

Thanks to you, mc12345678, and everyone else who offered suggestions in this and other threads. You really helped a beginner get through a brutal introductory lesson in modifying ZC.