Jump to content

fat_dog

Members
  • Content count

    62
  • Joined

  • Last visited

About fat_dog

  • Birthday 10/17/1985

Profile Information

  1. fat_dog

    Product Attributes

    Hi Everyone, I have noticed a bug with my store that I'm hoping someone will know the answer to. If you take an item with a stock level of 1, add it once to your basket with "Attribute A" selected (eg "Original Non-Painted"), then add it again with "Attribute B" selected (eg "Painted By Us"), it adds the product to the cart as two seperate products, even though the actual product is the same, and in stock just the once. It will allow you to check out both items, and allocates the item twice, ending up with a stock level of -1. Do Not Allow Out of Stock Items to checkout is enabled, so we should never run into this situation. However products with attributes assigned seems to bypass this check. I'm thinking its a standard bug with OSC? If not does anyone have any suggestions where to look -- what files actually do these checks? I have done a bit more digging and I think the problem is coming from the way it inserts (and presumably checks stock) on attribute items added to the basket. For instance, on my test item of pID 4252 instead of just inserting "4252" in osc_customers_basket under products_id, it is inserting 4252{2}5 and 4252{2}4 - the {2}5 part of it being the attribute. If the subsequent checks on stock are looking at 4252{2}5, it isn't going to relate to the original product - however it must do at some point in the process to get back to allocating it down to -1. Help would be most appreciated!
  2. fat_dog

    How to change test Credit Card number?

    The reason people want to change this number is because anyone with knowledge of OSC could use this number to get through checkout and place an order, as we do when testing... it stands to reason we want to change it away from its default value so only we know it. I can not find this solution, I can not find reference to 4111111111111111 in the SQL, or in the code I have looked in. Is it the case that this number is not a specific test number for OSC, coded in somewhere... but rather it is a number that by its construction bypasses the checks OSC makes on the card number/card type? If it is the latter then nothing can be done about it without installing some verification contribution, it would be nice if its a value than can be changed within OSC. Anybody know?
  3. fat_dog

    Seperate Pricing Per Customer v3.5

    I've trauled this thread for a working way of enabling two minimum order levels, one for Group 0 (Retail) and one for Group 1 (Wholesale). However, despite my best efforts and tweaking, I just can't get any of the combinations to work properly. The "Minimum Order Text" just seems to stay there for whichever group regardless of basket amount, and the amounts are not returning to basket correctly. Can anyone help compile a final version of this code that works with SPPC?
  4. fat_dog

    Protx VSP Direct - MS2.2 Support

    Ditto for me. We need a way of removing any date from the "Start Date" field and defaulting it to "none". Customers have actually cancelled the checkout process and called us because they can not remove the start date - it makes us wonder how many customers are turning away.
  5. fat_dog

    Seperate Pricing Per Customer v3.5

    Now that I'm up and running, I've had a couple of ideas that I'm sure others could implement. I have a minimum order mod installed for customers (currently £4.99 for retail). // MINIMUM ORDER MOD if ($order->info['subtotal'] < MIN_ORDER_AMOUNT) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL')); } Could we modify this for different groups? So that retail would remain at £4.99, Trade at say £150, etc... I'm thinking (not written properly:) if customer group=0 { MIN_ORDER_AMOUNT = 4.99 } elseif { if customer group=1 { MIN_ORDER_AMOUNT = 150 } } Where/How would one incorporate this "customer group" into this. I don't know what code I would need. More importantly I'm running a loyalty discount mod that gives customers discount the more they have spent in the past. I dont want to offer this to trade customers! I'm thinking the code would be pretty much the same: if customer group=0 then activate else don't activate... Again if someone can help me with obtaining the if statement for the customer group, that would be great :rolleyes:
  6. fat_dog

    Seperate Pricing Per Customer v3.5

    thanks Jan, you would appear to be 'The Man' :thumbsup: All working fine now, looking forward to implementing this fantastic contrib!
  7. fat_dog

    Seperate Pricing Per Customer v3.5

    Hello everyone. I've spent all day installing this contrib, and I have one major issue. In some, but not all of my categories the last product in that category doesn't show - almost like it's hidden. Exactly what medved described below is happening to me, except I didn't hide anything, nor have the facility to hide anything! I *think* something from 4.1.1 code includes a hiding feature and is applying itself to the last items in categories? I have installed nothing SPPC related other than "The NEW Separate Pricing Per Customer 4.1.1" package on an already-modified site. If in modules/product_listing.php I uncomment the debug code, it print's all 6 products. // next part is a debug feature, when uncommented it will print the info that this module receives /* echo '<pre>'; print_r($listing); echo '</pre>'; */ Also, if I delete this part of the code at the beginning, it displays all 6 products (all be it not in the correct layout). //BOF version 2.2 modification if (PRODUCT_LIST_NUMCOL <= 0) { $colnum = 3; $tdsize = floor(100/3); } ///THE PROBLEM LIES HERE!! else { $colnum = PRODUCT_LIST_NUMCOL; $tdsize = floor(100/PRODUCT_LIST_NUMCOL); } //EOF version 2.2 modification Can anyone please assist me in maintaing my layout but getting all the products to show up including the last one? :huh: As I have a strong hunch the problem lies in my modules/product_listing.php file, I'm copying it here... Note the file comments at the top - I see it's created by the same author. Could there be something here it doesn't like? <?php/* original: $Id: product_listing.php,v 1.44 2003/06/09 22:49:43 hpdl Exp $ corrected for proper HTML 2005/07/10 JanZ merged and updated by djmonkey1 with indispensable assistance by JanZ 2005/10/05 v2.1 developed by djmonkey1 with indispensable assistance by the Mighty JanZ 2005/10/09 reverted to a non-SPPC state by djmonkey1 v 2.2 modified by adilovetini with small feature 2006/04/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ //version 2.2 modification //if number of column per row is 1, include the original product_listing.php if (PRODUCT_LIST_NUMCOL == 1) { include(dirname(__FILE__).'/product_listing.php'); } else{ //display the version 2.2 product_listing_col.php code //bof product listing with attributes $list_box_contents = array(); $list_box_contents[] = array('params' => 'class="productListing-heading"'); $cur_row = sizeof($list_box_contents) - 1; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MULTIPLE': $add_multiple = "1"; echo '<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_multiple', 'NONSSL') . '">'; break; } } //eof product listing with attributes ?> <?php $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <!-- DAN INCLUSION START --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="productlisting"> <tr> <td width="50%" height="20" background="http://www.militarymadnessuk.co.uk/images/mmuk/boxheader_straight.gif"><img src="http://www.militarymadnessuk.co.uk/images/mmuk/boxheader_left.gif" width="11" height="20"></td> <td width="50%" height="20" align="right" background="http://www.militarymadnessuk.co.uk/images/mmuk/boxheader_straight.gif"><img src="http://www.militarymadnessuk.co.uk/images/mmuk/boxheader_right.gif" width="11" height="20"></td> </tr> </table></td> </tr> <tr> <td class="productlisting1"> <!-- DAN INCLUSION END --> <!-- START OF DISPLAYING... AT THE TOP --> <table border="0" width="100%" cellspacing="0" cellpadding="5"> <tr> <td class="smallText" valign="top" height="30"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" valign="top" align="right" height="30"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> </td> </tr> </table> <!-- END OF DISPLAYING... AT THE TOP --> <?php } $list_box_contents = array(); if ($listing_split->number_of_rows > 0) { //BOF version 2.2 modification if (PRODUCT_LIST_NUMCOL <= 0) { $colnum = 3; $tdsize = floor(100/3); } ///THE PROBLEM LIES HERE!! else { $colnum = PRODUCT_LIST_NUMCOL; $tdsize = floor(100/PRODUCT_LIST_NUMCOL); } //EOF version 2.2 modification $row = 0; //$rows = 0; $column = 0; $listing_query = tep_db_query($listing_split->sql_query); // BOF Separate Pricing per Customer $no_of_listings = tep_db_num_rows($listing_query); // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } while ($_listing = tep_db_fetch_array($listing_query)) { $listing[] = $_listing; $list_of_prdct_ids[] = $_listing['products_id']; } // next part is a debug feature, when uncommented it will print the info that this module receives /* echo '<pre>'; print_r($listing); echo '</pre>'; */ $select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' "; if ($no_of_listings > 1) { for ($n = 1; $n < count($list_of_prdct_ids); $n++) { $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' "; } } // get all product prices for products with the particular customer_group_id // however not necessary for customer_group_id = 0 if ($customer_group_id != '0') { $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."' "); // $no_of_pg_products = tep_db_num_rows($pg_query); while ($pg_array = tep_db_fetch_array($pg_query)) { $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price']); } for ($x = 0; $x < $no_of_listings; $x++) { // replace products prices with those from customers_group table if(!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) { $listing[$x]['products_price'] = $new_prices[$i]['products_price']; $listing[$x]['final_price'] = $new_prices[$i]['final_price']; } } } // end if(!empty($new_prices) $listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group $listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price } // end for ($x = 0; $x < $no_of_listings; $x++) } // end if ($customer_group_id != '0') // an extra query is needed for all the specials $specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where (".$select_list_of_prdct_ids.") and status = '1' and customers_group_id = '" .$customer_group_id. "'"); while ($specials_array = tep_db_fetch_array($specials_query)) { $new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']); } // add the correct specials_new_products_price and replace final_price for ($x = 0; $x < $no_of_listings; $x++) { if(!empty($new_s_prices)) { for ($i = 0; $i < count($new_s_prices); $i++) { if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) { $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price']; $listing[$x]['final_price'] = $new_s_prices[$i]['final_price']; } } } // end if(!empty($new_s_prices) } // end for ($x = 0; $x < $no_of_listings; $x++) // while ($listing = tep_db_fetch_array($listing_query)) { (was original code) // WARNING the code assumes there are three products per row. To use a different number change the number // at line 195: if ($column >= 3) and the code to fill up the table row below that accordingly // $counter = $row; // $class_for_buy_now = 'class="productListing-odd"'; // $list_box_contents[$row] = array('params' => 'class="productListing-odd"'); for ($x = 0; $x < $no_of_listings; $x++) { $rows++; if (($rows/2) == floor($rows/2) && ($row > $counter)) { $list_box_contents[$row] = array('params' => ''); //2.2 modification ,add width in td $class_for_buy_now = 'class="productListing-even" width="'.$tdsize.'%"'; $counter = $row; } else { if ($row > $counter) { $list_box_contents[$row] = array('params' => ''); //2.2 modification ,add width in td $class_for_buy_now = 'class="productListing-odd" width="'.$tdsize.'%"'; $counter = $row; } } //EDIT BY DAN - Change colour of background to red/green depending if in or out of stock if ((tep_get_products_stock($listing[$x]['products_id']) <= 0)) { $listingcolor = 'productinfoout'; } else { $listingcolor = 'productinfo';} $product_contents = array(); for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = ' ' . $listing[$x]['products_model'] . ' '; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<table width="95%" height="50"><tr><td class="productinfo" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>'; } else { //HERE STARTS PRODUCT LISTING NAME & PRICE FOR EACH CATEGORY $lc_text = '<table width="95%" height="50"><tr><td class="' . $listingcolor . '" align="center"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a> '; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> '; break; case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; if (tep_not_null($listing[$x]['specials_new_products_price'])) { $lc_text = ' <s><b><font color="0685FF">' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s></b></font> <span class="productSpecialPrice"><b>' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</b></span> </td></tr></table>'; } else { $lc_text = ' <font color="0685FF"><b>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</b></font> </td></tr></table>'; } break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = ' ' . /*$listing[$x]['products_quantity']*/ '' . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing[$x]['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $lc_text = '<br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> '; } break; //bof product listing with attributes case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; break; // Begin Buy Now button with attributes and quantity mod // Begin Add Multiple with attributes Contrib case 'PRODUCT_LIST_MULTIPLE': $lc_align = 'right'; $lc_valign = 'top'; $lc_text = (TABLE_HEADING_MULTIPLE . tep_draw_input_field('Qty_ProdId_' . $listing[$x]['products_id'], '0', 'size="4"')); $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 = '" . $listing[$x]['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing[$x]['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { $lc_text .= '<table border="0" cellpadding="0" cellspacing"0">'; $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='" . $listing[$x]['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $selected = 0; $products_options_array = array(); $lc_text .= '<tr><td class="main">' . $products_options_name['products_options_name'] . ':</td><td>' . "\n"; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $listing[$x]['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); 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'])) .') '; } } //$lc_text .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); //$lc_text .= tep_draw_pull_down_menu('id_'.$listing[$x]['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array); $lc_text .= tep_draw_pull_down_menu('id_'.$listing[$x]['products_id'].'[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); //$lc_text .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); $lc_text .= '</td></tr>'; } $lc_text .= '</table>'; } break; case 'PRODUCT_LIST_BUY_NOW_MULTIPLE': $lc_align = 'right'; $lc_valign = 'top'; $lc_text = '<form name="buy_now_' . $listing[$x]['products_id'] . '" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now_form', 'NONSSL') . '">'; $lc_text .= (TABLE_HEADING_MULTIPLE) . '<input type="text" name="cart_quantity" value="1" maxlength="6" size="4">'; $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 = '" . $listing[$x]['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing[$x]['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { $lc_text .= '<table border="0" cellpadding="0" cellspacing"0">'; $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='" . $listing[$x]['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $selected = 0; $products_options_array = array(); $lc_text .= '<tr><td class="main">' . $products_options_name['products_options_name'] . ':</td><td>' . "\n"; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $listing[$x]['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); 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'])) .') '; } } $lc_text .= tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); //$lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]); $lc_text .= '</td></tr>'; } $lc_text .= '</table>'; $lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW); } if ($products_attributes['total'] == 0) { $lc_text .= '<br> '; $lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW); $lc_text .= '<br> '; $lc_text .= '<table border="0" cellpadding="0" cellspacing"0"><tr><td class="main"></td><td></td></tr></table>'; } $lc_text .= '</form>'; break; // End Add Multiple mod } $product_contents[] = $lc_text; } $lc_text = implode('<br>', $product_contents); $list_box_contents[$row][$column] = array('align' => 'center', //bof product listing with attributes 'valign' => $lc_valign, //eof product listing with attributes //2.2 modification ,add width in td 'params' => 'class="productListing-data" width="'.$tdsize.'%"', 'text' => $lc_text); $column ++; if ($x == ($no_of_listings -1)) { //BOF version 2.2 modification // fill up the remainder of the table row with empty cells, assumes three products per row! for($column=1; $column < $colnum; $column++) { $list_box_contents[$row][$column + 1] = array('align' => 'center', //bof product listing with attributes 'valign' => $lc_valign, //eof product listing with attributes //2.2 modification ,add width in td 'params' => 'class="productListing-data" width="'.$tdsize.'%"', 'text' => " "); } //EOF version 2.2 modification //the commented code below is the old 2.1 version /* if ($column == '1') { $list_box_contents[$row][$column + 1] = array('align' => 'center', //bof product listing with attributes 'valign' => $lc_valign, //eof product listing with attributes 'params' => 'class="productListing-data"', 'text' => " "); $column ++; } if ($column == '2') { $list_box_contents[$row][$column + 1] = array('align' => 'center', //bof product listing with attributes 'valign' => $lc_valign, //eof product listing with attributes 'params' => 'class="productListing-data"', 'text' => " "); } */ } //BOF version 2.2 modification //change the hardcoded value of 3 to $colnum variable if ($column >= $colnum || $x == ($no_of_listings -1) ) { $row ++; // we start a new tr here with $list_box_contents $list_box_contents[$row] = array('params' => $class_for_buy_now); $column = 0; } //EOF version 2.2 modification } // end for ($x = 0; $x < $no_of_listings; $x++) new productListingBox($list_box_contents); } else { $list_box_contents = array(); //just below is the area for when it says no products in category $list_box_contents[0] = array('params' => ''); $list_box_contents[0][] = array('params' => '', 'text' => '<!-- DAN INCLUSION START --> <table border="0" width="100%
  8. Contrib: http://www.oscommerce.com/community/contri...arch,sql+backup This problem was never rectified and since I can't post in that topic for some reason I'm starting a new thread for this almost great contrib. Installs fine, seems to work fine - connects to db, sends email with attachment and saves file in directory. HOWEVER, the file is empty (125b) and contains no data. Can anyone shed some light on this? It's pretty simple code but theres a bug about... :o
  9. Hi folks, I have installed the Inventory Report Stock Level contribution, but it didn't have the ability to sort by manufacturer (a fundemental requirement in my opinion). I've got the "sort by" bit working, and also how it lists by manufacturer ID. What I now need to do is turn the ID into the manufacturer name, and that's where I need your help. This works: <td class="smallText"><?php echo $products['manufacturers_id']; ?></td> But I need to pull manufacturers_name from the DB and display next to each row under $products (as above) and can't see how this is achieved as the manufacturer name isn't held in the products table?
  10. Can anyone help translate the part of this after the *** for ms2? I assume this is ms1 related because after the ** the read-me just loses the plot. I think this sort of mod is almost essential to re-order stock, but this is the only one I can find... http://www.oscommerce.com/community/contri.../search,reorder Reorder Report Explanation: These instructions add a Reorder report into the statistics menu (box). The Reorder Report displays the all products where the reorder level is greater than the quantity on hand. So if the the reorder level for product X is 10 and the quantity on hand is 9, then product X will be listed in the report. Each product has a 'reorder to' level. So if the reorder to level for product X is 20 then the reorder quantity will be 11. Products are displayed by manufacturer and ordered by product model number. Installing Reorder Report A. Update the database: 1. Make changes to products table with reorder.sql. Note you may have to change the name of the database from 'tep' to whatever the name of the database is for your install. 2. If you want, populate the products table with something like this: update products set products_reorder = 5 update products set products_reorder_to = 15 or change the sql file to add this. Your choice. B. Update the PHP files 1. To add the link to the admin page, add the following line to the /admin/includes/boxes/statistics.php file at the end of text part of the array. <br>' . ' <a href="' . tep_href_link(FILENAME_STATS_REORDER, '', 'NONSSL') . '">' . BOX_STATISTICS_REORDER . '</a>' 2. Add to /admin/includes/application_top.php define('FILENAME_STATS_REORDER', 'stats_reorder.php'); 3. Add to /admin/includes/languages/english.php define('BOX_STATISTICS_REORDER', 'Reorder Report'); define('BOX_STATISTICS_REORDER', 'Reorder Report'); 4. Add the file stats_reorder.php to /admin folder 5. Add the file en_stats_reorder.php to /admin/includes/languages/english and rename to stats_reorder.php ******************************************************************************** ****************************************************************** 10. Update categories.php with fields for products_reorder and products_reorder_to. Insert the following after the PRODUCT_QUANTITY line in the new_product section: <tr> <td nowrap><font face="<? echo TEXT_FONT_FACE; ?>" size="<? echo TEXT_FONT_SIZE; ?>" color="<? echo TEXT_FONT_COLOR; ?>"> <? echo TEXT_PRODUCTS_REORDER; ?> </font></td> <td nowrap><font face="<? echo TEXT_FONT_FACE; ?>" size="<? echo TEXT_FONT_SIZE; ?>" color="<? echo TEXT_FONT_COLOR; ?>"> <input type="text" name="products_reorder" value="<? echo @$pInfo->reorder; ?>"> </font></td> </tr> <tr> <td nowrap><font face="<? echo TEXT_FONT_FACE; ?>" size="<? echo TEXT_FONT_SIZE; ?>" color="<? echo TEXT_FONT_COLOR; ?>"> <? echo TEXT_PRODUCTS_REORDER_TO; ?> </font></td> <td nowrap><font face="<? echo TEXT_FONT_FACE; ?>" size="<? echo TEXT_FONT_SIZE; ?>" color="<? echo TEXT_FONT_COLOR; ?>"> <input type="text" name="products_reorder_to" value="<? echo @$pInfo->reorder_to; ?>"> </font></td> </tr> Change the sql statements to support the two new fields. At the action == insert_product section: if (tep_db_query("insert into products (products_name, products_description, products_quantity, products_reorder, products_reorder_to, products_model, products_image, products_url, products_price, products_date_added, products_weight, products_status, products_tax_class_id) values ('" . $HTTP_POST_VARS['products_name'] . "', '" . $HTTP_POST_VARS['products_description'] . "', '" . $HTTP_POST_VARS['products_quantity'] . "', '" . $HTTP_POST_VARS['products_reorder'] . "', '" . $HTTP_POST_VARS['products_reorder_to'] . "', '" . $HTTP_POST_VARS['products_model'] . "', '" . $HTTP_POST_VARS['products_image'] . "', '" . $HTTP_POST_VARS['products_url'] . "', '" . $HTTP_POST_VARS['products_price'] . "', '" . $HTTP_POST_VARS['products_date_added'] . "', '" . $HTTP_POST_VARS['products_weight'] . "', '" . $HTTP_POST_VARS['products_status'] . "', '" . $HTTP_POST_VARS['products_tax_class_id'] . "')")) { At the action == update_product: tep_db_query("update products set products_name = '" . $HTTP_POST_VARS['products_name'] . "', products_description = '" . $HTTP_POST_VARS['products_description'] . "', products_quantity = '" . $HTTP_POST_VARS['products_quantity'] . "', products_reorder = '" . $HTTP_POST_VARS['products_reorder'] . "', products_reorder_to = '" . $HTTP_POST_VARS['products_reorder_to'] . "', products_model = '" . $HTTP_POST_VARS['products_model'] . "', products_image = '" . $HTTP_POST_VARS['products_image'] . "', products_url = '" . $HTTP_POST_VARS['products_url'] . "', products_price = '" . $HTTP_POST_VARS['products_price'] . "', products_weight = '" . $HTTP_POST_VARS['products_weight'] . "', products_tax_class_id = '" . $HTTP_POST_VARS['products_tax_class_id'] . "', products_status = '" . $HTTP_POST_VARS['products_status'] . "' where products_id = '" . $HTTP_GET_VARS['pID'] . "'"); At the action == new_product: $product_query = tep_db_query("select products_name, products_description, products_quantity, products_reorder, products_reorder_to, products_model, products_image, products_url, products_price, products_weight, products_date_added, products_status, products_tax_class_id, manufacturers_id from products where products_id = '" . $HTTP_GET_VARS['pID'] . "'"); At the else part of action == new_product_preview: $product_query = tep_db_query("select p.products_name, p.products_description, p.products_quantity, p.products_reorder, p.products_reorder_to, p.products_model, p.products_image, p.products_url, p.products_price, p.products_weight, p.products_date_added, p.products_status, p.manufacturers_id, m.manufacturers_name, m.manufacturers_image from products p, manufacturers m where p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and p.manufacturers_id = m.manufacturers_id"); After the $products_count = 0; // $rows = 0; // this shouldnt be reset lines: $products_query = tep_db_query("select p.products_id, p.products_name, p.products_quantity, p.products_reorder, p.products_reorder_to, p.products_image, p.products_price, p.products_date_added, p.products_status from products p, products_to_categories p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by products_name"); 11. Add to /admin/includes/languages/english/categories.php define('TEXT_PRODUCTS_REORDER', 'Reorder Level:'); define('TEXT_PRODUCTS_REORDER_TO', 'Reorder To:'); 12. Add to /admin/includes/languages/espanol/categories.php define('TEXT_PRODUCTS_REORDER', 'Reorder Level:'); define('TEXT_PRODUCTS_REORDER_TO', 'Reorder To:'); 13. Add to /admin/includes/languages/german/categories.php define('TEXT_PRODUCTS_REORDER', 'Reorder Level:'); define('TEXT_PRODUCTS_REORDER_TO', 'Reorder To:'); 14. Changes to /admin/includes/classes/product_info.php Add $reorder, $reorder_to to the list of vars after quantity. Add $this->reorder = $pInfo_array['products_reorder']; $this->reorder_to = $pInfo_array['products_reorder_to']; to the function after quantity
  11. http://www.oscommerce.com/community/contri...arch,stock+edit I can't believe this hasn't been done before, but it would be great if you could just search by product (code for example) and bang up comes the boxes to simply change the number, and click update. They do full list or by category, but for a large store by search would be much better.
  12. Hi, Asking for help and at the same time suggesting an inprovement to the mod "product_listing" (http://www.oscommerce.com/community/contri...product_listing) I would really like to integrate this mod into my site - it's exactly what I'm after - a layout that doesn't look like the standard osc list. Something a little different... However I've currently got installed a "description in product listing" mod which shows a description along with the title, image, price etc. That's working fine and can be downloaded here http://www.oscommerce.com/community/contri...ct+Listing+Hack The suggestion is really it would be great to combine to two, but when I install the view change mod (product_listing - already had description mod installed), I get an SQL error because the syntax is wrong/missing (I'm guessing it's because the "description" snippets of code are missing in the new "products_listing.php" file. I'm hoping that someone who know's a lot more about php than I do, perhaps may want to integrate the two into a fantastic mod, and secondly (or firstly ;)) if someone could you take a look and tell me where I need to add the bits from the description mod into the view change mod to get it to work? Many thanks, :thumbsup: Dan
  13. Hi, I want to offer free shipping on all goods in my store that are light enough / cheap enough to post (those that don't need to be sent by courier). The weight of the small products building up isn't an issue as they can be sent in seperate post bags, just to keep it simple. For all other products (heavy goods or expensive goods), I want to charge ?5.50 standard courier shipping regardless of the weight. What would be ideal is a mod whereby you apply your normal ?5.50 fixed fee, but on the product attributes page in admin there is a box that you can tick to say "exclude this item from shipping". Well I'm not a php programmer so I can't write it myself. I've had a look through all the mods and can't find anything suitable - the closes I have found is Individual Shipping Prices (http://www.oscommerce.com/community/contributions,1333/page,3) but the trouble with this is that it will add up the shipping for each product entered, and I can't use this mode to exclude products from the shipping. Does anyone have any suggestions, or could someone modify one of the standard shipping modules so that certain products can be excluded from the flat rate? :unsure:
×