Jump to content

insaini

Members
  • Content count

    207
  • Joined

  • Last visited

Everything posted by insaini

  1. insaini

    NEW! Complete Order Editing Tool!

    thats it exactly.. no its not used for calculations.. the tep_get_tax_rate is used for calculations.. but the function i created can be used for that I just didnt feel like doing so much recoding.. but its still perfect for having the tax descriptions seperate along with the individual tax rates..
  2. insaini

    NEW! Complete Order Editing Tool!

    Agreed, kang you shouldnt be having any problems at all.. it seems that contribution you added only outputs the orderid in a different way but has nothing to do with the way it is stored.. in which case it should be causing any problems at all.. however.. there may be someplace (one or more) where you are actually assigning that value to the $oID. That would definitely cause some problems.. if anywhere you have $oID = tep_trans_id($raw_date, $oID); or something to that effect.. then this would definitely cause that problem.. i would look for that.. J
  3. insaini

    NEW! Complete Order Editing Tool!

    yeah that is too easy.. actually the function i created returns an array .. tax_description would no longer just be a description but an array with a rate and description.. it does require some modification in the edit_orders.php file. ot_tax does not require any modification but ot_shipping and ot_loworderfee do then of course oe_order.php needs to be modified this is pretty much the change ot_shipping.php Line 52 $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); TO $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); // $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $shipping_tax_description = tep_get_tax_rate_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id'], array()); $order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); // $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); foreach($shipping_tax_description as $desc => $tax_rate) { if($tax_rate != 0) { $order->info['tax_groups']["$desc"] += tep_calculate_tax($order->info['shipping_cost'], $tax_rate); } } $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax); you can see the basic way it functions with the foreach .. the function i created is also compounded taxes safe
  4. insaini

    NEW! Complete Order Editing Tool!

    nice.. ill start testing this myself soon.. AJAX is definitely worthwhile bonus.. how does this work with multiple taxes ? that was actually the main reason for me updating the entire package in the first place.. taxes were being grouped together and I wanted them separate.. J
  5. insaini

    NEW! Complete Order Editing Tool!

    love the look and feel of that.. did you use any of the code from my updated version? or is this completely your own update.. I will take a look at it when its available.. I nearly have the payment modules working.. and would be a nice addition as well J
  6. insaini

    NEW! Complete Order Editing Tool!

    well if you look at edit_orders.php .. at the very top you will see a lot of $oID .. they might be in $_POST[$oID] you need to change these to your function tep_trans_id($raw_date, $oID); or like tep_trans_id($raw_date, $_POST[$oID]); however their may be a simpler way of doing this.. first a couple questions.. are you editing orders created by the customer or orders created from the order create in admin? if you are editing orders created by the customer.. then when edit_orders.php is loaded .. it already has the order id.. its usually in the URL something like http://www.something.com/catalog/admin/edi...ders.php?oID=12 (for example) try editing an order and seeing what the URL has in it. if it says order id not found and you have something simple like oID=12 then your order_id in orders.php isnt being loaded correctly.. if it something like oID=1243545 (date combined) .. then edit_orders isnt reading that order_id from the database correctly.. another question is.. what is the order number being stored in the database.. is it a simple number like 12 or is it complex.. if it is complex.. then the query to the database should include a complex number.. I dont see why edit_orders.php would have a problem with that order_id that you have.. but take a look and post what you see J
  7. insaini

    NEW! Complete Order Editing Tool!

    basically your going to have to install that order number contribution into the admin side as well.. you probably already did modify some files but yes youre going to have to modify edit_orders.php in pretty much the same way you did the other files. J
  8. insaini

    NEW! Complete Order Editing Tool!

    yup that sounds it exactly.. you need to change that everywhere $oID is used.. and that isnt just edit_orders.php .. might have to edit order_cart.php as well .. but basically take a look at the files in the contribtion.. but start with just edit_order.php and test that.. if it still not functioning as it should.. then go to the other files.. $oID is used in a lot of places so you have to change all of them J
  9. insaini

    NEW! Complete Order Editing Tool!

    hmm.. so you modified the 4 files austpost.php austpostair.php austpostexpress.php austpostsea.php hmm well the only suggestion i have for right now is to double check all your uses of 'iso_code_2' specifically where you changed your code from $order->delivery['country']['iso_code_2'] to something like $dest_country['countries_iso_code_2'] .. you need to use 'countries_iso_code_2' and not just 'iso_code_2' .. I checked the files and austpost.php has 1 occurance of 'iso_code_2' .. air and sea have 3 and express has 2 i think.. but just double check make sure everything that needs to be changed was .. if still no progress then ill look into installing it.. last thing i suggest is to use some echo's and see what the values are for example just put in an echo line under your $dest_country.... line.. echo $dest_country['countries_iso_code_2'] . 'hello' ; ... see if it prints out something .. or just prints hello.. maybe thats telling you that the value is not getting there and something above it is going wrong.. that would help me to understand where the problem is happening also. J
  10. insaini

    NEW! Complete Order Editing Tool!

    Update on payment processing.. closing in on having this added. I would say a few more days and it should be uploaded. J
  11. insaini

    NEW! Complete Order Editing Tool!

    BAH! Slight error in 4.0.2 OPEN admin/edit_orders.php Find near line 575 $Query = "UPDATE " . TABLE_ORDERS_TOTAL . " SET title = '" . $shipping['title'] . "' WHERE class = 'ot_tax' AND orders_id = '" . (int)$oID . "'"; tep_db_query($Query); Replace with $Query = "UPDATE " . TABLE_ORDERS_TOTAL . " SET title = '" . $shipping['title'] . "' WHERE class = 'ot_shipping' AND orders_id = '" . (int)$oID . "'"; tep_db_query($Query); My bad on that J
  12. insaini

    Tax displayed on seperate lines

    double check because youre only modifying a few lines of code in a i think 4 files.. the most important part is setting up the taxes.. but remember this is for a fresh install.. if you have other mods.. you may need to modify additional code..
  13. insaini

    NEW! Complete Order Editing Tool!

    4.0.2 has been uploaded and includes all the updates over the past few pages. Includes the usps.php updated shipping module for use with OE 4.0
  14. insaini

    NEW! Complete Order Editing Tool!

    I wounldnt add that line to application_top.php as its specific to only edit_orders.php I really suggest you put it there. As for the 'require(DIR_FS_CATALOG . 'includes/classes/shipping.php'); and $shipping_modules = new shipping;' Could you also have this in application_top? you need this for real-time quote functionality.. unless its being declared somewhere else like application_top.php .. also check to make sure that this file shipping.php is not in admin/includes/classes .. it should be in catalog/includes/classes .. if you get the error again.. post it .. the top of my edit_orders.php looks like this // First things first: get the required includes, classes, etc. require('includes/application_top.php'); require('includes/classes/http_client.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); require(DIR_WS_FUNCTIONS . 'oe_functions.php'); require(DIR_WS_CLASSES . 'oe_order.php'); // include order cart class require(DIR_WS_CLASSES . 'order_cart.php'); // load all enabled shipping modules require(DIR_FS_CATALOG . 'includes/classes/shipping.php'); $shipping_modules = new shipping; // define the number of custom charge fields define(CUSTOM_FIELDS, 3); if (isset($_POST['total_order_weight'])) { $total_weight = $_POST['total_order_weight']; } else { $total_weight = 0; } // create the order cart & fix the cart if necesary if (tep_session_is_registered('cart') && is_object($cart)) { if (PHP_VERSION < 4) { $broken_cart = $cart; $cart = new orderCart((int)$_GET['oID']); $cart->unserialize($broken_cart); } else { $cart = new orderCart((int)$_GET['oID']); } } else { tep_session_register('cart'); $cart = new orderCart((int)$_GET['oID']); }
  15. insaini

    NEW! Complete Order Editing Tool!

    ok I found the module Austpost 3.01 in the contributions.. released recently.. it seems there are a lot of module files that need to be modified ... not just one.. you have these files (i hope you copied all of them) ... 4 that begin with austpost and 4 that begin with insured you need to copy all of these over as well as their respective language files.. all your icons and gifs must also be copied over.. after that you have to do all the modifications i told you to above.. and do those mods in each of those 8 files that you have copied to your admin/modules/shipping folder specifically the changes you need to make is change all your $order->delivery['country']['id] to $order->delivery['country_id'] as well as $dest_country = tep_get_countries_iso($order->delivery['country_id'], true); you need add this part .. just take a look at the modifications suggested above.. and make sure its consistent with each file.. nearly all files look the same.. so it should be clear where you have to put those mods and what lines you need to change.. let me know J
  16. insaini

    NEW! Complete Order Editing Tool!

    Ok so it definitely seems like your module.. is this module in the contributions section.. provide me a link and let me see if there are other modifications needed J
  17. insaini

    NEW! Complete Order Editing Tool!

    Hmm.. I think if you go back a couple pages there may be an edit that you missed.. specifically make sure you have this line at the top OPEN admin/edit_orders.php Find line 26: require(DIR_WS_FUNCTIONS . 'oe_functions.php'); require(DIR_WS_CLASSES . 'oe_order.php'); Add below it // include order cart class require(DIR_WS_CLASSES . 'order_cart.php');
  18. insaini

    NEW! Complete Order Editing Tool!

    Great.. post any problems or anything that you think doesnt function as it should.. let us know how well it works also :thumbsup: J
  19. insaini

    NEW! Complete Order Editing Tool!

    yes only in the admin directory.. did you also do the new updates above? i suggest you do those as well
  20. insaini

    NEW! Complete Order Editing Tool!

    =D everyone is going to have this problem.. since i have the usps.php file.. let me see if i can find what exactly you need to update Find on line 30 $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); Replace with $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country_id'] . "' order by zone_id"); ----------------- Find on line 106 $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); Replace with $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country_id'], $order->delivery['zone_id']); ----------------- Find on line 170 if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { Replace with if ($order->delivery['country_id'] == SHIPPING_ORIGIN_COUNTRY) { ---------------- Find on line 178 $dest_zip = str_replace(' ', '', $order->delivery['postcode']); if ($order->delivery['country']['iso_code_2'] == 'US') $dest_zip = substr($dest_zip, 0, 5); Replace With $dest_zip = str_replace(' ', '', $order->delivery['postcode']); $dest_country = tep_get_countries_iso($order->delivery['country_id'], true); if ($dest_country['iso_code_2'] == 'US') $dest_zip = substr($dest_zip, 0, 5); -------------- Find on line 205 '<Country>' . $this->countries[$order->delivery['country']['iso_code_2']] . '</Country>' . Replace with '<Country>' . $this->countries[$dest_country['iso_code_2']] . '</Country>' . -------------- Find on line 250 if ($order->delivery['country']['id] == SHIPPING_ORIGIN_COUNTRY) { Replace With if ($order->delivery['country_id'] == SHIPPING_ORIGIN_COUNTRY) { --------------- That should be it :thumbsup:
  21. insaini

    NEW! Complete Order Editing Tool!

    problem found.. require('includes/classes/http_client.php'); please add this to the top of edit_orders.php how is it now?
  22. insaini

    NEW! Complete Order Editing Tool!

    ? hehe is that to mean it still doesnt work.. ? you should be getting a different error now.. or is it the same still ?
  23. insaini

    NEW! Complete Order Editing Tool!

    Ok a few more updates ... please make these changes.. OPEN admin/orders.php Find on line 15 require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); Add below it tep_session_unregister('quotes'); tep_session_unregister('shipping'); tep_session_unregister('updated_shipping'); ----------------- OPEN admin/edit_orders.php Find on line 449 if($ot_total_id > 0) { // Already in database --> Update $Query = "UPDATE " . TABLE_ORDERS_TOTAL . " SET title = '" . $ot_title . "', text = '" . $ot_text . "', value = '" . $ot_value . "', sort_order = '" . $sort_order . "' WHERE orders_total_id = '". $ot_total_id . "' AND orders_id = '" . (int)$oID . "'"; tep_db_query($Query); Replace With if($ot_total_id > 0) { // Already in database --> Update $Query = "UPDATE " . TABLE_ORDERS_TOTAL . " SET text = '" . $ot_text . "', value = '" . $ot_value . "', sort_order = '" . $sort_order . "' WHERE orders_total_id = '". $ot_total_id . "' AND orders_id = '" . (int)$oID . "'"; tep_db_query($Query); ---------------- Find on line 558 // save method to ORDERS TABLE $Query = 'UPDATE ' . TABLE_ORDERS . ' set shipping_method = "'. $shipping['title'] .'" WHERE orders_id = "' . (int)$oID . '"'; tep_db_query($Query); Add below it $Query = "UPDATE " . TABLE_ORDERS_TOTAL . " SET title = '" . $shipping['title'] . "' WHERE class = 'ot_tax' AND orders_id = '" . (int)$oID . "'"; tep_db_query($Query); ----------- Find on line 606 if ($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping) { $shipping = array('id' => $shipping, 'title' => ($quotes[$i]['module'] . ' (' . $quotes[$i]['methods'][$j]['title'] . ')'), 'cost' => $quotes[$i]['methods'][$j]['cost']); } Replace with if ($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping) { $shipping = array('id' => $shipping, 'title' => ($quotes[$i]['module'] . ' (' . $quotes[$i]['methods'][$j]['title'] . ')'), 'cost' => $quotes[$i]['methods'][$j]['cost']); $Query = "UPDATE " . TABLE_ORDERS_TOTAL . " SET title = '" . $shipping['title'] . "' WHERE class = 'ot_shipping' AND orders_id = '" . (int)$oID . "'"; tep_db_query($Query); } ----------------- Find on line 1056 if (!tep_session_is_registered('order')) { tep_session_register('order'); } $oID = tep_db_prepare_input($_GET['oID']); $order = new oe_order($oID); Add Below it if ($order->info['shipping_method'] == null) { $Query = "SELECT title FROM " . TABLE_ORDERS_TOTAL . " WHERE class = 'ot_shipping' AND orders_id = '" . (int)$oID . "'"; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $order->info['shipping_method'] = $row['title']; } ---------------- Find around line 2422 for ($i=0; $i<sizeof($order->totals); $i++) { $TotalsLengthArray[] = array("Name" => $order->totals[$i]['title']); } reset($TotalsLengthArray); foreach($TotalsLengthArray as $TotalIndex => $TotalDetails) { if (strlen($TotalDetails["Name"]) > $max_length) { $max_length = strlen($TotalDetails["Name"]); } } Replace With for ($i=0; $i<sizeof($order->totals); $i++) { $TotalsLengthArray[] = array("Name" => $order->totals[$i]['title'], "Class" => $order->totals[$i]['class']); } reset($TotalsLengthArray); foreach($TotalsLengthArray as $TotalIndex => $TotalDetails) { if ($TotalDetails["Class"] != "ot_shipping" && strlen($TotalDetails["Name"]) > $max_length) { $max_length = strlen($TotalDetails["Name"]); } } ---------------------------- =D
  24. insaini

    NEW! Complete Order Editing Tool!

    open your usps.php file .. and go to line 289 .. there might be another class file which you may need to copy over to the admin class folder.. looks to be ..yup http_class.php .. this file needs to be copied over to admin/includes/classes give that a try
  25. insaini

    NEW! Complete Order Editing Tool!

    If you havent dont these changes .. do them now OPEN admin/edit_orders.php Find line 26: require(DIR_WS_FUNCTIONS . 'oe_functions.php'); require(DIR_WS_CLASSES . 'oe_order.php'); Add below it // include order cart class require(DIR_WS_CLASSES . 'order_cart.php'); --------- Find on line 36 // define the number of custom charge fields define(CUSTOM_FIELDS, 3); Add below it if (isset($_POST['total_order_weight'])) { $total_weight = $_POST['total_order_weight']; } else { $total_weight = 0; } ---------- Find on line 593 $shipping = $_POST['shipping']; Replace with if (isset($_POST['shipping'])) { $shipping = $_POST['shipping']; } -------- Find on line 1836 <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('update_customer_country_id', tep_get_countries(), tep_get_country_id($order->customer['country']), 'onchange="update_zone(this.form, \'update_customer_country_id\', \'update_customer_zone_id\', \'customerStateInput\', \'customerStateMenu\');"'); ?></td> Replace with <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('update_customer_country_id', tep_get_countries(), $order->customer['country_id'], 'onchange="update_zone(this.form, \'update_customer_country_id\', \'update_customer_zone_id\', \'customerStateInput\', \'customerStateMenu\');"'); ?></td> --------- Find on line 1896 <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('update_delivery_country_id', tep_get_countries(), tep_get_country_id($order->delivery['country']), 'onchange="update_zone(this.form, \'update_delivery_country_id\', \'update_delivery_zone_id\', \'deliveryStateInput\', \'deliveryStateMenu\');"'); ?></td> Replace with <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('update_delivery_country_id', tep_get_countries(), $order->delivery['country_id'], 'onchange="update_zone(this.form, \'update_delivery_country_id\', \'update_delivery_zone_id\', \'deliveryStateInput\', \'deliveryStateMenu\');"'); ?></td> ----------- Find on line 1951 <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('update_billing_country_id', tep_get_countries(), tep_get_country_id($order->billing['country']), 'onchange="update_zone(this.form, \'update_billing_country_id\', \'update_billing_zone_id\', \'billingStateInput\', \'billingStateMenu\');"'); ?></td> Replace with <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('update_billing_country_id', tep_get_countries(), $order->billing['country_id'], 'onchange="update_zone(this.form, \'update_billing_country_id\', \'update_billing_zone_id\', \'billingStateInput\', \'billingStateMenu\');"'); ?></td>
×