mborin Posted September 17, 2002 Share Posted September 17, 2002 I would like to have the manufacturer name appear under each products name in the New Products page. Anyone know how? Thank you Link to comment Share on other sites More sharing options...
Ajeh Posted September 17, 2002 Share Posted September 17, 2002 This function will get you the manufacturer's name. //// // Return a product's manufacturer // TABLES: manufacturer function tep_get_manufacturers_name($products_id) { global $languages_id; $product_query = tep_db_query("select manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $product = tep_db_fetch_array($product_query); $the_manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $product['manufacturers_id'] . "'"); $the_manufacturers = tep_db_fetch_array($the_manufacturers_query); return $the_manufacturers['manufacturers_name']; } Then just add a tep_get_manufacturers_name($products_id) ... you need to supply the right product id ... and it will show where you want it. :D Link to comment Share on other sites More sharing options...
mborin Posted September 17, 2002 Author Share Posted September 17, 2002 I'm confused as to where to add the code. What I need to do is when you view the default page there's a table that's titled New Products For September and below it there are pictures of products with their model names. What I want to do is to also display the manufacturer's name below the picture of each product. Please help me out. Thank you very much. Link to comment Share on other sites More sharing options...
Paul_C Posted September 17, 2002 Share Posted September 17, 2002 Thanks for the handy function Linda :) ...now to call it everywhere :P "It's a damn poor mind that can only think of one way to spell a word." -- Andrew Jackson Link to comment Share on other sites More sharing options...
Ajeh Posted September 17, 2002 Share Posted September 17, 2002 I'm confused as to where to add the code. What I need to do is when you view the default page there's a table that's titled New Products For September and below it there are pictures of products with their model names. What I want to do is to also display the manufacturer's name below the picture of each product. Please help me out. Thank you very much. Add the function above and then edit /catalog/includes/modules/new_products.php and change the original code of: $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id']))); To the new code: $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '<br>' . tep_get_manufacturers_name($new_products['products_id']) ); Just be sure to add that function from above for getting the manufactures name to something like /includes/functions/general.php I always try to add new things like functions and definitions and such to the very end of a file just before the last ?> so that they do not interfer with existing code, are easy to find and if they happen to use existing code then they do not break so easily :shock: Link to comment Share on other sites More sharing options...
mborin Posted September 17, 2002 Author Share Posted September 17, 2002 Thank you soooo much. It worked great. Link to comment Share on other sites More sharing options...
Ajeh Posted September 17, 2002 Share Posted September 17, 2002 Glad that the peices came together for you. Mainly just trace down where you want something and stick an . 'x' . next to it or some type of mark to make sure you are in the right location. If the x shows up on the screen, then you know you are in the right location for making changes to that particular page. Most everything is handled in a nice easy to locate method by finding the filenames in upper case to tell you what is being run. The DIR_WS_something tells you the location ie. DIR_WS_INCLUDES means look in the /includes directory. As you peice your way through the code, Windows File Search is pretty handy at locating any snip of text or a variable you might need. If it cannot be found, limit your search a bit as sometimes the text is peiced together or has special characters to it. Try not to look for words like Let's ... this is not written as Let's because of the appostrophe and you will never locate it unless you remember to add in the slash. Meanwhile ... glad that helped you out. :D Link to comment Share on other sites More sharing options...
Guest Posted September 17, 2002 Share Posted September 17, 2002 Hey Linda, did you say that you write one day that you included this functionality in one of your contributions? Link to comment Share on other sites More sharing options...
mborin Posted October 13, 2002 Author Share Posted October 13, 2002 Hi Linda, Can you show me how show the manufacturer's name in the product_info.php file. Thank you Link to comment Share on other sites More sharing options...
Ajeh Posted October 13, 2002 Share Posted October 13, 2002 Add this function to your /includes/functionsgeneral.php or which ever function file you usually add new functions to. NOTE: there was a typo in the above function :shock: Then in product_info.php, you can call the function <?php echo tep_get_manufacturers_name($HTTP_GET_VARS['products_id']); ?> Place that where you are wanting the manufacture's name to appear. //// // Return a product's manufacturer // TABLES: manufacturer function tep_get_manufacturers_name($products_id) { $product_manufacturers_query = tep_db_query("select manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $product_manufacturers = tep_db_fetch_array($product_manufacturers_query); $the_manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $product_manufacturers['manufacturers_id'] . "'"); $the_manufacturers = tep_db_fetch_array($the_manufacturers_query); return $the_manufacturers['manufacturers_name']; } Then, where ever you want to use this on the products_info.php you can calling something like this: <tr> <td colspan="2" class="main"> <?php echo 'Manufacture: ' . tep_get_manufacturers_name($HTTP_GET_VARS['products_id']); ?> </td> </tr> Link to comment Share on other sites More sharing options...
mborin Posted October 13, 2002 Author Share Posted October 13, 2002 Linda, you are too cool. Thank you so much for your help. Please tell me what mods you are working on for os. Link to comment Share on other sites More sharing options...
Ajeh Posted October 13, 2002 Share Posted October 13, 2002 A lot of them ... the list grows every day :shock: Link to comment Share on other sites More sharing options...
mborin Posted October 13, 2002 Author Share Posted October 13, 2002 You have a simple mod on your site where you have a text field under the item's picture in which a shopper can specify the quantity of an item then click on add to cart button. Please show me how to do this. Thank you Link to comment Share on other sites More sharing options...
Ajeh Posted October 14, 2002 Share Posted October 14, 2002 That is a combination of using Quantity, Minimum Quantity, and Quantity Units defined on a per product basis. I would have to break it out of the code I have it in. Or, it will be part of the next update of the Free Call for Price v4.1 You can test this at: http://www.thewebmakerscorner.com/working/...products_id=121 Link to comment Share on other sites More sharing options...
mborin Posted October 16, 2002 Author Share Posted October 16, 2002 Hi Lind, I need a way to edit the product fields in the orders.php. I need a way to change quantity, shipping fee and other fields. I also need a way to add extra items to the order. Is there a simple way to mod this? If not can you make this for me, I will pay. Thank you Link to comment Share on other sites More sharing options...
Ajeh Posted October 16, 2002 Share Posted October 16, 2002 There is not a simple way to do this, but there is always a way. The problems you encounter will have to do with billing/refund issues on changes made. Link to comment Share on other sites More sharing options...
mborin Posted October 17, 2002 Author Share Posted October 17, 2002 Yes this is why I need this mod. I need a way to edit the various fields and post credits and other accounting related stuff. Link to comment Share on other sites More sharing options...
Tato Posted October 18, 2002 Share Posted October 18, 2002 Linda, can you help me for this problem ? I need to add the Manufacturer name near the product description in the product list (admin/categories.php) in the administration. I'm not a PHP programmer and for me is very difficult to change the source code. Thanks in advance Tato Link to comment Share on other sites More sharing options...
Ajeh Posted October 18, 2002 Share Posted October 18, 2002 There is already a section on /admin/categories.php to select the manufacturer's name. What is it that you are trying to do that is differerent? Link to comment Share on other sites More sharing options...
mborin Posted October 18, 2002 Author Share Posted October 18, 2002 Yes this is why I need this mod. I need a way to edit the various fields and post credits and other accounting related stuff. Hi Linda, any chance you can do the above? Just let me know how much. Link to comment Share on other sites More sharing options...
Ajeh Posted October 18, 2002 Share Posted October 18, 2002 I can probably do anything you are asking for but it would help if I really knew what you were asking for :shock: You say you want the manufacture in the /admin/categories.php It's already there. Are you meaning on the product listing before you go to edit the product that you need to see the manufacture name? Link to comment Share on other sites More sharing options...
Tato Posted October 18, 2002 Share Posted October 18, 2002 Linda, yes, there is in insert or edit a product, but I'd like to see the manufacturer name in the "list" of products, when I enter in a category I can see all the product descriptions but not the manufacturer name. I try to explain better, this is the header of the page: Category / Product Status Action now I'd like to put near the product description the manufacturer name. Excuse me for my bad english !! Bye Tato Link to comment Share on other sites More sharing options...
mborin Posted October 18, 2002 Author Share Posted October 18, 2002 Hi Linda, I need to be able to modify all product fields (quanityt, unit price, total price, shipping, tax, etc...) and add new items to an existing order. Can you do this? Link to comment Share on other sites More sharing options...
Tato Posted October 18, 2002 Share Posted October 18, 2002 <Are you meaning on the product listing before you go to edit the product that you need to see the manufacture name?> YES !! Link to comment Share on other sites More sharing options...
Ajeh Posted October 20, 2002 Share Posted October 20, 2002 Add to /admin/includes/languages/english/categories.php define('TABLE_HEADING_MANUFACTURERS','Manufacture'); Add following function to the end of one of the function files, before the ?>, like /admin/includes/functions/general.php //// // Return a product's manufacturer // TABLES: manufacturer function tep_get_manufacturers_name($products_id) { $product_manufacturers_query = tep_db_query("select manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $product_manufacturers = tep_db_fetch_array($product_manufacturers_query); $the_manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $product_manufacturers['manufacturers_id'] . "'"); $the_manufacturers = tep_db_fetch_array($the_manufacturers_query); return $the_manufacturers['manufacturers_name']; } 2 edits to the /admin/categories.php ... Find: <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> Change to: <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MANUFACTURERS; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> Find: <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td> <td class="dataTableContent" align="center"> Change to: <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td> <td class="dataTableContent"><?php echo tep_get_manufacturers_name($products['products_id']) ?></td> <td class="dataTableContent" align="center"> Easy, eh? :shock: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.