Aalst Posted August 2, 2003 Posted August 2, 2003 I am trying to have the quanity displayed, however when ever I change the item: Admin - Product Listing - Display Product Quantity from 0 to any number 1-5 are what I tried it never shows up. I tried 5 since it was the next number in the series first. Any help would be appreciated, Aalst
marshmallow Posted September 11, 2003 Posted September 11, 2003 I'm having the same problem... can anyone help?
Ajeh Posted September 11, 2003 Posted September 11, 2003 What file is actually being used in products_listing.php? Are you using the original products_listing.php or are you using columns?
Aalst Posted September 11, 2003 Author Posted September 11, 2003 I have long since corrected this problem on my own. Sorry for not posting my solution, I forgot about the post since I never received a response. I will try my best to describe my solution. The Admin - Product Listing - Display Product Quantity page is for how you want the multi-item column views of products to be setup. That means the SEARCH results which is /catalog/advanced_search_result.php, and when you drill down in the categories to one with items which is still the /catalog/index.php page. I had to go into the /catalog/product_info.php and put in a MOD/Hack of my own to get the quantity to be displayed. In this file you just need to add the snipit below in a PHP block where you would like to have the quantity displayed: $product_info['products_quantity'] Don't forget to give it a label so viewers of the page will know what the number means. You need to make sure you place it after the line that defines it. It is about line 73 in a unmodified /catalog/product_info.php file and the line looks like: $product_info = tep_db_fetch_array($product_info_query); I am an English ONLY site so I do not mind short cutting and place language specific things right in the core files, however I think I will change this after writing this to make it cleaner. The line would look like this: <?php echo 'Quantity: ' . $product_info['products_quantity']; ?> If you are a multi-language site you would want to put the words like "Quantity" into the correct language file /catalog/includes/languages/(language)/product_info.php. Example would be to add a define to the list of existing defines in this file: English: define('TEXT_PRODUCT_QUANTITY', 'Quantity'); Spanish: define('TEXT_PRODUCT_QUANTITY', 'Cantidad'); Then you would just add the variable within a PHP Block where needed, like so: <?php echo TEXT_PRODUCT_QUANTITY . ': ' . $product_info['products_quantity']; ?> BTW, it is always good to surround your mods/hacks with comments like so: Changes to: /catalog/includes/languages/english/product_info.php // BEGIN AALST Quantity MOD define('TEXT_PRODUCT_QUANTITY', 'Quantity'); // END AALST Quantity MOD Changes to: /catalog/product_info.php // BEGIN AALST Quantity MOD <?php echo TEXT_PRODUCT_QUANTITY . ': ' . $product_info['products_quantity']; ?> // END AALST Quantity MOD This practice will help you in the future identify MODS/HACKS from core code. If you are replacing an existing line or modify an existing line I would recommend copying and pasting the line below itself, and commenting out the original and making note that it is the original in the comments. This will help to revert to the original code if there are problems later down the road. I hope this helps someone... -Aalst
defender39 Posted January 2, 2004 Posted January 2, 2004 <td class="main" valign="bottom" align="center"><?php echo '<b>Quantity: ' . $product_info_values['products_quantity']; ?></b></td> This worked for me. I placed it under the image code <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info_values['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_info_values['products_image'], $product_info_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> <?php } ?> You can view at http://www.videogamedeals.com.
lancert Posted February 11, 2004 Posted February 11, 2004 This is great but I would like for it to display on a per product basis rather than on ALL of my products. Is there a way to add it to the product description instead of modifying the catalog/product_info.php file? Thanks! Lance Lance
Recommended Posts
Archived
This topic is now archived and is closed to further replies.