Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

Hi,

 

Has anyone got this to work with the Daily Specials contribution by Jack_MCS??

 

If so How?

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

  • 2 weeks later...

Hi there all,

I was doing some mods to Order Editor because on my shop some products have their stocks controlled, and others don't, so every product has an 'ignore_qtde' field that defines this on database wich is set on product edit as checkbox (on or off), I am trying to Order editor do not lower stock on this itens when added to an order and to not put back them in stock when deleting from order, but it still happend and I don't know where else to mess, I'm with AJAX activated and done modes on admin/edit_oders.php as follows:

around line 190:

			if ($products_details['qty'] != $order_products['products_quantity']){
		$quantity_difference = ($products_details['qty'] - $order_products['products_quantity']);
			if (STOCK_LIMITED == 'true'){
                   $productstock_query = tep_db_query("SELECT ignore_qtde FROM ". TABLE_PRODUCTS . " WHERE products_id = '" . (int)$orders_products_id . "'");
                   $productstock = tep_db_fetch_array($productstock_query);
                   if($productstock['ignore_qtde'] != 'on') {
			      tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET
				  products_quantity = products_quantity - " . $quantity_difference . ",
				  products_ordered = products_ordered + " . $quantity_difference . "
				  WHERE products_id = '" . (int)$order_products['products_id'] . "'");
				  }
				} else {
				tep_db_query ("UPDATE " . TABLE_PRODUCTS . " SET
				products_ordered = products_ordered + " . $quantity_difference . "
				WHERE products_id = '" . (int)$order_products['products_id'] . "'");
			}
		}

 

and around line 220 (about deleting product from an order):

			       if (STOCK_LIMITED == 'true'){
                   $productstock_query = tep_db_query("SELECT ignore_qtde FROM ". TABLE_PRODUCTS . " WHERE products_id = '" . (int)$orders_products_id . "'");
                   $productstock = tep_db_fetch_array($productstock_query);
                   if($productstock['ignore_qtde'] != 'on') {
			      tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET
				  products_quantity = products_quantity + " . $products_details["qty"] . ",
				  products_ordered = products_ordered - " . $products_details["qty"] . "
				  WHERE products_id = '" . (int)$order_products['products_id'] . "'");
				}
                   } else {
				tep_db_query ("UPDATE " . TABLE_PRODUCTS . " SET
				products_ordered = products_ordered - " . $products_details["qty"] . "
				WHERE products_id = '" . (int)$order_products['products_id'] . "'");
				}

 

 

but it still backing products where ignore_qtde is 'on' (checkbox on products edit page), any lights on this ? it happends when I delete a product on order editor, code seens to be correct.

thanks,

David

Edited by bugnet
Link to comment
Share on other sites

Hi all.

 

Would appreciate any help with this.

 

I've installed all new files, edited existing files and run the db query. Everything is installed, yet when I click to edit an order, it gives a 500 internal server error.

 

I'm no expert at these things, but have installed loads of different contributions with no problems. I've gone back and checked what I have edited against what is in the download but still can't see anything wrong.

 

My admin is secured by ssl (the customer pages) so I disabled this to check if this was an issue to no joy - can anyone think what might be wrong that has given this error message ?

 

Thanks in advance

Link to comment
Share on other sites

Hi all.

 

Would appreciate any help with this.

 

I've installed all new files, edited existing files and run the db query. Everything is installed, yet when I click to edit an order, it gives a 500 internal server error.

 

I'm no expert at these things, but have installed loads of different contributions with no problems. I've gone back and checked what I have edited against what is in the download but still can't see anything wrong.

 

My admin is secured by ssl (the customer pages) so I disabled this to check if this was an issue to no joy - can anyone think what might be wrong that has given this error message ?

 

Thanks in advance

 

Whats the exact wording of the error?

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Hi there all,

I was doing some mods to Order Editor because on my shop some products have their stocks controlled, and others don't, so every product has an 'ignore_qtde' field that defines this on database wich is set on product edit as checkbox (on or off), I am trying to Order editor do not lower stock on this itens when added to an order and to not put back them in stock when deleting from order, but it still happend and I don't know where else to mess, I'm with AJAX activated and done modes on admin/edit_oders.php as follows:

around line 190:

..............

 

but it still backing products where ignore_qtde is 'on' (checkbox on products edit page), any lights on this ? it happends when I delete a product on order editor, code seens to be correct.

thanks,

David

Nice idea (the idea only)! This is a solution that I'm looking for! Thank you.

 

About your issue. It need to see carefully. But I have only one question: do you have your setting STOCK_LIMITED set to true or not?

If you use AJAX module you should modify edit_order_ajax.php also. In this file you found exactly the same code as in edit_order.php.

Link to comment
Share on other sites

Hi,

 

Has anyone got this to work with the Daily Specials contribution by Jack_MCS??

 

If so How?

 

Thanks

I'am working for this now. Hope the results are coming soon.

Link to comment
Share on other sites

  • 3 weeks later...

Hi there,

 

I get these warnings when I add a product to an order. And I cant seem to delete an item without adding a new one. Can you help?

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/hasaudio/public_html/admin/edit_orders.php on line 569

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/hasaudio/public_html/admin/edit_orders.php on line 569

 

Warning: Cannot modify header information - headers already sent by (output started at /home/hasaudio/public_html/admin/edit_orders.php:569) in /home/hasaudio/public_html/admin/includes/functions/general.php on line 22

 

that is a problem with arrays on new php 5.1 and upper...

 

look for

edit_orders.php on line 569 (do the same on edit_orders_ajax.php)

 

		//save ot_skippy from certain annihilation

if ( (!in_array($ot_class, $written_ot_totals_array)) && (!in_array($ot_title, $written_ot_titles_array)) && (tep_not_null($ot_value)) && (tep_not_null($ot_title)) && ($ot_class != 'ot_tax') && ($ot_class != 'ot_loworderfee') ) { //7

	//this is supposed to catch the oddball components that don't show up in $order_totals


 

change by

 


		//save ot_skippy from certain annihilation

if ( (!in_array((array)$ot_class, (array)$written_ot_totals_array)) && (!in_array((array)$ot_title, (array)$written_ot_titles_array)) && (tep_not_null($ot_value)) && (tep_not_null($ot_title)) && ($ot_class != 'ot_tax') && ($ot_class != 'ot_loworderfee') ) { //7

	//this is supposed to catch the oddball components that don't show up in $order_totals

 

check it let me know if works

Edited by axioma
Link to comment
Share on other sites

This is really great Add-on, Thanks.

We installed this one but we also need "Category Tree Quantity and Value Breaks Discount(ot_cat_qvb_discount)" install and use it in our site!

So when edit and update the order its get wrong blank page?! When disable ot_cat_qvb_discount.php in order_total and then the edit order and update is worked and everything fine, Does any help or fix can help us to make "ot_cat_qvb_discount" work with "Edit order" ?

Please help us! Please help us! Please help us!

Thanks!

Link to comment
Share on other sites

for those who have this problem:

 

Fatal error: Call to undefined function tep_add_base_ref() in C:\wamp\www\admin\edit_orders_ajax.php on line 1144

 

add below code to admin/include/function/general.php before closing tag ?>

 

function tep_add_base_ref($string) {

$i = 0;

$output = '';

$n=strlen($string);

for ($i=0; $i<$n; $i++) {

$char = substr($string, $i, 1);

$char5 = substr($string, $i, 5);

if ($char5 == 'src="' ) {$output .= 'src="' . HTTP_SERVER; $i = $i+4;}

else {

$output .= $char;

} }

return $output;

}

 

 

sean

Link to comment
Share on other sites

  • 2 weeks later...

Hi all

 

If you have option types v2 installed and want to have the ability to set options to be calculated per unit or per item, also via the order editor, then here is the solution, posted in the option types v2 forum

 

It works fine with Order editor version by surfalot (18.11.09), I don't know about the other versions

 

And a question

 

in file admin/order_editor/javascript.php and line about 703 we see

	if ((action != 'qty') && (action != 'price_incl')) {
document.getElementById("update_products[" + pid + "][price_incl]").value = doFormat(priceInclValue, 4);
}

This says that the final price should not be updated when quantity changes.

 

For the needs of my modification I changed that to

	if (action != 'price_incl') { // The (action != 'qty') condition taken out, so reaktion ok on qty changes
document.getElementById("update_products[" + pid + "][price_incl]").value = doFormat(priceInclValue, 10);
}

 

Was there any particular reason, not to let the price(incl) change on quantity changes?

Edited by multimixer
Link to comment
Share on other sites

Hi,

when I click on "new order email" I get the following error:

1146 - Table 'spares.eorder_text' doesn't exist
SELECT * FROM eorder_text where eorder_text_id = '1' and language_id = '4'
[TEP STOP]

Can somebody help me?

Thx

Link to comment
Share on other sites

  • 2 weeks later...

Version 5.0.9

Custom order totals aren't getting updated, is there any way to fix this?

The order totals are added by other add-ons (custom low order fees, or points and rewards; for example)

 

Classes Affected

ot_redemptions

ot_residential

 

 

For now, I've put a band-aid on edit_orders.php to rename both class fields to ot_custom* and this alleviates the conflict, but I'd love a more usable solution, as this is going to prove cumbersome when I add other order total addons in the future.

 

For reference, here is the band-aid fix:

At the top of admin/edit_orders.php:

tep_db_query("UPDATE " . TABLE_ORDERS_TOTAL . " SET class = 'ot_custom9' WHERE orders_id = '" . $_GET['oID'] . "' && class ='ot_residential'");
tep_db_query("UPDATE " . TABLE_ORDERS_TOTAL . " SET class = 'ot_custom8' WHERE orders_id = '" . $_GET['oID'] . "' && class ='ot_redemptions'");

 

 

 

Has anyone been able to make custom order totals like ot_redemptions, ot_gv and ot_coupon work with edit_orders?

 

The above solution seems to be in the right direction but for me it is adding the amount of the custom order total instead of deducting it.

 

As a temporary fix, does anyone know how to make ot_custom be deducted instead of added?

Link to comment
Share on other sites

There is no way to deduct ot_custom. Just because they are work as a hack. We may try to use solution by spectral quoted above, but there is a straight way to conflicts if we have many order totals and a lot of ot_custom or want our coupons and vouchers be applied on exactly sequence. There is possible to make some order totals work correct with deducted amount as they usually work in client side. For some it is very simple, eg. ot_easy_discount. I do that.

 

But ot_gv and ot_coupon are interesting. I think it is possible to deduct amount for coupons which are already be applied by the customer himself, but I see no way to add a coupon in Order Editor by admin, yet. More interesting with ot_gv:

* should we reduce customer's balance if voucher be applied or

* should we take into account only the amount which customer applied himself or

* should we reduce customer's balance only for a sum which customer want to be reduced or

* too many questions, which must be answered differently in each case.

But nothing possible. I have no spare time yet to think how to make this ot_coupon and ot_gv to work with OE. I don't know about ot_redemptions. Is it from Reward Point System?

Link to comment
Share on other sites

I have never test Reward Points, but I need it in short time. And of cource I need a tool that can work with ot_gv, ot_coupon nad ot_redemptions by deducting amount. If I do some for Order Editor I'll probably post it here. But how soon it will be I can't say yet.

Link to comment
Share on other sites

  • 3 weeks later...

When you add a product, order editor let you add a greater amount of products than you have on stock…

 

 

 

Creating negative values on your stock

 

For example:

 

-3 units of MATROX 200 4MB

 

 

 

Does any one fix this?.

 

 

 

I tried this but does seem to work:

 

In edit_orders_add_product.php:

 

 

 

Find around line 370:

 

 

 

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options_name['products_options_name'] . ' - ' . $products_options['products_options_values_name']);

 

 

 

Replace with:

 

 

 

//BOF check quantity of attrtibutes QT PRO

 

$stock_quantity_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int)$add_product_products_id . "' and products_stock_attributes = '" . $products_options_name['products_options_id'] . "-" . $products_options['products_options_values_id'] . "'");

 

$stock_quantity = tep_db_fetch_array($stock_quantity_query);

 

 

 

if ($stock_quantity['products_stock_quantity'] > '0') { //if QT Pro quantity is greater than 0

 

 

 

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options_name['products_options_name'] . ' - ' . $products_options['products_options_values_name'] . ' (' . $stock_quantity['products_stock_quantity'] . ')');

 

}

 

 

 

//EOF Check quantity of attributes QT Pro

 

 

Link to comment
Share on other sites

I just recently installed the Order editor 5.0.9c package.

When I edit order, able to delete the orders.

When I click to add new products, new pop up comes and I am able to select the product and add to order.

Then the main order edit page refreshes but goes to login page. After that new items I am adding doesnt add to the order.

So ineffect only one line item I am able to add every time.

 

Is there a way to correct. I am getting incorrect order total as after the firat item added thro order editor, additional items are not counted by the sub total but shows in the order.

 

Thanks

Link to comment
Share on other sites

I just recently installed the Order editor 5.0.9c package.

When I edit order, able to delete the orders.

When I click to add new products, new pop up comes and I am able to select the product and add to order.

Then the main order edit page refreshes but goes to login page. After that new items I am adding doesnt add to the order.

So ineffect only one line item I am able to add every time.

 

Is there a way to correct. I am getting incorrect order total as after the firat item added thro order editor, additional items are not counted by the sub total but shows in the order.

 

Thanks

 

I am getting below response when i login again after the first items is added to order thro order editor

" You have not selected an order to edit, or the order ID variable has not been set. "

Link to comment
Share on other sites

I am getting below response when i login again after the first items is added to order thro order editor

" You have not selected an order to edit, or the order ID variable has not been set. "

 

I installed 5.0.7 after I couldnt solve the problem.

Same error continues as after first item is added to cart, the order edit pages goes to login as says error as I have mentioned above.

I continue to add additional items to the cart which is seen in the order but the sub total doesnt add it.

I login and go the order and edit. I get now a new dispay by default.

"Please check on updare to save all changes" I click update and all items are added to sub total.

 

I need to now solve the issue of the order edit page refreshes anc comes back to the same page and adds additional items with proper subtotal w/o me going in to this cumbersome process of updating the order.

Link to comment
Share on other sites

I installed 5.0.7 after I couldnt solve the problem.

Same error continues as after first item is added to cart, the order edit pages goes to login as says error as I have mentioned above.

Which browser are you using? Did you try to off the AJAX of Order Editor. If yes, do still have the problem after adding product?

Link to comment
Share on other sites

When you add a product, order editor let you add a greater amount of products than you have on stock…

Nothing problemI think it is a great feature to use it like a preorder when you get orders with products that actually comes later.

I don't understand the problem. Do you use QT Pro? If yes, the stock of your product will calculated right way, but the stock of attributes may down below zero. Do you have my fixes for QT Pro for version 5.0.7?

Link to comment
Share on other sites

Yes i tested.. exist a bug that send you to login page.

 

i recreate the process.

 

1. open your browser (crome, firefox)

2. create new order (manual order)

3. add a product that has qtpro feature. (no bug when you add product without attributes)

4. you are redirected to log in page.

5. after you log in again, you can add more products without problem.

Link to comment
Share on other sites

Yes i tested.. exist a bug that send you to login page.

Clear. Thanks.

Never test OE in browsers except InternetExplorer. My own shop works excelent with attributes and QT Pro. As far as I remember basic QT Pro functionality exists before I rework some code to improve work with attributes. So, I try to test it in Chrome. Unfortunatelly I test on copy of working shop. My current OE has some modification from contributed versions. I can't promise that I've done it quickly and fix be applicable to general OE.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...