paulchen2005 Posted November 19, 2009 Share Posted November 19, 2009 can you confirm that it is ONLY the products added with the Order editor? If you delete an order that was never edited, it works fine? i have the problem too.... if i delete orders with qtpro that was never edited it works fine!!! but not with edited orders and qtpro best regards Paul Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 19, 2009 Share Posted November 19, 2009 must be something wrong with Phocea's 20 Jul 2009 contribution. Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 19, 2009 Share Posted November 19, 2009 must be something wrong with Phocea's 20 Jul 2009 contribution. yes, i think too... but what is wrong? Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 19, 2009 Share Posted November 19, 2009 yes, i think too... but what is wrong? might try to PM Phocea and bring them into the conversation. ;) Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 19, 2009 Share Posted November 19, 2009 the error was in this code: // QT Pro Addon BOF $attrib_q = tep_db_query("select distinct op.products_id, po.products_options_id, pov.products_options_values_id from products_options po, products_options_values pov, products_options_values_to_products_options po2pov, orders_products_attributes opa, orders_products op where op.orders_id = '" . $oID . "' and op.orders_products_id = '" . $orders_products_id . "' and products_options_values_name = opa.products_options_values and pov.products_options_values_id = po2pov.products_options_values_id and po.products_options_id = po2pov.products_options_id and products_options_name = opa.products_options"); while($attrib_set = tep_db_fetch_array($attrib_q)) { // corresponding to each option find the attribute ids ( opts and values id ) $products_stock_attributes[] = $attrib_set['products_options_id'].'-'.$attrib_set['products_options_values_id']; } sort($products_stock_attributes, SORT_NUMERIC); // Same sort as QT Pro stock $products_stock_attributes = implode($products_stock_attributes, ','); // update the stock tep_db_query("update ".TABLE_PRODUCTS_STOCK." set products_stock_quantity = products_stock_quantity + ".$products_details["qty"] . " where products_id= '" . $order_products['products_id'] . "' and products_stock_attributes='".$products_stock_attributes."'"); // QT Pro Addon EOF because this part: where products_id= '" . $order_products['products_id'] . "' and products_stock_attributes='".$products_stock_attributes."'"); what must i change to ask about products_stock_id and not products_stock_attributes in where clause???? Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 20, 2009 Share Posted November 20, 2009 the problem is this part: and products_stock_attributes='".$products_stock_attributes."' because products_stock_attributes is 1,2-2,2 but $products_stock_attributes is 1-2 ??? what can i do? Quote Link to comment Share on other sites More sharing options...
fruchtge Posted November 20, 2009 Share Posted November 20, 2009 can you confirm that it is ONLY the products added with the Order editor? If you delete an order that was never edited, it works fine? Hi all, thank you much for your commitments, and thats the problem: If edited orders are deleted, stock is not updated. Quote life long and knusper Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 20, 2009 Share Posted November 20, 2009 If edited orders are deleted, stock is not updated. Hi, it works only if your product has one attribute... if the product has more than one attribute it works not :( Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 20, 2009 Share Posted November 20, 2009 Hi, here is my fix, it works :) $attrib_q = tep_db_query("select distinct op.products_id, po.products_options_id, pov.products_options_values_id , pov.products_options_values_name,opa.products_options_values, opa.products_options, opa.products_options_values from products_options po, products_options_values pov, products_options_values_to_products_options po2pov, orders_products_attributes opa, orders_products op where op.orders_id = '" . $_GET['oID'] . "' and opa.orders_id = '" . $_GET['oID'] . "' and op.orders_products_id = '" . $_GET['pid'] . "' and opa.orders_products_id = '" . $_GET['pid'] . "' and po.products_options_name = opa.products_options and pov.products_options_values_name = opa.products_options_values "); best regards Paul Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 21, 2009 Share Posted November 21, 2009 (edited) you are awesome Paul !! Thanks for working that out! I'll give it a try. Are update both blocks of code in /admin/edit_orders_ajax.php ? no changes to /admin/edit_orders.php ?? Edited November 21, 2009 by surfalot Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 21, 2009 Share Posted November 21, 2009 Are update both blocks of code in /admin/edit_orders_ajax.php ? yes, the one block is for update quantity and the other if i delete a product... no changes to /admin/edit_orders.php ?? in /admin/edit_orders.php are 2 blocks to change same think like above, one block is for update quantity and the other if i delete a product... :) but this is not important if you use the ajax method ;) Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 23, 2009 Share Posted November 23, 2009 Hi, here is the next very important bug fix: in: admin/edit_orders_add_product.php: in line 142 under //end sppc patch add: // QT Pro Addon BOF if (isset($_POST['add_product_options'])) { foreach($_POST['add_product_options'] as $option_id => $option_value_id) { $products_stock_attributes[] = $option_id . '-'. $option_value_id; } // for loop sort($products_stock_attributes, SORT_NUMERIC); // Same sort as QT Pro stock $products_stock_attributes = implode($products_stock_attributes, ','); } // QT Pro Addon EOF under: 'products_quantity' => tep_db_prepare_input($_POST['add_product_quantity']), add: 'products_stock_attributes' => $products_stock_attributes); like this: 'products_quantity' => tep_db_prepare_input($_POST['add_product_quantity']), 'products_stock_attributes' => $products_stock_attributes); under: // QT Pro Addon BOF delete: if (isset($_POST['add_product_options'])) { foreach($_POST['add_product_options'] as $option_id => $option_value_id) { $products_stock_attributes[] = $option_id . '-'. $option_value_id; } // for loop sort($products_stock_attributes, SORT_NUMERIC); // Same sort as QT Pro stock $products_stock_attributes = implode($products_stock_attributes, ','); and under: tep_db_query("update ".TABLE_PRODUCTS_STOCK." set products_stock_quantity = ".$new_quantity." where products_id=" . $_POST['add_product_products_id']. " and products_stock_attributes='".$products_stock_attributes."'"); delete: } like this: //end sppc patch // QT Pro Addon BOF if (isset($_POST['add_product_options'])) { foreach($_POST['add_product_options'] as $option_id => $option_value_id) { $products_stock_attributes[] = $option_id . '-'. $option_value_id; } // for loop sort($products_stock_attributes, SORT_NUMERIC); // Same sort as QT Pro stock $products_stock_attributes = implode($products_stock_attributes, ','); } // QT Pro Addon EOF $sql_data_array = array('orders_id' => tep_db_prepare_input($oID), 'products_id' => tep_db_prepare_input($add_product_products_id), 'products_model' => tep_db_prepare_input($product['products_model']), 'products_name' => tep_db_prepare_input($product['products_name']), 'products_price' => tep_db_prepare_input($product['products_price']), 'final_price' => tep_db_prepare_input(($product['products_price'] + $AddedOptionsPrice)), 'products_tax' => tep_db_prepare_input($products_tax), 'products_quantity' => tep_db_prepare_input($_POST['add_product_quantity']), 'products_stock_attributes' => $products_stock_attributes); tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); $new_product_id = tep_db_insert_id(); if (isset($_POST['add_product_options'])) { foreach($_POST['add_product_options'] as $option_id => $option_value_id) { $sql_data_array = array('orders_id' => tep_db_prepare_input($oID), 'orders_products_id' => tep_db_prepare_input($new_product_id), 'products_options' => tep_db_prepare_input($option_names[$option_id]), 'products_options_values' => tep_db_prepare_input($option_values_names[$option_value_id]), 'options_values_price' => tep_db_prepare_input($option_value_details[$option_id][$option_value_id]['options_values_price']), 'price_prefix' => tep_db_prepare_input($option_value_details[$option_id][$option_value_id]['price_prefix'])); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); //add on for downloads if (DOWNLOAD_ENABLED == 'true' && isset($filename[$option_id])) { $Query = "INSERT INTO " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " SET orders_id = '" . tep_db_prepare_input($oID) . "', orders_products_id = '" . tep_db_prepare_input($new_product_id) . "', orders_products_filename = '" . tep_db_prepare_input($filename[$option_id]) . "', download_maxdays = '" . tep_db_prepare_input($maxdays[$option_id]) . "', download_count = '" . tep_db_prepare_input($maxcount[$option_id]) . "'"; tep_db_query($Query); } //end if (DOWNLOAD_ENABLED == 'true') { //end downloads } } // Update inventory Quantity // This is only done if store is set up to use stock if (STOCK_LIMITED == 'true'){ tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity = products_quantity - " . $_POST['add_product_quantity'] . " WHERE products_id = '" . $_POST['add_product_products_id'] . "'"); // QT Pro Addon BOF $stock_chk_q = tep_db_query("select * from " . TABLE_PRODUCTS_STOCK . " where products_id=" . $_POST['add_product_products_id']. " and products_stock_attributes='".$products_stock_attributes."'"); $stock_chk_arr = tep_db_fetch_array($stock_chk_q); $new_quantity = $stock_chk_arr['products_stock_quantity'] - $_POST['add_product_quantity']; // update the stock tep_db_query("update ".TABLE_PRODUCTS_STOCK." set products_stock_quantity = ".$new_quantity." where products_id=" . $_POST['add_product_products_id']. " and products_stock_attributes='".$products_stock_attributes."'"); // QT Pro Addon EOF now will saved products_stock_attributes in TABLE_ORDERS_PRODUCTS and if i delete the complete order in orders.php the qtpro stock will be update correct :) Quote Link to comment Share on other sites More sharing options...
rjhcloud Posted November 23, 2009 Share Posted November 23, 2009 might have been coverd b4 but i cant see it. I have instaled this contrib and all works well, except that orders are not appearing in the customers account. They are in admin just not in customers order history. Any idea how to fix this?? I am using v2.2 Rc2 Thanks in advance Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 23, 2009 Share Posted November 23, 2009 Hi, very important is this fix: before: sort($products_stock_attributes, SORT_NUMERIC); // Same sort as QT Pro stock $products_stock_attributes = implode($products_stock_attributes, ','); // update the stock tep_db_query("update ".TABLE_PRODUCTS_STOCK." set products_stock_quantity = products_stock_quantity + ".$order['products_quantity'] . " where products_id= '" . (int)$order['products_id'] . "' and products_stock_attributes='".$products_stock_attributes."'"); add: if (!empty($products_stock_attributes)) { and after the code add: } this is important because there is an error if i delete or update a product without attribute... :) Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 23, 2009 Share Posted November 23, 2009 might have been coverd b4 but i cant see it. I have instaled this contrib and all works well, except that orders are not appearing in the customers account. They are in admin just not in customers order history. Any idea how to fix this?? I am using v2.2 Rc2 Thanks in advance Did you use the Manual Order Maker? The first thing to ensure you understand is the Order Status and Public Status. If you look at Admin -> Localization -> Order Status, is the current status of the order public? Quote Link to comment Share on other sites More sharing options...
rjhcloud Posted November 23, 2009 Share Posted November 23, 2009 Did you use the Manual Order Maker? The first thing to ensure you understand is the Order Status and Public Status. If you look at Admin -> Localization -> Order Status, is the current status of the order public? Thanks for geting back to me. Yes, i installed and use manual order maker. I have also checked the order status is set to public and all of them are. Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 23, 2009 Share Posted November 23, 2009 Thanks for geting back to me. Yes, i installed and use manual order maker. I have also checked the order status is set to public and all of them are. OK, to recap, you used Manual Order Maker to create an order for an existing customer, but the order is not visible in the customer's history? And you checked to make sure the order's status is visible? Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 23, 2009 Share Posted November 23, 2009 OK, to recap, you used Manual Order Maker to create an order for an existing customer, but the order is not visible in the customer's history? The customers_ID in database is 0... that is not correct if i create a order for an existing customer... :( Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 23, 2009 Share Posted November 23, 2009 The customers_ID in database is 0... that is not correct if i create a order for an existing customer... :( This is a problem for order maker and the issue should be moved to that support topic. But for the record, the issue is in hand, please be patient. Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 23, 2009 Share Posted November 23, 2009 Thanks for geting back to me. Yes, i installed and use manual order maker. I have also checked the order status is set to public and all of them are. see the manual order maker topic: http://www.oscommerce.com/forums/index.php?showtopic=312211 Quote Link to comment Share on other sites More sharing options...
surfalot Posted November 23, 2009 Share Posted November 23, 2009 (edited) this is important because there is an error if i delete or update a product without attribute... :) so back to order editor. wow, looks like you're finding many more issues with the QTPro solution. just a bit ago, I notice the add product popup sent me back to the login page, I think there is a missing hide session id function there. Edited November 23, 2009 by surfalot Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 24, 2009 Share Posted November 24, 2009 (edited) ... Edited November 24, 2009 by paulchen2005 Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 25, 2009 Share Posted November 25, 2009 Hello, I would like to know how I can push in order editor in the list below to display the order total value added to bottom? the time it looks like this: Subtotal:19% VAT: Standard Rate (after Germany): Total (tax incl.): [/Quote] and so it should look like: Subtotal:Standard Rate (after Germany): Total (tax incl.) 19% VAT: but how do I reach it, as to get by somehow not ...:( I hope someone can help me? greetings Paul Quote Link to comment Share on other sites More sharing options...
paulchen2005 Posted November 25, 2009 Share Posted November 25, 2009 Hi, i see the error is in the sort_order... what must i change to set the sort_order like the config in the admin? Quote Link to comment Share on other sites More sharing options...
J-B Posted November 27, 2009 Share Posted November 27, 2009 (edited) Hello! I have a little problem, when I edit an order it adds this line in the ´state` field : We do not have states here in Sweden so I would prefere that it would not add anything there. To get rid of the line I have to go in to phpmyadmin and delete it in the database. How can I get rid of it? I would like to keep the country line however. I use version 5.07 Thank you for a very nice contrib! Edited November 27, 2009 by J-B 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.