Jump to content

sloughwi

Members
  • Content count

    23
  • Joined

  • Last visited

1 Follower

Profile Information

  1. sloughwi

    QTPro 2.1 Patch

    Since people are having trouble getting QTPro and let me go ahead and dub this "2.1" and put up a link for it. 1) Fix error related to customers having a 'blank' attribute during checkout. 2) Force the customer to make an explicit choice when choosing a required attribute. 3) Keep track of attribute Inventory (by subtractiong quantities of items from both the products table and the products_attibutes table). http://www.msu.edu/~sloughwi/QTPro_2.1.zip Just the patch can be downloaded at: http://www.msu.edu/~sloughwi/QTPro_Patch.zip
  2. sloughwi

    QTPro Contribution question

    Please keep in mind I did not write QTPro. I am not really not impressed with how it was implimented. The PHP is rather impressive but the design is lacking and I think this could have been implimented in a much cleaner way. Anyway, keeping that in mind this category should not be called "special". It shoudl have been called "Infinite Inventory" or "Do not keep track of inventory?". It is there so that you don't have to record stock for it (that is why it disappears under stock.php when its checked). That is why that "IF" statement is there, because stock should not be subtracted from "infinite" attributes. Some people might be confused about why there are radio buttons and not drop down boxes, so let me post something here to clear that up. Drop down boxes would be very nice (and they do appear if you select "special" and force the script to ignore inventory). However, concider for a moment what it would be like to have all drop-down boxes. If you have 2 different attributes for an item, each with 5 choices and you only have one combiniation of all of those in stock, a customer might have to try 25 combinations to find the product that is in stock. Instead, it is better to list every possible combination availible for convienance. The reason we can use drop-down boxes for attributes that have no stock is because every combination is always valid. Again, this code could have been done a different way. For example, we could have java script look at the customers choice for the first attribute then dynamiclly generate a second attribute drop down box based on the first, etc etc. That would slick, but time consuming to code. If you have any questions post them here so I'm not getting PM'd the same questions over and over! :)
  3. sloughwi

    QTPro Contribution question

    The null problem that you talk about shoudl be fixed in my files by javascript code that ensures an option is checked. I don't know why its not working for you, I have sent the fix to other people and they have not yet had a problem. Any one else out there try this patch and experiance problems?
  4. sloughwi

    QTPro Contribution question

    Oh, and that fix should go at approx. line 144
  5. sloughwi

    QTPro Contribution question

    Ok, here is a bug I found: in checkout_process.php under the line: if (is_array($products_attributes)){ add the line: $products_stock_attributes_array = array(); Eliot: I'm not sure why it is not working for you. I have a snap shot from of OsCommerce from the begining of February, I'm not sure of the version number (or where to get the version number in the code). I am using QTPro 2.0 as well. The SPG mod really shouldn't effect anything. Make sure you are updating the right files and give me an idea of what effects my patch are having, so I can determain "this works but this doesn't". Also, for those of you using SPG...this fix does not subtract attribute inventory from manual orders, only customer placed orders. I am working on fix for that right now.[/code]
  6. sloughwi

    QTPro Contribution question

    Alright, here is comes. This patch should: 1) Fix error related to customers having a 'blank' attribute during checkout. 2) Force the customer to make an explicit choice when choosing a required attribute. 3) Keep track of attribute Inventory (by subtractiong quantities of items from both the products table and the products_attibutes table). Let me apologize for not posting the code for copying into the files. I made so many changes over such a long period of time I lost track of what lines were changed. In the future I will be more careful. Anyway, here are the files: http://www.msu.edu/~sloughwi/QTPro_Patch.zip checkout_process.php goes in catalog order_details.php goes in catalogincludesmodules order.php goes in catalogincludesclasses shopping_cart.php goes in catalog product_info.php goes in catalog PLEASE make backups of your old files just in case! Let me know of any problems and I will, of course, do what I can. Also, keep in mind I am using the SPG shipping mod (for manual entries of orders). That might have some effect, so mention if you use it when you report a problem. Good luck
  7. sloughwi

    QTPro Contribution question

    My above fix only subtracts stock from the attributes if there are no "special" attributes listed for the product (that is, no attributes that have drop down boxes, only those that use radio buttons, ie check boxs). I have fixed it so it works for combinations of both, but it will be a couple days before I post it. I am busy working on final essays for college and graduating this May sort of takes priority :P sorry! :wink:
  8. sloughwi

    QTPro Contribution question

    Yet another fix for QTPro... add this to application_top.php in your catalog folder: define('TABLE_PRODUCTS_STOCK', 'products_stock'); now, in checkout_process.php on approx line 141 there is a segment of code that reads: if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[$i]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[$i]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { add this code in after that block: if (is_array($products_attributes)){ For($j=0; $j< sizeof($products_attributes); $j++){ $products_stock_attributes_array[] = $products_attributes[$j]['option_id']."-".$products_attributes[$j]['value_id']; } $products_stock_attributes = implode(",",$products_stock_attributes_array); $attributes_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $attributes_stock_values = tep_db_fetch_array($attributes_stock_query); $attributes_stock_left = $attributes_stock_values['products_stock_quantity'] - $order->products[$i]['qty']; if ($attributes_stock_left < 1) { tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '0' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); }else{ tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" . $attributes_stock_left . "' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } So the entire 'if' statement will look like this: if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[$i]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[$i]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { if (is_array($products_attributes)){ For($j=0; $j< sizeof($products_attributes); $j++){ $products_stock_attributes_array[] = $products_attributes[$j]['option_id']."-".$products_attributes[$j]['value_id']; } $products_stock_attributes = implode(",",$products_stock_attributes_array); $attributes_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $attributes_stock_values = tep_db_fetch_array($attributes_stock_query); $attributes_stock_left = $attributes_stock_values['products_stock_quantity'] - $order->products[$i]['qty']; if ($attributes_stock_left < 1) { tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '0' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); }else{ tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" . $attributes_stock_left . "' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } This isn't how I would prefer to do attribute quantity recording, but QTPro does work and, although not perfect, the framework is acceptable. I plan to add drop down boxes instead of option boxes soon during the check out process (I think the option boxes look kinda nasty and un-intuitive, what does everyone else think? Is there already a fix for that?) If you are having other problems, specifilly with customer getting 'null attributes' check out my other fixes for this mod with a quick search for QTPro.
  9. sloughwi

    QTPro Contribution question

    you are absolutly right... I will work on a fix
  10. The 'attributes status' flag is not working, and a few constants are still not defined. I needed to define admin_login.php in the /catalog/includes/languages/english.php. It was only defined in the admin english.php (that very well may have been my own installation error, however). Also, I have noticed a bug in the last few versions (.7 included). When you first view a pending order, the shipping varable does not grab the product information because $shipping = new shipping($oID) is called before the order information is copied from the default OSCommerce tables into the SPG tables. You can see all the shipping information, but there are no products displayed. As soon as you re-fresh the screen the products appear. Simply moving the line $shipping = new shipping($oID); after the if-then statement that follows it. This solves the problem. Other then those things .7 is working nicely. Great mod. :D
  11. sloughwi

    QTPro problems, 1064 error

    Please let me know which file is generating that error by looking in the address bar when that error occurs. <something>.php
  12. sloughwi

    Manual Entry question

    Will you release the updates as a patch? I really don't want to have to go and do all the customizations over again! If you could release a .zip w/ just the changed files that would be great.
  13. sloughwi

    Manual Entry question

    Run an SQL Query: "Update spg_suppliers_products SET spg_suppliers_id = <insert id here>" That will update all of them just make sure you want every product in the table linked to that supplier. And be sure to make a backup.
  14. sloughwi

    Manual Entry question

    Enter the supplier you want for the 500 into the DB from the admin section. Then go into myphpadmin and select the table spg_suppliers. Get the supplier id number for the supplier you just entered. Then go to the table spg_suppliers_products and make sure the existing 500 products all have that supplier ID. Then add your new products and supplier. Assign the new products to the correct supplier through the admin panel.
  15. sloughwi

    Manual Entry question

    Add this column to the table 'products' in myphpadmin: products_cost decimal (15,4) Null that worked for me! Not sure about this one...dont' think I had that problem...better restore your backup and try installing again, just to be sure you did it correctly. Yup...go and define them I had to define at least three or so myself, can't remember which ones. Also, there was an SQL in spg_shipping.php that has a null entry for an update. That was giving me an 'wrong number of columns' error, so I just removed the '' entry from the end and now it works great. Just a note in case someone else has the problem.
×