Guest Posted October 18, 2004 Share Posted October 18, 2004 Does this contribution have the capability of adding multiple quantities of a given product with different attributes at once? For instance an attribute "size X" a user can type in a desired number to purchase and another attribute of the same product, "size Y", the user can type in how many he wants. Looking to have it all from the same page (while while keeping inventory of the attributes). If qtpro does not do this, do you know another contribution that does? Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 18, 2004 Share Posted October 18, 2004 Synrider, Have you found any bugs since friday? If not, are you going to post the fix? A very eager, staaby Quote Link to comment Share on other sites More sharing options...
Guest Posted October 19, 2004 Share Posted October 19, 2004 attention needed HERE PLEASE Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 19, 2004 Share Posted October 19, 2004 Well all, I couldnt wait any longer so I dug through what has gone on the last week and i have it working with multiple attributes. First things first, USE 2.3 NOT 3.0 Then, in the product_info.php find this line: /START get attribute stock values $attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and products_stock_attributes = '" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "'"); and replace it with the line that Tim Ross found /START get attribute stock values $attribute_stock_query = tep_db_query("SELECT products_stock_quantity FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes LIKE '%" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "%'"); This removes stock and everything. And it removes the 'Out Of Stock' for all items. Hope this helps some people. staaby Quote Link to comment Share on other sites More sharing options...
mijman2 Posted October 19, 2004 Share Posted October 19, 2004 stabby can you post your site please? Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 19, 2004 Share Posted October 19, 2004 No Bueno Gear Test Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 19, 2004 Share Posted October 19, 2004 (edited) DOH got an error... when there are 2 colors... Get the following error 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 insert into products_stock values (0,28,'1-6,2-2',) Edited October 19, 2004 by Staaby Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 19, 2004 Share Posted October 19, 2004 Fixed it by adding this from TomThumb QUOTE1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'where products_id=157' at line 1 update products set products_quantity= where products_id=157 This error is the sql statement is returning a NULL value for the sum when all items are set to 0. You can fix this by adding this line CODE if (is_null($summa)) {$summa = 0; } directly below this line CODE$summa=$list[summa]; So your final code will look like this CODE $list=tep_db_fetch_array($q); $summa=$list[summa]; if (is_null($summa)) {$summa = 0; } tep_db_query("update products set products_quantity=$summa where products_id=$VARS[product_id]"); Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 19, 2004 Share Posted October 19, 2004 New issue... With the second attribute, it doesnt subtract stock or check stock... any ideas? Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 19, 2004 Share Posted October 19, 2004 did a little more screwing around and found that the second attribute takes into account the ENTIRE stock and not just the one that it is supposed to be pulling from. I made Black the primary for the color attribute and added S, M, L, XL and then did the same for white. The blacks followed the rules of stock but the whites thought that all of them belonged to the one attribute eg. B-S 2 B-M 5 B-L 3 B-XL 4 W-S 2 W-M 5 W-L 3 W-XL 4 any of the whites though that it had 28 in each attribute. Any ideas? Quote Link to comment Share on other sites More sharing options...
ralphday Posted October 20, 2004 Share Posted October 20, 2004 did a little more screwing around and found that the second attribute takes into account the ENTIRE stock and not just the one that it is supposed to be pulling from. I made Black the primary for the color attribute and added S, M, L, XL and then did the same for white. The blacks followed the rules of stock but the whites thought that all of them belonged to the one attribute eg. B-S 2 B-M 5 B-L 3 B-XL 4 W-S 2 W-M 5 W-L 3 W-XL 4 any of the whites though that it had 28 in each attribute. Any ideas? <{POST_SNAPBACK}> Try this for your query $attribute_stock_query = tep_db_query("SELECT products_stock_quantity FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes REGEXP '(^|,)" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "(,|$) AND products_stock_quantity > 0"); I haven't tired this yet and not being a regular expression wiz I'm not sure its correct. Essentially the idea of the regexp is to look for either the start of the string or a comma followed by the option id-option value followed by a comma or the end of string. The LIKE %1-2% could pick up stock for 11-23 where the regexp won't. And then only look for a row that has quantity>0 in case the first row found has a stock of 0. You also might want to fix some bugs in tep_check_stock_new in general.php. Change the asort to a ksort so that the shopping cart will display out of stock correctly. Also, there is a bug that causes it to return the product stock instead of no stock if there isn't a row in the products_stock table for the attribute combination. You can look at the CPIL contribution for the code changes but beware, CPIL is based on MS1, not MS2 so just pull out the code changes to tep_check_stock_new - its just two lines. I think the same bug might exist in checkout_process.php but I don't remember for sure. Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 20, 2004 Share Posted October 20, 2004 Try this for your query $attribute_stock_query = tep_db_query("SELECT products_stock_quantity FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes REGEXP '(^|,)" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "(,|$) AND products_stock_quantity > 0"); I haven't tired this yet and not being a regular expression wiz I'm not sure its correct. Essentially the idea of the regexp is to look for either the start of the string or a comma followed by the option id-option value followed by a comma or the end of string. The LIKE %1-2% could pick up stock for 11-23 where the regexp won't. And then only look for a row that has quantity>0 in case the first row found has a stock of 0. You also might want to fix some bugs in tep_check_stock_new in general.php. Change the asort to a ksort so that the shopping cart will display out of stock correctly. Also, there is a bug that causes it to return the product stock instead of no stock if there isn't a row in the products_stock table for the attribute combination. You can look at the CPIL contribution for the code changes but beware, CPIL is based on MS1, not MS2 so just pull out the code changes to tep_check_stock_new - its just two lines. I think the same bug might exist in checkout_process.php but I don't remember for sure. <{POST_SNAPBACK}> Ya i tried your query and it doesnt work... i unfortunately am not very good at php... will keep digging.. thanks bro! Quote Link to comment Share on other sites More sharing options...
ralphday Posted October 20, 2004 Share Posted October 20, 2004 Ya i tried your query and it doesnt work... i unfortunately am not very good at php... will keep digging.. thanks bro! <{POST_SNAPBACK}> Duh. I should know better than to post untested stuff. Looks like I missed a few quotes. I'll test tonight and post something that actually works. Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 21, 2004 Share Posted October 21, 2004 Duh. I should know better than to post untested stuff. Looks like I missed a few quotes. I'll test tonight and post something that actually works. <{POST_SNAPBACK}> I appreciate the help. One thing i noticed was that it should actaully start with $products_attributes_query This is in the product_info.php file correct? Thanks again Staaby Quote Link to comment Share on other sites More sharing options...
ralphday Posted October 21, 2004 Share Posted October 21, 2004 I appreciate the help. One thing i noticed was that it should actaully start with $products_attributes_query This is in the product_info.php file correct? Thanks again Staaby <{POST_SNAPBACK}> No $attribute_stock_query is right and yes its in product_info.php. Here's a tested (briefly) and apparently working fix for the 2.3 update. Beat it up and see how it works. First off, find this code in catalog/product_info.php at line 141: $attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and products_stock_attributes = '" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "'"); $attributes_stock = tep_db_fetch_array($attribute_stock_query); $option_stock = $attributes_stock['products_stock_quantity']; //END get attribute stock values // START Show out of Stock if ($option_stock == 0) { and replace it with: $attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes REGEXP '(^|,)" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "(,|$)' AND products_stock_quantity > 0"); if (tep_db_num_rows($attribute_stock_query)==0) { Then find in catalog/includes/functions/general.php at line 135: asort($products_attibutes); and replace it with: ksort($products_attibutes); Then find in catalog/includes/functions/general.php at line 162: $quantity = tep_get_products_stock($products_id); and replace it with: $quantity = 0; Then find in catalog/checkout_process.php at line 157: $actual_stock_bought = $order->products[$i]['qty']; } } else { $actual_stock_bought = $order->products[$i]['qty']; } } else { $actual_stock_bought = $order->products[$i]['qty']; } and replace it with: $actual_stock_bought = $order->products[$i]['qty']; } } else { $actual_stock_bought = 0; } } else { $actual_stock_bought = $order->products[$i]['qty']; } This should fix multiple options for a product. HTH and let me know how it goes. Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 21, 2004 Share Posted October 21, 2004 getting this now: Parse error: parse error, unexpected $ in /home/content/N/B/G/NBGAdmin/html/catalog/product_info.php on line 264 here is my product_info.php file <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ (v 1.98 by Tom Wojcik aka TomThumb 2004/07/03 based on work by Michael Coffman aka coffman) osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Amended for Attributes Inventory - FREEZEHELL - 08/11/2003 [email protected] Copyright (c) 2003 IBWO Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.options_id, pa.options_values_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { //START get attribute stock values // $attribute_stock_query = tep_db_query("SELECT products_stock_quantity FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes LIKE '%" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "%'"); $attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' AND products_stock_attributes REGEXP '(^|,)" . (int)$products_options['options_id'] . "-" . (int)$products_options['options_values_id'] . "(,|$)' AND products_stock_quantity > 0"); if (tep_db_num_rows($attribute_stock_query)==0) { $attributes_stock = tep_db_fetch_array($attribute_stock_query); $option_stock = $attributes_stock['products_stock_quantity']; //END get attribute stock values // START Show out of Stock if ($option_stock == 0) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => 'Out of Stock - ' . $products_options['products_options_values_name']); } else { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); } // END Show out of Stock if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?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 } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" align="right"><?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 width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
TomThumb Posted October 21, 2004 Share Posted October 21, 2004 The else on 77 is not closed. Add closing bracket } like below around line 246 <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } // added to close else from line 77 ?> Quote while (!succeed) {try()}; GMT -6:00 Link to comment Share on other sites More sharing options...
Staaby Posted October 21, 2004 Share Posted October 21, 2004 Ralph, can you post your product_info.php that worked? I am getting some really funky stuff happening when i make the changes that you posted. (check out www.nobuenogear.com/catalog if you want to see what is going on) Thanks! staaby Quote Link to comment Share on other sites More sharing options...
ralphday Posted October 21, 2004 Share Posted October 21, 2004 getting this now: Parse error: parse error, unexpected $ in /home/content/N/B/G/NBGAdmin/html/catalog/product_info.php on line 264 My code is at home so I won't be able to post it until tonight. But you didn't make the change correctly - you left in a couple of lines that need to come out. I don't think you need to make the change Tom suggested. Just comment out these lines: $attributes_stock = tep_db_fetch_array($attribute_stock_query); $option_stock = $attributes_stock['products_stock_quantity']; //END get attribute stock values // START Show out of Stock if ($option_stock == 0) { Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 21, 2004 Share Posted October 21, 2004 My code is at home so I won't be able to post it until tonight. But you didn't make the change correctly - you left in a couple of lines that need to come out. I don't think you need to make the change Tom suggested. Just comment out these lines: $attributes_stock = tep_db_fetch_array($attribute_stock_query); ? ? ? ?$option_stock = $attributes_stock['products_stock_quantity']; ?//END get attribute stock values ?// START Show out of Stock ? ? ? ?if ($option_stock == 0) { <{POST_SNAPBACK}> Oh you just made my day... looks like it is working. Gonna bang away at it and see if i can break it. Quote Link to comment Share on other sites More sharing options...
Staaby Posted October 21, 2004 Share Posted October 21, 2004 The only thing that ive noticed that would be a "bug" is that you only get the -Out of Stock- in the selection if there are none for all options (ie the stock equals zero for small shirt in both white and black). Not that this is a big deal (believe me i can live with it), but some people might be anal about it. Thank you so much for helping me out with this ralph! Quote Link to comment Share on other sites More sharing options...
ralphday Posted October 21, 2004 Share Posted October 21, 2004 The only thing that ive noticed that would be a "bug" is that you only get the -Out of Stock- in the selection if there are none for all options (ie the stock equals zero for small shirt in both white and black). Not that this is a big deal (believe me i can live with it), but some people might be anal about it. Thank you so much for helping me out with this ralph! <{POST_SNAPBACK}> Yes, that's true. There are many ways of handling this but this is the simplest. The customer will see the specific combination selected is out of stock in the cart. Its OK if normally most combinations are in stock, but not so good for an outlet type site where you've got one XL, Red, one S, Green, one M, Black and one L, White. Way too many combinations are out of stock. I've got some options for handling this in the works but nothing ready for posting yet. Quote Link to comment Share on other sites More sharing options...
mijman2 Posted October 21, 2004 Share Posted October 21, 2004 You guys are amazing... I have been waiting forever for this type of improvement and dedication.. My site is live, so unfortunatly I will have to wait till the updated version with -Out of Stock- Working completely (customers complain too much ;) ) -Steve Quote Link to comment Share on other sites More sharing options...
bubbasplitshot Posted October 22, 2004 Share Posted October 22, 2004 :-" off topic and I appologize but has anyone successfully generated inventory reports using the stocks settings of QTPro? I want to get a report of the count of each attribute for an item, and all items, in a inventory report. For example, I want to know how many size "9-11 black socks" (currently I use just one attribute, which combines size and color) and how many "10-13 black socks" I have, etc. for my entire store. I have the Printable Catalog module (catalog_products_with_images.php) installed which prints a nice listing but doesn't do the detailed reporting of count per attributed item I need.. Thanks! Quote Link to comment Share on other sites More sharing options...
mijman2 Posted October 23, 2004 Share Posted October 23, 2004 It is included with the attribute starting on version 2.3 i believe Go to the product stock page and then click on the link below that says product attribute inventory! 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.