burntool Posted July 25, 2006 Share Posted July 25, 2006 Hi, total newb, 2 questions. 1. Wherever I place: if (DISPLAY_EXTRA_IMAGES == 'true'){ if ($product_check['total'] >= 1) { include (DIR_WS_INCLUDES . 'products_extra_images.php'); } } in product_info.php I get following error Fatal error: Cannot redeclare tep_db_connect() (previously declared in /homepages/20/d171575071/htdocs/osc/includes/functions/database.php:13) in /homepages/20/d171575071/htdocs/osc/includes/functions/database.php on line 13 Is that because of the place I put the code or is the problem in the database.php??? I just can't figure it out. I am using a template where I don't have the code as described in the install.txt. Any way to solve this? 2. Can I somehow change the pulldown menu that is displayed in the admin interface so that it would consist of the product names instead of models? Quote Link to comment Share on other sites More sharing options...
drumcentral Posted July 26, 2006 Share Posted July 26, 2006 I have the identical problem, but hadn't realised it was the Extra Images Contribution that was causing this. I might try removing it and see if that solves it. It only seems to happen when I browse to Admin/index.php If I go to any other address in admin it's fine, but it's still annoying! It would be great if someone new how to fix this. These are the files I edited or changed when installing Extra Images: /admin/includes/filenames.php /admin/includes/database_tables.php /admin/includes/boxes/catalog.php /admin/includes/languages/english.php /catalog/includes/filenames.php /catalog/includes/database_tables.php /catalog/includes/languages/english.php /catalog/product_info.php Kenny Quote -------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
thehedgewizards Posted August 6, 2006 Share Posted August 6, 2006 I've had the same problem...I hope someone can figure this out... :( Quote Link to comment Share on other sites More sharing options...
Guest Posted August 6, 2006 Share Posted August 6, 2006 I've had the same problem...I hope someone can figure this out... :( Same issue here, I didn't realise why I had a whole list of blank items (all of which worked as they were supposed to just with a name) Now that you say it's a list of models that makes a more sense and that does work nicely now. I would MUCH prefer if that field referred to product names instead. Does anyone know how to change this?? Quote Link to comment Share on other sites More sharing options...
Guest Posted August 7, 2006 Share Posted August 7, 2006 OK, it seems to work for me now... Here is a paste of lines 186 - 211 so you get a little before and after to see where I have put things: <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } if (DISPLAY_EXTRA_IMAGES == 'true'){ if ($product_check['total'] >= 1) { include (DIR_WS_INCLUDES . 'products_extra_images.php'); } } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> This seems to get the extra images working as it should (at least for me). I'm still very much interested in getting products in that list rather than models since we don't use models and it's just more info we have to go back and add. Incidently, if we do have to go down this path, is there anyway to extend the model field past it's 12 characters? Quote Link to comment Share on other sites More sharing options...
thehedgewizards Posted August 7, 2006 Share Posted August 7, 2006 I looked at my code and the difference was what's in the ****** stars **** below... <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ********else {******* if (DISPLAY_EXTRA_IMAGES == 'true'){ if ($product_check['total'] >= 1) { include (DIR_WS_INCLUDES . 'products_extra_images.php'); } } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> I took the else { out and it works fine. Thanks a million, The_Hawk Quote Link to comment Share on other sites More sharing options...
Guest Posted August 7, 2006 Share Posted August 7, 2006 Gotta love friends. One of my mates fix it so it shows the product name in the drop down box... this then led to another problem, the table then needs to be fixed so it also shows product name :) Anyway, there is only two changes that need to be made to get this working (although the table heading still says model, it actually reports product name) Enjoy :) in file: catalog/admin/products_extra_images.php goto line 27: $products_query = tep_db_query("select products_id, products_model from " . TABLE_PRODUCTS . " order by products_model"); and replace with: $products_query = tep_db_query("select p.products_id as products_id, pd.products_name as products_model from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = " . $languages_id . " order by pd.products_name"); Then head down to line 130: $products_extra_images_query_raw = "select pei.products_extra_image, pei.products_extra_images_id, pei.products_id, p.products_model from " . TABLE_PRODUCTS_EXTRA_IMAGES . " pei left join " . TABLE_PRODUCTS . " p ON pei.products_id = p.products_id order by p.products_model"; and replace with: $products_extra_images_query_raw = "select pei.products_extra_image, pei.products_extra_images_id, pei.products_id, pd.products_name as products_model from " . TABLE_PRODUCTS_EXTRA_IMAGES . " pei left join " . TABLE_PRODUCTS . " p on pei.products_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id order by p.products_model"; And thats it :) Maybe not the prettiest implementation, but it seems to work nicely! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.