Rachael w. Posted February 17, 2008 Posted February 17, 2008 I am trying to create a mod by altering the Unique Category Descriptions contribution to be a Unique Manufacturer Description. In theory it should work the same for a manufacturer as it does for the category. But, I may be wrong. How it works is it adds the information you created in a separate file in the languages folder to the top of your categories page, corresponding to the correct category. I've edited the code to add a manufacturer there but I am getting this error: Unknown column 'm.language_id' in 'where clause'. Of course I understand that its an issue with m.language_id in my changed code. However, I cant seem to wrap my head around what it should be! This is the original code (from the category mod): <?php $category_query = tep_db_query("select cd.categories_name from " .TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" .(int)$current_category_id . "' and cd.language_id = '" .(int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); $filename = DIR_WS_LANGUAGES . $language . '/descriptions/'.$category['categories_name'].'.php'; if (file_exists($filename)) { include( $filename ); } include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?> And this is my code (to make it work for manufacturer product listings too): <?php $manufacturer_query = tep_db_query("select m.manufacturers_name from " .TABLE_MANUFACTURERS . " m where m.manufacturers_id = '" .(int)$current_manufacturers_id . "' and m.language_id = '" .(int)$languages_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); $filename = DIR_WS_LANGUAGES . $language . '/manufacturer_descriptions/'.$manufacturer[manufacturers_name'].'.php'; if (file_exists($filename)) { include( $filename ); } What else could I use in there for the cd.language_id ??? Or am I just barking up the wrong tree here and this isnt going to work? My first thought is that I could just add the modified manufacturer code just under the modified category code, but I'm stuck on the 'm'. Thanks for your help!
Rachael w. Posted February 17, 2008 Author Posted February 17, 2008 I can see that the language_id is in the manufacturers_info table rather than the manufacturers table. But I am brain dead on this one... what do I need to do to get it to get the correct language, therefor finding the correct language folder to find the manufacturer_description file?
Rachael w. Posted February 17, 2008 Author Posted February 17, 2008 I decided to go a different route, its working fine... no help needed..
maskjaq Posted March 6, 2008 Posted March 6, 2008 I decided to go a different route, its working fine... no help needed.. Can you share how you resolved your problem as I'm looking for similar functionality? Thanks.
maskjaq Posted March 6, 2008 Posted March 6, 2008 I decided to go a different route, its working fine... no help needed.. Can you share how you resolved your problem as I'm looking for similar functionality? Thanks.
Rachael w. Posted March 7, 2008 Author Posted March 7, 2008 The project I was working on just required a background image with the manufacturers name (we decided we didnt want to put information in for 1000 plus manufacturers). I did some hard code editing to the index.php to get the image as a background to a cell then put the manufacturers name on top. I also added some info to the style sheet to get just the right font and so on there. We now have rounded corner boxes (or elongated bubbles) at the top of every page which dynamically change with the category, manufacturer or display the page title. Made the site more uniform. Not at all what I was going for in the beginning, but my sites tend to evolve through a design anyway. I wish I did have time to try to get together a contrib for this as I know I could surely use it on other sites, but I am just swamped. Sorry.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.