
Originally Posted by
carlwhat
lets see:
- you have added fields/tables into the database
- you are able to update them on the admin side
- you are now having difficulty displaying them on the product info page
does that accurately describe your current situation?
if so, you have a couple of areas to look at to resolve this problem:
- are you sure you are editing the correct template file (tpl_product_music_info_display.php)? you can add a constant into that file to see if it displays when you test. i'm sure you can figure that out. its very easy to be updating the wrong file.
- if you are editing the correct template file, you then have to ensure that you correctly retrieved the data from the database. you can do that by adding:
Code:
print_r($format);
print_r($format_info);
if you can see the data on the page from the print_r command you should be able to then display the fields. if you can not see the data, you will have to go back and look at where you constructed those db objects and correct them.
best.
I do have the Table: media_format in the database, and I can write to it. Though it doesn't appear to have the Edit Copy Delete options in front of each row like other tables do. Still, I can edit them through Admin>Extras>Media Format, and I can media format values into individual products through the product creation page.
My override was not set up well and I did not see it in my Admin>Tools>Template Selection. I fixed that and now see the select option in my admin and have it set to that. Prior to that tpl_product_music_info_display.php in the template default was handling the page. After adding the print commands
Code:
print_r($format);
print_r($format_info);
I get a real mess that looks like this (I've deleted anything that looks like specific server information):
queryFactoryResult Object ( [EOF] => [cursor] => 0 [fields] => Array ( [format_id] => 4 [format_name] => 7" vinyl [format_image] => [date_added] => [last_modified] => ) [is_cached] => [result] => Array ( ) [result_random] => [limit] => [resource] => mysqli_result Object ( [current_field] => 0 [field_count] => 5 [lengths] => Array ( [0] => 1 [1] => 8 [2] => 0 [3] => 0 [4] => 0 ) [num_rows] => 1 [type] => 0 ) [link] => mysqli Object ( [affected_rows] => 1 [client_info] => DELETED [client_version] => 100134 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [error_list] => Array ( ) [field_count] => 1 [host_info] => Localhost via UNIX socket [info] => [insert_id] => 0 [server_info] => DELETED [server_version] => 100131 [stat] => Uptime: 569284 Threads: 17 Questions: 313305399 Slow queries: 0 Opens: 85935 Flush tables: 1 Open tables: 26083 Queries per second avg: 550.349 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 4359777 [warning_count] => 0 ) [sql_query] => select * from media_format where format_id = '4' ) queryFactoryResult Object ( [EOF] => 1 [cursor] => 0 [fields] => [is_cached] => [result] => Array ( ) [result_random] => [limit] => [resource] => mysqli_result Object ( [current_field] => 0 [field_count] => 5 [lengths] => [num_rows] => 0 [type] => 0 ) [link] => mysqli Object ( [affected_rows] => -1 [client_info] => DELETED [client_version] => 100134 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [error_list] => Array ( ) [field_count] => 1 [host_info] => Localhost via UNIX socket [info] => [insert_id] => 0 [server_info] => DELETED [server_version] => 100131 [stat] => Uptime: 569284 Threads: 17 Questions: 313305399 Slow queries: 0 Opens: 85935 Flush tables: 1 Open tables: 26083 Queries per second avg: 550.349 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 4359777 [warning_count] => 0 ) [sql_query] => select * from media_format_info where format_id = '4' and languages_id = '1' )
I'm not getting any error logs, but not exactly getting the field value I was hoping for either.
Also, when working correctly I should be able to control this field display through the admin under Admin>Catalog>Product Types (click on product type selection) in the Product Type Info Page Layout options :: Product - Music. I believe there is a table in the database that lists those admin options. But my last attempt to fix that too didn't go very well.
Bookmarks