Jump to content
jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

hi

 

got a strange issue.i made few changes to edit_orders to get subtotal excluding vat to work(thanks to djmonkey1 for his help).Now the problem i have it dat when a customers places a order the calculation are all okay. vat gets added to the shipping.and the total includes tax for shipping and products.when i click on edit order to update order process and click on update the total changes changes .It now excludes shipping tax.

 

any help would be appreciated.

 

What version of Order Editor are you using?


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.

Share this post


Link to post
Share on other sites
It's not in application_top.php and is no where else I'm aware of. We are using the multi-geo shipping and individual shipping contribs if that helps. It seems to work fine with that commented out though, but obviously the shipping part is not working...

 

is it possible there are 2 $cart session variables being declared?

 

you said youre using a recover cart contribution.. did that happen to modify the shipping.php file? .. in edit_orders.php there is a $cart variable which is an object of the class order_cart.php .. just to check that there isnt another $cart variable being declared somewhere which is overwriting the $cart ive created and using with order_cart

 

j

Share this post


Link to post
Share on other sites

Hello,

 

I have a problem with this contribution:

 

I have also instalkled "discount payment type". When a client is eligible for the discount, this amount appears as a positive amount.

If I wen to update such an order, I have a rpoblem with the total. As soon as i click on "update", the amount of the discount is added instead of being subtracted!

 

Currently, I am using an old version of order editor (2.8.2 or something like that). I would liek to know if the problem that I have is solves in the next versions. As it is the only problem that I have, I don't need to update this contribution if the problem is not solved in next versions...

 

Thanks in advance for your comments

Share this post


Link to post
Share on other sites
Hello,

 

I have a problem with this contribution:

 

I have also instalkled "discount payment type". When a client is eligible for the discount, this amount appears as a positive amount.

If I wen to update such an order, I have a rpoblem with the total. As soon as i click on "update", the amount of the discount is added instead of being subtracted!

 

Currently, I am using an old version of order editor (2.8.2 or something like that). I would liek to know if the problem that I have is solves in the next versions. As it is the only problem that I have, I don't need to update this contribution if the problem is not solved in next versions...

 

Thanks in advance for your comments

 

This would be fairly easy to fix in v2.8.2. I still haven't gotten a chance to look at 4.0, and as far as 5.0 is concerned I'd say you'd have to test it to see how it would go. What is the class value of the discount as stored in the orders_total table? It should be something like ot_discount or something like that.


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.

Share this post


Link to post
Share on other sites
This would be fairly easy to fix in v2.8.2. I still haven't gotten a chance to look at 4.0, and as far as 5.0 is concerned I'd say you'd have to test it to see how it would go. What is the class value of the discount as stored in the orders_total table? It should be something like ot_discount or something like that.

 

as far as I know.. the discount has to be applied as a negative value .. if on the customer side its applied with a positive value and its reduced.. thats simply the math..

 

in 2.8.2 as well as in 4.0 I guess to be consistent.. a positive value should reduce the price .. however I know for sure that in 4.0 it does not.. but again this is just a simple fix.. you put a '-' where you see the '+' :thumbsup:

 

J

Share this post


Link to post
Share on other sites

Shipping tax fix for Order Editor 5.0 BETA 1 (note that these instructions assume that you have already made the bugfixes from posts 2126, 2130, and 2167):

 

Run the following command on your MySQL database:

  function setShipping(method) {
       if (document.getElementById("ot_shipping[title]")) {
       document.getElementById("ot_shipping[title]").value = document.getElementById("update_shipping["+method+"][title]").value;
       document.getElementById("ot_shipping[value]").value = document.getElementById("update_shipping["+method+"][value]").value;
       obtainTotals();
       } else {

                 if (confirm('<?php echo AJAX_SELECTED_NO_SHIPPING; ?>')) {

               createRequest();
               var title = document.getElementById("update_shipping["+method+"][title]").value;
               var value = document.getElementById("update_shipping["+method+"][value]").value;
               var sort_order = "<?php echo MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER ?>";
               var url = "<?php echo FILENAME_ORDERS_EDIT_AJAX; ?>?action=insert_shipping&title=" + title + "&value=" + value + "&sort_order=" + sort_order + "&oID=<?php echo $_GET['oID']; ?>";
               xmlHttp.open("GET", url, true);

               xmlHttp.onreadystatechange=
     function(){if(xmlHttp.readyState!=4)return;if(xmlHttp.status==200){reloadDiv('totalsBlock', xmlHttp.responseText);}};

               xmlHttp.send(null);

            }
         }
      }

and change it to

  function setShipping(method) {
       if (document.getElementById("ot_shipping[title]")) {
       document.getElementById("ot_shipping[title]").value = document.getElementById("update_shipping["+method+"][title]").value;
       document.getElementById("ot_shipping[value]").value = document.getElementById("update_shipping["+method+"][value]").value;
       document.getElementById("ot_shipping[id]").value = document.getElementById("update_shipping["+method+"][id]").value
       obtainTotals();
       } else {

                 if (confirm('<?php echo AJAX_SELECTED_NO_SHIPPING; ?>')) {

               createRequest();
               var title = document.getElementById("update_shipping["+method+"][title]").value;
               var value = document.getElementById("update_shipping["+method+"][value]").value;
               var id = document.getElementById("update_shipping["+method+"][id]").value;
               var sort_order = "<?php echo MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER ?>";
               var url = "<?php echo FILENAME_ORDERS_EDIT_AJAX; ?>?action=insert_shipping&title=" + title + "&id=" + id + "&value=" + value + "&sort_order=" + sort_order + "&oID=<?php echo $_GET['oID']; ?>";
               xmlHttp.open("GET", url, true);

               xmlHttp.onreadystatechange=
     function(){if(xmlHttp.readyState!=4)return;if(xmlHttp.status==200){reloadDiv('totalsBlock', xmlHttp.responseText);}};

               xmlHttp.send(null);

            }
         }
      }

 

Find in admin/edit_orders_ajax.php at about line 140 (line numbers are very important when working with this file as some code is repeated within different action blocks)

	   $oID = $_POST['oID'];
   $shipping = array();

      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") {
           $shipping['cost'] = $ot_value;
           $shipping['title'] = $ot_title;
          } // end if ($ot_class == "ot_shipping")
        } //end foreach
   } //end if is_array


       $order = new manualOrder($oID);

        $cart = new manualCart();
        $cart->restore_contents($oID);
        $total_count = $cart->count_contents();
        $total_weight = $cart->show_weight();

         //this is where we call the order total modules
        require( 'order_editor/order_total.php');
        $order_total_modules = new order_total();
        $order_totals = $order_total_modules->process();


    $current_ot_totals_array = array();
	$current_ot_titles_array = array();
	$written_ot_totals_array = array();
	$written_ot_titles_array = array();
	//how many weird arrays can I make today?

and change it to

	   $oID = $_POST['oID'];
   $shipping = array();

      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") {

		$shipping['cost'] = $ot_value;
           $shipping['title'] = $ot_title;
		$shipping['id'] = $ot_id;

          } // end if ($ot_class == "ot_shipping")
        } //end foreach
   } //end if is_array

  if (tep_not_null($shipping['id'])) {
   tep_db_query("UPDATE " . TABLE_ORDERS . " SET shipping_module = '" . $shipping['id'] . "' WHERE orders_id = '" . $_POST['oID'] . "'");
   }

	$order = new manualOrder($oID);
	$order->adjust_zones();

	$cart = new manualCart();
       $cart->restore_contents($oID);
       $total_count = $cart->count_contents();
       $total_weight = $cart->show_weight();

	// Get the shipping quotes
       $shipping_modules = new shipping;
       $shipping_quotes = $shipping_modules->quote();

	if (DISPLAY_PRICE_WITH_TAX == 'true') {//extract the base shipping cost or the ot_shipping module will add tax to it again
	   $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
	   $tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          $order->info['shipping_cost'] = ($order->info['shipping_cost'] / (1 + ($tax /100))); 
	   }

		//this is where we call the order total modules
	require( 'order_editor/order_total.php');
	$order_total_modules = new order_total();
       $order_totals = $order_total_modules->process();  

    $current_ot_totals_array = array();
	$current_ot_titles_array = array();
	$written_ot_totals_array = array();
	$written_ot_titles_array = array();
	//how many weird arrays can I make today?

 

Find in same file admin/edit_orders_ajax.php at about line 314

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' .
            '                   
   <td class="dataTableContent" valign="top" align="left" width="15px">

   <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">

   <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

   <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
            '                    
            <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
            '                    
            <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

and change it to

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" .

   '      <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" .

   '      <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">' . "\n" .

   '      <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" .

   '      <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .

   '      <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" .

   '        <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 

   '        <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

 

Next find in same file admin/edit_orders_ajax.php at about line 585

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' .
            '                   
   <td class="dataTableContent" valign="top" align="left" width="15px">

   <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">

   <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

   <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
            '                    
            <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
            '                    
            <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

and change it to

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" .

   '   <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" .

   '   <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">' . "\n" .

   '   <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" .

   '   <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .

   '      <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" .

            '<td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 

            '<td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

 

Next move on to admin/edit_orders.php and find there at about line 303

      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") {
             $shipping['cost'] = $ot_value;
             $shipping['title'] = $ot_title;

           } // end if ($ot_class == "ot_shipping")
         } //end foreach
       } //end if is_array


         $order = new manualOrder($oID);

         $cart = new manualCart();
         $cart->restore_contents($oID);
         $total_count = $cart->count_contents();
         $total_weight = $cart->show_weight();

         //this is where we call the order total modules

and change it to

      $shipping = array();

       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") {

                $shipping['cost'] = $ot_value;
                $shipping['title'] = $ot_title;
                $shipping['id'] = $ot_id;

           } // end if ($ot_class == "ot_shipping")
         } //end foreach
       } //end if is_array

      if (tep_not_null($shipping['id'])) {
  tep_db_query("UPDATE " . TABLE_ORDERS . " SET shipping_module = '" . $shipping['id'] . "' WHERE orders_id = '" . (int)$oID . "'");
      }      

         $order = new manualOrder($oID);
         $order->adjust_zones();

         $cart = new manualCart();
         $cart->restore_contents($oID);
         $total_count = $cart->count_contents();
         $total_weight = $cart->show_weight();

         // Get the shipping quotes- if we don't have shipping quotes shipping tax calculation can't happen
         $shipping_modules = new shipping;
         $shipping_quotes = $shipping_modules->quote();


         if (DISPLAY_PRICE_WITH_TAX == 'true') {//extract the base shipping cost or the ot_shipping module will add tax to it again
            $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
            $tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
            $order->info['shipping_cost'] = ($order->info['shipping_cost'] / (1 + ($tax /100))); 
            }

         //this is where we call the order total modules

 

Next in the same file admin/edit_orders.php find at about line 1306

	$id = $order->totals[$i]['class'];

		 $rowStyle = (($i % 2) ? 'dataTableRowOver' : 'dataTableRow');

and change it to

	$id = $order->totals[$i]['class'];

		 if ($order->totals[$i]['class'] == 'ot_shipping') {
			if (tep_not_null($order->info['shipping_id'])) {
				$shipping_module_id = $order->info['shipping_id'];
				} else {
				//here we could create logic to attempt to determine the shipping module used if it's not in the database
				$shipping_module_id = '';
				}
		   } else {
			 $shipping_module_id = '';
		   } //end if ($order->totals[$i]['class'] == 'ot_shipping') {

		 $rowStyle = (($i % 2) ? 'dataTableRowOver' : 'dataTableRow');

 

Next find in the same file admin/edit_orders.php at about line 1359

		   '					<td align="right" class="dataTableContent"><input name="update_totals['.$i.'][value]" id="'.$id.'[value]" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '" size="6" onChange="obtainTotals()"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"></td>' . "\n";

and change it to

		   '					<td align="right" class="dataTableContent"><input name="update_totals['.$i.'][value]" id="'.$id.'[value]" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '" size="6" onChange="obtainTotals()"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"><input name="update_totals['.$i.'][id]" type="hidden" value="' . $shipping_module_id . '" id="' . $id . '[id]"></td>' . "\n";

 

Next find in the same file admin/edit_orders.php at about line 1395

			 <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">
				  <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
				  '					<td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
				  '					<td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
				  '				  </tr>';

and change it to

			 <input type="hidden" id="update_shipping[' . $r . '][title]" name="update_shipping[' . $r . '][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" .
				  '	  <input type="hidden" id="update_shipping[' . $r . '][value]" name="update_shipping[' . $r . '][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
				  '	  <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" .
				  '	  <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
				  '	  <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
				  '				  </tr>';

 

When editing any order placed prior to making this change, in order to ensure shipping tax is computed properly you should overwrite the shipping quote included with the order totals with a fresh real-time quote from the same module, even if it is identical (it doesn't have to be the same module as long as both and/or all modules involved are in the same tax class). If you want to customize the name and/or value of the shipping quote you can then do so.


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.

Share this post


Link to post
Share on other sites

Great update.

 

Trying to install on a vanilla OSC installation - but getting the following error:

 

 

Warning: main(): open_basedir restriction in effect. File(/usr/www/users/ngrcfb/includes/classes/http_client.php) is not within the allowed path(s): (/usr/wwws/users/ngrcfb:/usr/home/ngrcfb:/tmp:/usr/local/lib/php) in /usr/wwws/users/ngrcfb/admin/edit_orders.php on line 36

 

Warning: main(/usr/www/users/ngrcfb/includes/classes/http_client.php): failed to open stream: Operation not permitted in /usr/wwws/users/ngrcfb/admin/edit_orders.php on line 36

 

Fatal error: main(): Failed opening required '/usr/www/users/ngrcfb/includes/classes/http_client.php' (include_path='.:/usr/local/lib/php/') in /usr/wwws/users/ngrcfb/admin/edit_orders.php on line 36

 

Anyone perhaps know a workaround?

Share this post


Link to post
Share on other sites
Great update.

 

Trying to install on a vanilla OSC installation - but getting the following error:

 

 

Warning: main(): open_basedir restriction in effect. File(/usr/www/users/ngrcfb/includes/classes/http_client.php) is not within the allowed path(s): (/usr/wwws/users/ngrcfb:/usr/home/ngrcfb:/tmp:/usr/local/lib/php) in /usr/wwws/users/ngrcfb/admin/edit_orders.php on line 36

 

Warning: main(/usr/www/users/ngrcfb/includes/classes/http_client.php): failed to open stream: Operation not permitted in /usr/wwws/users/ngrcfb/admin/edit_orders.php on line 36

 

Fatal error: main(): Failed opening required '/usr/www/users/ngrcfb/includes/classes/http_client.php' (include_path='.:/usr/local/lib/php/') in /usr/wwws/users/ngrcfb/admin/edit_orders.php on line 36

 

Anyone perhaps know a workaround?

 

I'm assuming from the description that you are trying to install v5.0.

 

It sounds like you have bad settings on your server or a problem with your configuration file. If you have an open_basedir restriction that prevents you from loading a file on the catalog side into the admin side, how can you install or modify payment or shipping modules? In the event that your server settings for open_basedir are correct, I would look at your configure file admin/includes/configure.php, specifically the settings DIR_FS_DOCUMENT_ROOT and DIR_WS_CLASSES. However, it seems like if either/both of those were incorrect you would be having other problems.

 

That being said, you can try this: copy the file catalog/includes/classes/http_client.php into the folder admin/order_editor (do not delete the file from it's original folder, you will still need it there).

 

Then in each of the two files admin/edit_orders.php and admin/edit_orders_ajax.php find the following code:

require(DIR_FS_DOCUMENT_ROOT . DIR_WS_CLASSES . 'http_client.php');

and change each instance (it should only occur once per file) to

require('order_editor/http_client.php');

 

Please let us know how this goes; if your settings and configuration are otherwise correct, I may start including the http_client file with future releases to prevent this from happening again.


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.

Share this post


Link to post
Share on other sites
Shipping tax fix for Order Editor 5.0 BETA 1 (note that these instructions assume that you have already made the bugfixes from posts 2126, 2130, and 2167):

 

Run the following command on your MySQL database:

  function setShipping(method) {
       if (document.getElementById("ot_shipping[title]")) {
       document.getElementById("ot_shipping[title]").value = document.getElementById("update_shipping["+method+"][title]").value;
       document.getElementById("ot_shipping[value]").value = document.getElementById("update_shipping["+method+"][value]").value;
       obtainTotals();
       } else {

                 if (confirm('<?php echo AJAX_SELECTED_NO_SHIPPING; ?>')) {

               createRequest();
               var title = document.getElementById("update_shipping["+method+"][title]").value;
               var value = document.getElementById("update_shipping["+method+"][value]").value;
               var sort_order = "<?php echo MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER ?>";
               var url = "<?php echo FILENAME_ORDERS_EDIT_AJAX; ?>?action=insert_shipping&title=" + title + "&value=" + value + "&sort_order=" + sort_order + "&oID=<?php echo $_GET['oID']; ?>";
               xmlHttp.open("GET", url, true);

               xmlHttp.onreadystatechange=
     function(){if(xmlHttp.readyState!=4)return;if(xmlHttp.status==200){reloadDiv('totalsBlock', xmlHttp.responseText);}};

               xmlHttp.send(null);

            }
         }
      }

and change it to

  function setShipping(method) {
       if (document.getElementById("ot_shipping[title]")) {
       document.getElementById("ot_shipping[title]").value = document.getElementById("update_shipping["+method+"][title]").value;
       document.getElementById("ot_shipping[value]").value = document.getElementById("update_shipping["+method+"][value]").value;
       document.getElementById("ot_shipping[id]").value = document.getElementById("update_shipping["+method+"][id]").value
       obtainTotals();
       } else {

                 if (confirm('<?php echo AJAX_SELECTED_NO_SHIPPING; ?>')) {

               createRequest();
               var title = document.getElementById("update_shipping["+method+"][title]").value;
               var value = document.getElementById("update_shipping["+method+"][value]").value;
               var id = document.getElementById("update_shipping["+method+"][id]").value;
               var sort_order = "<?php echo MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER ?>";
               var url = "<?php echo FILENAME_ORDERS_EDIT_AJAX; ?>?action=insert_shipping&title=" + title + "&id=" + id + "&value=" + value + "&sort_order=" + sort_order + "&oID=<?php echo $_GET['oID']; ?>";
               xmlHttp.open("GET", url, true);

               xmlHttp.onreadystatechange=
     function(){if(xmlHttp.readyState!=4)return;if(xmlHttp.status==200){reloadDiv('totalsBlock', xmlHttp.responseText);}};

               xmlHttp.send(null);

            }
         }
      }

 

Find in admin/edit_orders_ajax.php at about line 140 (line numbers are very important when working with this file as some code is repeated within different action blocks)

	   $oID = $_POST['oID'];
   $shipping = array();

      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") {
           $shipping['cost'] = $ot_value;
           $shipping['title'] = $ot_title;
          } // end if ($ot_class == "ot_shipping")
        } //end foreach
   } //end if is_array


       $order = new manualOrder($oID);

        $cart = new manualCart();
        $cart->restore_contents($oID);
        $total_count = $cart->count_contents();
        $total_weight = $cart->show_weight();

         //this is where we call the order total modules
        require( 'order_editor/order_total.php');
        $order_total_modules = new order_total();
        $order_totals = $order_total_modules->process();


    $current_ot_totals_array = array();
	$current_ot_titles_array = array();
	$written_ot_totals_array = array();
	$written_ot_titles_array = array();
	//how many weird arrays can I make today?

and change it to

	   $oID = $_POST['oID'];
   $shipping = array();

      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") {

		$shipping['cost'] = $ot_value;
           $shipping['title'] = $ot_title;
		$shipping['id'] = $ot_id;

          } // end if ($ot_class == "ot_shipping")
        } //end foreach
   } //end if is_array

  if (tep_not_null($shipping['id'])) {
   tep_db_query("UPDATE " . TABLE_ORDERS . " SET shipping_module = '" . $shipping['id'] . "' WHERE orders_id = '" . $_POST['oID'] . "'");
   }

	$order = new manualOrder($oID);
	$order->adjust_zones();

	$cart = new manualCart();
       $cart->restore_contents($oID);
       $total_count = $cart->count_contents();
       $total_weight = $cart->show_weight();

	// Get the shipping quotes
       $shipping_modules = new shipping;
       $shipping_quotes = $shipping_modules->quote();

	if (DISPLAY_PRICE_WITH_TAX == 'true') {//extract the base shipping cost or the ot_shipping module will add tax to it again
	   $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
	   $tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          $order->info['shipping_cost'] = ($order->info['shipping_cost'] / (1 + ($tax /100))); 
	   }

		//this is where we call the order total modules
	require( 'order_editor/order_total.php');
	$order_total_modules = new order_total();
       $order_totals = $order_total_modules->process();  

    $current_ot_totals_array = array();
	$current_ot_titles_array = array();
	$written_ot_totals_array = array();
	$written_ot_titles_array = array();
	//how many weird arrays can I make today?

 

Find in same file admin/edit_orders_ajax.php at about line 314

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' .
            '                   
   <td class="dataTableContent" valign="top" align="left" width="15px">

   <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">

   <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

   <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
            '                    
            <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
            '                    
            <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

and change it to

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" .

   '      <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" .

   '      <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">' . "\n" .

   '      <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" .

   '      <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .

   '      <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" .

   '        <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 

   '        <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

 

Next find in same file admin/edit_orders_ajax.php at about line 585

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' .
            '                   
   <td class="dataTableContent" valign="top" align="left" width="15px">

   <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">

   <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

   <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
            '                    
            <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
            '                    
            <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

and change it to

<?php
   $r = 0;
   for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
     for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
       $r++;
       $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow');
       echo '                  <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" .

   '   <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" .

   '   <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">' . "\n" .

   '   <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" .

   '   <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .

   '      <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" .

            '<td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 

            '<td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
            '                  </tr>';
     }
   }
?>

 

Next move on to admin/edit_orders.php and find there at about line 303

      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") {
             $shipping['cost'] = $ot_value;
             $shipping['title'] = $ot_title;

           } // end if ($ot_class == "ot_shipping")
         } //end foreach
       } //end if is_array


         $order = new manualOrder($oID);

         $cart = new manualCart();
         $cart->restore_contents($oID);
         $total_count = $cart->count_contents();
         $total_weight = $cart->show_weight();

         //this is where we call the order total modules

and change it to

      $shipping = array();

       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") {

                $shipping['cost'] = $ot_value;
                $shipping['title'] = $ot_title;
                $shipping['id'] = $ot_id;

           } // end if ($ot_class == "ot_shipping")
         } //end foreach
       } //end if is_array

      if (tep_not_null($shipping['id'])) {
  tep_db_query("UPDATE " . TABLE_ORDERS . " SET shipping_module = '" . $shipping['id'] . "' WHERE orders_id = '" . (int)$oID . "'");
      }      

         $order = new manualOrder($oID);
         $order->adjust_zones();

         $cart = new manualCart();
         $cart->restore_contents($oID);
         $total_count = $cart->count_contents();
         $total_weight = $cart->show_weight();

         // Get the shipping quotes- if we don't have shipping quotes shipping tax calculation can't happen
         $shipping_modules = new shipping;
         $shipping_quotes = $shipping_modules->quote();


         if (DISPLAY_PRICE_WITH_TAX == 'true') {//extract the base shipping cost or the ot_shipping module will add tax to it again
            $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
            $tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
            $order->info['shipping_cost'] = ($order->info['shipping_cost'] / (1 + ($tax /100))); 
            }

         //this is where we call the order total modules

 

Next in the same file admin/edit_orders.php find at about line 1306

	$id = $order->totals[$i]['class'];

		 $rowStyle = (($i % 2) ? 'dataTableRowOver' : 'dataTableRow');

and change it to

	$id = $order->totals[$i]['class'];

		 if ($order->totals[$i]['class'] == 'ot_shipping') {
			if (tep_not_null($order->info['shipping_id'])) {
				$shipping_module_id = $order->info['shipping_id'];
				} else {
				//here we could create logic to attempt to determine the shipping module used if it's not in the database
				$shipping_module_id = '';
				}
		   } else {
			 $shipping_module_id = '';
		   } //end if ($order->totals[$i]['class'] == 'ot_shipping') {

		 $rowStyle = (($i % 2) ? 'dataTableRowOver' : 'dataTableRow');

 

Next find in the same file admin/edit_orders.php at about line 1359

		   '					<td align="right" class="dataTableContent"><input name="update_totals['.$i.'][value]" id="'.$id.'[value]" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '" size="6" onChange="obtainTotals()"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"></td>' . "\n";

and change it to

		   '					<td align="right" class="dataTableContent"><input name="update_totals['.$i.'][value]" id="'.$id.'[value]" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '" size="6" onChange="obtainTotals()"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"><input name="update_totals['.$i.'][id]" type="hidden" value="' . $shipping_module_id . '" id="' . $id . '[id]"></td>' . "\n";

 

Next find in the same file admin/edit_orders.php at about line 1395

			 <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">
				  <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
				  '					<td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
				  '					<td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
				  '				  </tr>';

and change it to

			 <input type="hidden" id="update_shipping[' . $r . '][title]" name="update_shipping[' . $r . '][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" .
				  '	  <input type="hidden" id="update_shipping[' . $r . '][value]" name="update_shipping[' . $r . '][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" .
				  '	  <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" .
				  '	  <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 
				  '	  <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 
				  '				  </tr>';

 

When editing any order placed prior to making this change, in order to ensure shipping tax is computed properly you should overwrite the shipping quote included with the order totals with a fresh real-time quote from the same module, even if it is identical (it doesn't have to be the same module as long as both and/or all modules involved are in the same tax class). If you want to customize the name and/or value of the shipping quote you can then do so.

Share this post


Link to post
Share on other sites

After applying the above fix, I get the following error:

 

Fatal error: Call to undefined function: tep_hide_session_id() in /var/virtual/web/user/html/catalog/admin/orders.php on line 333

 

Before applying the fix, there was not such an error.

 

Can anyone suggest a solution?

Share this post


Link to post
Share on other sites
After applying the above fix, I get the following error:

 

Fatal error: Call to undefined function: tep_hide_session_id() in /var/virtual/web/user/html/catalog/admin/orders.php on line 333

 

Before applying the fix, there was not such an error.

 

Can anyone suggest a solution?

 

The function tep_hide_session_id() is defined at catalog/includes/functions/html_output.php. As far as I know it is not used at all on the admin side.

 

The fix above did not include any changes to admin/orders.php nor did it include the use of the function tep_hide_session_id().


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.

Share this post


Link to post
Share on other sites
What version of Order Editor are you using?

 

thanks for getting back to me..

i am using order editor 2.9.1..

 

many thanks

Edited by nafri

Share this post


Link to post
Share on other sites

I did install more than one bugfix. Infact I installed all current fixes at once.

I will start over again, do one at a time and see what happens.

Thanks for your reply.

Share this post


Link to post
Share on other sites
thanks for getting back to me..

i am using order editor 2.9.1..

 

many thanks

 

Is there a value for shipping tax entered in the shipping tax field?


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.

Share this post


Link to post
Share on other sites

hey guys... i haven't given up on this yet!!!!

 

spent quite a bit of time lookin back over everything, still couldn't get updated shipping quotes, so i removed all OE code and installed the latest version 5, well its all working, fantastic job and thanks to all involved in getting this all together!!!

 

even got my improved order numbers to work in most areas...

 

this may be a simple question, but how can i get the order number to send via the customer update email from edit_orders_ajax.php???

 

The format i use in the standard admin\orders.php is :

 

. tep_trans_id($order->info['date_purchased'],$oID) .

 

but i have noticed the $_POST thing happening and don't understand how to get my custom order id to send with the email: i use the format 260607-054734-0002

 

the order number in the database is just a simple number as oID = 2 etc

 

Any help or suggests would be greatly appreciated, Thanks

Share this post


Link to post
Share on other sites
Is there a value for shipping tax entered in the shipping tax field?

 

yeap.i got 17.5 added in the shipping field.It calculates tax on the products perfectly.. just the shipping shows up with out tax.The weired thing is when the customer places the order everything looks okay.It changes once i update the order via the update button or if the customer views his order history online the tax of shipping is not shown.. some how the system minus the tax on the shipping.

If i dont touch the update button or the customer doesnt view his order online then total does show hipping tax..

 

thnks for your help.. mush appreciated

 

nafri

Share this post


Link to post
Share on other sites

It's a nice contrib, but version ORDER EDITOR 4.0.2 ALPHA seems to have a shipping BUG in it. When I edit the prices of an order already placed through the site, I am not allowed to change the shipping UNLESS I want to do a real time quote, which sometimes I do not want to do as I may have quoted a different shipping price or gave them discounted shipping. So if I change the price of the items, it changes the entire price of the order to the price of the items WITHOUT shipping charges. So my invoice looks like this to the customer when he logs into his account:

 

Handling Fee: $0.00

Sub-Total: $310.88

Standard Shipping: $25.95

Total: $310.88

 

See, it does not take in to account the original shipping amount, not does it let you edit the original shipping amount like the older version 1.4 or 1.5 of this tool we had.... Why has this tool functionality been taken out of the tool in newer versions?


Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Share this post


Link to post
Share on other sites
It's a nice contrib, but version ORDER EDITOR 4.0.2 ALPHA seems to have a shipping BUG in it. When I edit the prices of an order already placed through the site, I am not allowed to change the shipping UNLESS I want to do a real time quote, which sometimes I do not want to do as I may have quoted a different shipping price or gave them discounted shipping. So if I change the price of the items, it changes the entire price of the order to the price of the items WITHOUT shipping charges. So my invoice looks like this to the customer when he logs into his account:

 

Handling Fee: $0.00

Sub-Total: $310.88

Standard Shipping: $25.95

Total: $310.88

 

See, it does not take in to account the original shipping amount, not does it let you edit the original shipping amount like the older version 1.4 or 1.5 of this tool we had.... Why has this tool functionality been taken out of the tool in newer versions?

 

 

I also just realized it takes off the shipping even if you just edit the shipping address field or any other field as well...


Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Share this post


Link to post
Share on other sites
I also just realized it takes off the shipping even if you just edit the shipping address field or any other field as well...

 

I feel like I'm writing a diary to myself :-" but in case anyone else is as bothered by this bug as much as me, I rolled back to version to 3.0.2.1 and the bug is non-existant there, and it functions very well from what I can tell so far.

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Share this post


Link to post
Share on other sites
I feel like I'm writing a diary to myself :-" but in case anyone else is as bothered by this bug as much as me, I rolled back to version to 3.0.2.1 and the bug is non-existant there, and it functions very well from what I can tell so far.

 

Have you tried 5.0? With the four bug fixes that have been posted it should work perfectly. You can use a shipping quote to overwrite the existing quote or manually change the shipping name or amount.


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.

Share this post


Link to post
Share on other sites
yeap.i got 17.5 added in the shipping field.It calculates tax on the products perfectly.. just the shipping shows up with out tax.The weired thing is when the customer places the order everything looks okay.It changes once i update the order via the update button or if the customer views his order history online the tax of shipping is not shown.. some how the system minus the tax on the shipping.

If i dont touch the update button or the customer doesnt view his order online then total does show hipping tax..

 

thnks for your help.. mush appreciated

 

nafri

 

I recommend testing out v5.0. It should work "out of the box" with Subtotal excluding VAT (theoretically anyway, but no one has ever said that it doesn't :)) and with the four bug fixes that have been posted applied it should work perfectly.

 

As far as using 2.9.1, what instructions did you follow to modify it?


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.

Share this post


Link to post
Share on other sites
hey guys... i haven't given up on this yet!!!!

 

spent quite a bit of time lookin back over everything, still couldn't get updated shipping quotes, so i removed all OE code and installed the latest version 5, well its all working, fantastic job and thanks to all involved in getting this all together!!!

 

even got my improved order numbers to work in most areas...

 

this may be a simple question, but how can i get the order number to send via the customer update email from edit_orders_ajax.php???

 

The format i use in the standard admin\orders.php is :

 

. tep_trans_id($order->info['date_purchased'],$oID) .

 

but i have noticed the $_POST thing happening and don't understand how to get my custom order id to send with the email: i use the format 260607-054734-0002

 

the order number in the database is just a simple number as oID = 2 etc

 

Any help or suggests would be greatly appreciated, Thanks

 

In admin/edit_orders.php find

EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n" .

and change it to

EMAIL_TEXT_ORDER_NUMBER . ' ' . tep_trans_id($order->info['date_purchased'],$oID) . "\n" .

 

Then in admin/edit_orders_ajax.php find

EMAIL_TEXT_ORDER_NUMBER . ' ' . $_POST['oID'] . "\n" .

and change it to

EMAIL_TEXT_ORDER_NUMBER . ' ' . tep_trans_id($order->info['date_purchased'],$_POST['oID']) . "\n" .


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.

Share this post


Link to post
Share on other sites
In admin/edit_orders.php find
EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n" .

and change it to

EMAIL_TEXT_ORDER_NUMBER . ' ' . tep_trans_id($order->info['date_purchased'],$oID) . "\n" .

 

Then in admin/edit_orders_ajax.php find

EMAIL_TEXT_ORDER_NUMBER . ' ' . $_POST['oID'] . "\n" .

and change it to

EMAIL_TEXT_ORDER_NUMBER . ' ' . tep_trans_id($order->info['date_purchased'],$_POST['oID']) . "\n" .

 

Dunno why but now with the above corrections there is no output at all!!!! The status, date & comments all go through but it doesn't seem to be getting the purchase date,

any ideas???

 

cheers

Share this post


Link to post
Share on other sites
Dunno why but now with the above corrections there is no output at all!!!! The status, date & comments all go through but it doesn't seem to be getting the purchase date,

any ideas???

 

cheers

 

Where is the function tep_trans_id defined?


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×