Irin Posted May 28, 2006 Share Posted May 28, 2006 Search me- all my sites, test and production, are on Apache servers. What it sounds like is the file on the server is empty. Have you tried uploading it again? Hi Stew, I tried to upload the file again but still nothing showing up. And the file is not empty, it's 90.2 KB. Is there a problem with compatibility? Thanks. Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted May 28, 2006 Share Posted May 28, 2006 Hi Stew, I tried to upload the file again but still nothing showing up. And the file is not empty, it's 90.2 KB. Is there a problem with compatibility? Thanks. None that I know of. If you've modified the file at all, try uploading an unmodified one. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Irin Posted May 29, 2006 Share Posted May 29, 2006 (edited) None that I know of. If you've modified the file at all, try uploading an unmodified one. I don't know what else I can try :(. I tried to upload an original unmodified file, but it not showing up either and I tried to remove all unnecessary tags in edit_orders.php, but still no luck. I'm lost and don't know what else I can try. Stew... if you run your site on the Apache server, would you please mind to share your edit_orders.php code with me? May be I have some code that is not compatible with Apache. It's so picky. I'll appreciate any help. Thanks. Edited May 29, 2006 by Irin Quote Link to comment Share on other sites More sharing options...
Irin Posted May 29, 2006 Share Posted May 29, 2006 (edited) I don't know what else I can try :(. I tried to upload an original unmodified file, but it not showing up either and I tried to remove all unnecessary tags in edit_orders.php, but still no luck. I'm lost and don't know what else I can try. Stew... if you run your site on the Apache server, would you please mind to share your edit_orders.php code with me? May be I have some code that is not compatible with Apache. It's so picky. I'll appreciate any help. Thanks. I'm getting an error now when I open edit_orders.php: Parse error: syntax error, unexpected T_STRING in /var/www/store/osCommerce/admin/edit_orders.php on line 556 In my edit_orders.php around line 556 I have: //2.2.1.2 keep a record of the products attributes if (is_array ($_POST['add_product_options'])) { foreach($_POST['add_product_options'] as $option_id => $option_value_id) { $Query = "INSERT INTO " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set orders_id = '" . $oID . "', orders_products_id = '" . $new_product_id . "', products_options = '" . $option_names[$option_id] . "', products_options_values = '" . tep_db_input($option_values_names[$option_value_id]) . "', options_values_price = '" . $option_value_details[$option_id][$option_value_id]['options_values_price'] . "', price_prefix = '+'";to CODEprice_prefix = '" .$option_value_details[$option_id][$option_value_id]['price_prefix'] . "'"; tep_db_query($Query); } } If I remove to CODEprice_prefix = '" .$option_value_details[$option_id][$option_value_id]['price_prefix'] . "'";the error is gone. Is this line of code suppose to be there? Thanks. Edited May 29, 2006 by Irin Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted May 29, 2006 Share Posted May 29, 2006 I'm getting an error now when I open edit_orders.php: In my edit_orders.php around line 556 I have: If I remove the error is gone. Is this line of code suppose to be there? Thanks. Looks like you were doing a cut and paste and pasted some extra stuff. In version 2.5.1 that line is price_prefix = '" . $option_value_details[$option_id][$option_value_id]['price_prefix'] . "'"; Prior to that it was price_prefix = '+'"; Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Irin Posted May 29, 2006 Share Posted May 29, 2006 Looks like you were doing a cut and paste and pasted some extra stuff. In version 2.5.1 that line is price_prefix = '" . $option_value_details[$option_id][$option_value_id]['price_prefix'] . "'"; Prior to that it was price_prefix = '+'"; Yep. Thanks Stew. This is what I thought. I wonder, how it worked before? :-" Quote Link to comment Share on other sites More sharing options...
WhirlyGirl Posted May 29, 2006 Share Posted May 29, 2006 Any ideas how we show the subtotal without tax (net)? Mine is showing up with the tax added on. I'm using v2.5. Regards, WG Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted May 29, 2006 Share Posted May 29, 2006 (edited) Any ideas how we show the subtotal without tax (net)? Mine is showing up with the tax added on. I'm using v2.5. Regards, WG You have Display Price with Tax set to true. If you want to keep this setting and Order Editor to display the subtotal without tax you will need to do custom edits on it. Edited May 29, 2006 by djmonkey1 Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted May 29, 2006 Share Posted May 29, 2006 Yep. Thanks Stew. This is what I thought. I wonder, how it worked before? :-" Magic? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Curly Posted May 30, 2006 Share Posted May 30, 2006 I am still looking for a way to recalculate tax when I manually apply a discount in order editor. I read through this thread and found some hints on how to accomplish this, but I didn't succeed yet. An example: In this example, the tax amount should be 11.97 in stead of 12.84 Is there a way to recalculate tax when I apply a discount, or to manually edit the tax amount? Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted May 31, 2006 Share Posted May 31, 2006 (edited) I am still looking for a way to recalculate tax when I manually apply a discount in order editor.I read through this thread and found some hints on how to accomplish this, but I didn't succeed yet. An example: In this example, the tax amount should be 11.97 in stead of 12.84 Is there a way to recalculate tax when I apply a discount, or to manually edit the tax amount? Go back to about post #939 and read the discussion I had with longlam about adding his coupon value into the tax total. The only difference you will see is the class of your discount component; it may be ot_coupon like Long's, ot_discount, something else, or it may be ot_custom if you are adding in the discount manually after the order has been submitted by the customer. p.s. You can manually edit the tax total directly in your database. Edited May 31, 2006 by djmonkey1 Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
abra123cadabra Posted June 2, 2006 Share Posted June 2, 2006 You have Display Price with Tax set to true. If you want to keep this setting and Order Editor to display the subtotal without tax you will need to do custom edits on it. Just installed version 2.5 after 1.75 was not usable for my purposes. Got everything up and running, added some formatting and the sort order to be like the original order. But... I have ot_netto installed as ot_total module which is displayed correctly with the value from the original order. At the moment I need to enter the changes manually which is quite a pain. How do I calculate the net_subtotal? I am using 3 different tax rates. Any ideas? abra Quote The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 2, 2006 Share Posted June 2, 2006 Just installed version 2.5 after 1.75 was not usable for my purposes. Got everything up and running, added some formatting and the sort order to be like the original order. But... I have ot_netto installed as ot_total module which is displayed correctly with the value from the original order. At the moment I need to enter the changes manually which is quite a pain. How do I calculate the net_subtotal? I am using 3 different tax rates. Any ideas? abra The first thing you should do is a find and replace on your edit_orders.php file. Find every instance of "ot_subtotal" and replace it with "ot_netto". Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
abra123cadabra Posted June 3, 2006 Share Posted June 3, 2006 Not a good idea, I think, because I need to show ot_subtotal (incl. tax), ot_shipping (incl. tax) and ot_total (incl. tax) - all working fine. In addition to that I need to show the net-value of the goods and services purchased (ot_subtotal + ot_shipping -> both with their net values) and all tax rates that are part of the order (also working). So only thing would be to calculate ot_netto as ot_total minus all ot_tax values. abra Quote The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 3, 2006 Share Posted June 3, 2006 Not a good idea, I think, because I need to show ot_subtotal (incl. tax), ot_shipping (incl. tax) and ot_total (incl. tax) - all working fine. In addition to that I need to show the net-value of the goods and services purchased (ot_subtotal + ot_shipping -> both with their net values) and all tax rates that are part of the order (also working). So only thing would be to calculate ot_netto as ot_total minus all ot_tax values. abra So ot_netto is ot_subtotal plus ot_shipping before tax? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
abra123cadabra Posted June 3, 2006 Share Posted June 3, 2006 So ot_netto is ot_subtotal plus ot_shipping before tax? Yes, but ot_subtotal can include tax belonging to 3 different tax rates whereas ot_shipping is always the same rate. So I guess calculating ot_total minus ot_tax (at rate 1) minus ot_tax (at rate 2) minus ot_tax (at rate 3) is the easiest way to get to ot_netto? Or is the value of ot_subtotal before tax calculated somewhere already? abra Quote The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 3, 2006 Share Posted June 3, 2006 (edited) Yes, but ot_subtotal can include tax belonging to 3 different tax rates whereas ot_shipping is always the same rate. So I guess calculating ot_total minus ot_tax (at rate 1) minus ot_tax (at rate 2) minus ot_tax (at rate 3) is the easiest way to get to ot_netto? Or is the value of ot_subtotal before tax calculated somewhere already? abra So ot_netto is ot_subtotal plus ot_shipping before tax? You described it as "(ot_subtotal + ot_shipping -> both with their net values)" but then say that "ot_shipping is always the same rate." But if you want a total of just the goods and services sold, and not the tax, then neither element will contain tax, and therefore the shipping component of this value will not be the same rate as ot_shipping. Edited June 3, 2006 by djmonkey1 Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
abra123cadabra Posted June 3, 2006 Share Posted June 3, 2006 So ot_netto is ot_subtotal plus ot_shipping before tax? ot_netto is ot_subtotal before tax plus ot_shipping before tax Quote The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 3, 2006 Share Posted June 3, 2006 ot_netto is ot_subtotal before tax plus ot_shipping before tax Find this at about line 136: $RunningSubTotal = 0; $RunningTax = array($default_tax_name => 0); and change it to: $RunningSubTotal = 0; $RunningNetto = 0; $RunningTax = array($default_tax_name => 0); then find at about line 228 //update subtotal and total during update function if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningSubTotal += (($products_details['tax']/100 + 1) * ($products_details['qty'] * $products_details['final_price'])); } else { $RunningSubTotal += $products_details["qty"] * $products_details["final_price"]; } and change it to //update subtotal and total during update function //this modification assumes you have Display Price with Tax set to 'true' $RunningSubTotal += (($products_details['tax']/100 + 1) * ($products_details['qty'] * $products_details['final_price'])); $RunningNetto += $products_details["qty"] * $products_details["final_price"]; then find at about line 258 if (is_array ($_POST['update_totals'])){ foreach($_POST['update_totals'] as $total_index => $total_details) { extract($total_details,EXTR_PREFIX_ALL,"ot"); if($ot_class == "ot_shipping")//a good place to add in custom total components { if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax $RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100); } else { //shipping tax is in addition to the shipping charge $RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value); } } } } and change it to if (is_array ($_POST['update_totals'])){ foreach($_POST['update_totals'] as $total_index => $total_details) { extract($total_details,EXTR_PREFIX_ALL,"ot"); if($ot_class == "ot_shipping")//a good place to add in custom total components { if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax $RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100); $RunningNetto += $ot_value - (($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100)); } else { //shipping tax is in addition to the shipping charge $RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value); $RunningNetto += $ot_value; } } } } Then find at about line 362 if ($ot_class == "ot_subtotal") { $ot_value = $RunningSubTotal; } if ($ot_class == "ot_tax") { $ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)]; } and change it to if ($ot_class == "ot_subtotal") { $ot_value = $RunningSubTotal; } if ($ot_class == "ot_netto") { $ot_value = $RunningNetto; } if ($ot_class == "ot_tax") { $ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)]; } Having performed those steps, hit the update button on a modified order and make sure everything is totalled properly. If so we can modify the add a product case and the javascript. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
abra123cadabra Posted June 4, 2006 Share Posted June 4, 2006 Thanks for the quick solution. Added the code and it's calculating fine. So now I'm ready for the second bit about javascript and add product. abra Find this at about line 136:$RunningSubTotal = 0; $RunningTax = array($default_tax_name => 0); and change it to: $RunningSubTotal = 0; $RunningNetto = 0; $RunningTax = array($default_tax_name => 0); then find at about line 228 //update subtotal and total during update function if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningSubTotal += (($products_details['tax']/100 + 1) * ($products_details['qty'] * $products_details['final_price'])); } else { $RunningSubTotal += $products_details["qty"] * $products_details["final_price"]; } and change it to //update subtotal and total during update function //this modification assumes you have Display Price with Tax set to 'true' $RunningSubTotal += (($products_details['tax']/100 + 1) * ($products_details['qty'] * $products_details['final_price'])); $RunningNetto += $products_details["qty"] * $products_details["final_price"]; then find at about line 258 if (is_array ($_POST['update_totals'])){ foreach($_POST['update_totals'] as $total_index => $total_details) { extract($total_details,EXTR_PREFIX_ALL,"ot"); if($ot_class == "ot_shipping")//a good place to add in custom total components { if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax $RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100); } else { //shipping tax is in addition to the shipping charge $RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value); } } } } and change it to if (is_array ($_POST['update_totals'])){ foreach($_POST['update_totals'] as $total_index => $total_details) { extract($total_details,EXTR_PREFIX_ALL,"ot"); if($ot_class == "ot_shipping")//a good place to add in custom total components { if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax $RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100); $RunningNetto += $ot_value - (($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100)); } else { //shipping tax is in addition to the shipping charge $RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value); $RunningNetto += $ot_value; } } } } Then find at about line 362 if ($ot_class == "ot_subtotal") { $ot_value = $RunningSubTotal; } if ($ot_class == "ot_tax") { $ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)]; } and change it to if ($ot_class == "ot_subtotal") { $ot_value = $RunningSubTotal; } if ($ot_class == "ot_netto") { $ot_value = $RunningNetto; } if ($ot_class == "ot_tax") { $ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)]; } Having performed those steps, hit the update button on a modified order and make sure everything is totalled properly. If so we can modify the add a product case and the javascript. Quote The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 4, 2006 Share Posted June 4, 2006 Thanks for the quick solution. Added the code and it's calculating fine. So now I'm ready for the second bit about javascript and add product. abra Find at line 418 if (!trim($ot_value) && ($ot_class != "ot_shipping") && ($ot_class != "ot_subtotal") && ($ot_class != "ot_total")) { // value = 0 => Delete Total Piece and change it to if (!trim($ot_value) && ($ot_class != "ot_shipping") && ($ot_class != "ot_subtotal") && ($ot_class != "ot_total") && ($ot_class != "ot_netto")) { // value = 0 => Delete Total Piece Find at about line 556 // 2.2.2 Calculate Tax and Sub-Totals $order = new order($oID); $RunningSubTotal = 0; $RunningTax = array($default_tax_name => 0); and change it to // 2.2.2 Calculate Tax and Sub-Totals $order = new order($oID); $RunningSubTotal = 0; $RunningNetto = 0; $RunningTax = array($default_tax_name => 0); Find at about line 569 if ($ot_shipping_value['class'] == 'ot_shipping')//a good place to add in other fields to tax { if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningTax[$default_tax_name] += ($ot_shipping_value['value'] * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100)); } else { $RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']); and change it to if ($ot_shipping_value['class'] == 'ot_shipping')//a good place to add in other fields to tax { if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningTax[$default_tax_name] += ($ot_shipping_value['value'] * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100)); $RunningNetto += $ot_shipping_value['value'] - (($ot_shipping_value['value'] * $order->info['shipping_tax']) / ($order->info['shipping_tax'] + 100)); } else { $RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']); $RunningNetto += $ot_shipping_value['value']; Find at about line 582 // This calculatiion of Subtotal and Tax is part of the 'add a product' process if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningSubTotal += (($order->products[$i]['tax'] / 100 + 1) * ($order->products[$i]['qty'] * $order->products[$i]['final_price'])); } else { $RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']); } and change it to // This calculatiion of Subtotal and Tax is part of the 'add a product' process //this modification assumes you have Display Price with Tax set to 'true' $RunningSubTotal += (($order->products[$i]['tax'] / 100 + 1) * ($order->products[$i]['qty'] * $order->products[$i]['final_price'])); $RunningNetto += ($order->products[$i]['qty'] * $order->products[$i]['final_price']); Find this at about line 616 // 2.2.2.3 Total if (DISPLAY_PRICE_WITH_TAX == 'true') { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND class != "ot_tax" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } else { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } and change it to // 2.2.2.2.1 ot_netto $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET text = "' . $currencies->format($RunningNetto, true, $order->info['currency'], $order->info['currency_value']) . '", value = "' . $RunningNetto . '" WHERE class="ot_netto" AND orders_id= "' . (int)$oID . '"'; tep_db_query($Query); // 2.2.2.3 Total if (DISPLAY_PRICE_WITH_TAX == 'true') { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND class != "ot_netto" AND class != "ot_tax" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } else { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND class != "ot_netto" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } Find at about line 1563 if ($TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal") { $id = $TotalDetails["Class"];//subtotal and total should each only exist once and change it to if ($TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal" || $TotalDetails["Class"] == "ot_netto") { $id = $TotalDetails["Class"];//subtotal and total should each only exist once Find at line 1576 if(//tax, subtotal, and total are not editable, but have all the same format $TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal" || $TotalDetails["Class"] == "ot_tax") and change it to if(//tax, subtotal, and total are not editable, but have all the same format $TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal" || $TotalDetails["Class"] == "ot_netto" || $TotalDetails["Class"] == "ot_tax") This should be everything but the JavaScript. I don't have time to work that out right now but will post it soon. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 4, 2006 Share Posted June 4, 2006 Thanks for the quick solution. Added the code and it's calculating fine. So now I'm ready for the second bit about javascript and add product. abra The java script: Find at about line 989 if ((action == 'weight') && (pid == 'p-total_weight')) { sum += Number(el[i].value); } and add directly below it if (action =='ot_netto'){ if ((pid == defaultTaxName + 'ot_shipping') || (pid == 'p-total_excl')) { sum += Number(el[i].value); } } Find at about line 1132 var subTotal = updateTotals('subtotal', taxdescription); document.getElementById("ot_subtotal").value = doFormat(subTotal, 4); and add directly below it var otNetto = updateTotals('ot_netto', taxdescription); document.getElementById("ot_netto").value = doFormat(otNetto, 4); Find at about line 1145 function getTotals(action, taxdescription) { //called when updating editable total components such as shipping var subTotal = updateTotals('subtotal', taxdescription); document.getElementById("ot_subtotal").value = doFormat(subTotal, 4); and add directly below it var otNetto = updateTotals('ot_netto', taxdescription); document.getElementById("ot_netto").value = doFormat(otNetto, 4); That should be it. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
abra123cadabra Posted June 4, 2006 Share Posted June 4, 2006 Thank you very much, Stew, you made my day! It's working absolutely perfect. When I started to find the right places to insert the code to automatically display and calculate the ot_netto, I never guessed that there would be so many different lines to be added or changed. I already had a look before and made some adjustment to the formatting of the ot_netto but I could never have done this alone. Great job, quick help! It really pays off to know the code in and out. abra The java script: Find at about line 989 if ((action == 'weight') && (pid == 'p-total_weight')) { sum += Number(el[i].value); } and add directly below it if (action =='ot_netto'){ if ((pid == defaultTaxName + 'ot_shipping') || (pid == 'p-total_excl')) { sum += Number(el[i].value); } } Find at about line 1132 var subTotal = updateTotals('subtotal', taxdescription); document.getElementById("ot_subtotal").value = doFormat(subTotal, 4); and add directly below it var otNetto = updateTotals('ot_netto', taxdescription); document.getElementById("ot_netto").value = doFormat(otNetto, 4); Find at about line 1145 function getTotals(action, taxdescription) { //called when updating editable total components such as shipping var subTotal = updateTotals('subtotal', taxdescription); document.getElementById("ot_subtotal").value = doFormat(subTotal, 4); and add directly below it var otNetto = updateTotals('ot_netto', taxdescription); document.getElementById("ot_netto").value = doFormat(otNetto, 4); That should be it. Quote The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong. Link to comment Share on other sites More sharing options...
djmonkey1 Posted June 5, 2006 Share Posted June 5, 2006 Thank you very much, Stew, you made my day! It's working absolutely perfect. When I started to find the right places to insert the code to automatically display and calculate the ot_netto, I never guessed that there would be so many different lines to be added or changed. I already had a look before and made some adjustment to the formatting of the ot_netto but I could never have done this alone. Great job, quick help! It really pays off to know the code in and out. abra You're welcome- but you're right that there are so many places to edit when one wants to do something like this. One of my plans for the future is to greatly simplify the code in this file, especially the JavaScript. Stew Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
invasi0n Posted June 5, 2006 Share Posted June 5, 2006 Hello, The bug where PHP was not pulling price prefix from database is still there. I have no idea how to fix it. Anybody can help? Thanks. 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.