exodar Posted February 21, 2006 Posted February 21, 2006 I have searched the forums and haven't found an answer to this yet so hopefully someone can help me. I see an option in the OSCOMMERCE Administration screen to display the quantity in the Product Listing, but once you go to the page for any one product, it doesn't show the quantity available. Is there a way to display that so the customer knows how many they can order? Thanks... ROB
exodar Posted February 21, 2006 Author Posted February 21, 2006 I have searched the forums and haven't found an answer to this yet so hopefully someone can help me. I see an option in the OSCOMMERCE Administration screen to display the quantity in the Product Listing, but once you go to the page for any one product, it doesn't show the quantity available. Is there a way to display that so the customer knows how many they can order? Thanks... ROB Actually even better would be the ability to show the quantity available in the Cart....that way when they are updating quantities they can see specifically how many are available for each item in their cart.
Gazonice Posted March 13, 2006 Posted March 13, 2006 Actually even better would be the ability to show the quantity available in the Cart....that way when they are updating quantities they can see specifically how many are available for each item in their cart. Hello, I have added the following code to my products_new.php to display the quantity in stock of any particular item: We have <b>' . tep_get_products_stock($products_new['products_id']) . '</b> in stock as of: ' . date('j M Y g:i A') . ' And I have added the following code to my specials.php, also to display the number of items in stock: We have <b>' . tep_get_products_stock($specials['products_id']) . '</b> in stock as of: ' . date('j M Y g:i A') . ' An example of it's insertion in specials.php: <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '"><b><u>' . $specials['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($specials['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $specials['manufacturers_name'] . '<br><br>We have <b>' . tep_get_products_stock($specials['products_id']) . '</b> in stock as of: ' . date('j M Y g:i A') . '<br><br><b>' . TEXT_PRICE . ' ' . $products_price . '</b>'; ?></td> I have added the following code to products_info.php so that I can have a stock quantity box, combined with a pull down quantity selector which drops to the max number of items in stock at the time: <?php echo 'We have <b>' . tep_get_products_stock($product_info['products_id']) . '</b> available in stock<br>as of: ' . date('j M Y g:i A'); ?> and: <table border="0" cellspacing="0" cellpadding="0"> <tr align="left" valign="middle"> <td> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> </td> <td> <?php echo tep_draw_separator('pixel_trans.gif', '5', '10'); ?></td> <td class="main"> <?php echo 'Quantity:'; ?> </td> <td> <?php echo tep_draw_separator('pixel_trans.gif', '5', '10'); ?></td> <td> <?php for ($i=0; $i<tep_get_products_stock($product_info['products_id']); $i++) { $qty_array[] = array('id' => $i+1, 'text' => $i+1); } ?><?php echo tep_draw_pull_down_menu('quantity', $qty_array, 1) ; ?></td></tr></table> What I want to try and achieve, is a quantity pull down box both in specials.php and products_new.php which drops to the max number of items in stock. Can anyone help me with this please? Many Thanks. Garry Incidentally, for a pull down quantity in the shopping cart I use (on shopping_cart.php) the following: on Line 125: $options = ''; for ($s=0 ; $s<tep_get_products_stock($products[$i]['id']); $s++) { $z = $s+1; $options[] = array('id' => $z, 'text' => $z); } on Line 168: $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_pull_down_menu('cart_quantity[]', $options, $products[$i]['quantity'], 'onChange="this.form.submit()" style="width:46px"').tep_draw_hidden_field('products_id[]', $products[$i]['id'])); Garry
Recommended Posts
Archived
This topic is now archived and is closed to further replies.