Zen Cart Logo
Forums / Addon Admin Tools / Edit Orders v4.0 Support Thread

Edit Orders v4.0 Support Thread

Views: 346,056

Results 1,141 to 1,160 of 1,927
4 Oct 2017, 3:48 PM
#1141
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Edit Orders v4.0 Support Thread

@carlwhat, this version still removes/recreates those orders_products and orders_products_attributes records. There are notifiers now issued by *EO *when it's preparing to remove and then re-instate those records, though, so an admin-level observer can keep those additional fields intact.

That said, I expect to have that processing changed in the next ***major ***release.

If you find any issues, please report them here since I think that this support thread has a wider audience.

4 Oct 2017, 4:17 PM
#1142
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

lat9:

@carlwhat, this version still removes/recreates those orders_products and orders_products_attributes records. There are notifiers now issued by *EO *when it's preparing to remove and then re-instate those records, though, so an admin-level observer can keep those additional fields intact.

That said, I expect to have that processing changed in the next ***major ***release.

If you find any issues, please report them here since I think that this support thread has a wider audience.
FWIW, I've created this GitHub issue to track this request.

6 Oct 2017, 4:11 AM
#1143
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

ok... i have taken a cursory look, and i'll add a few comments and then i will move on.

first off, props to you @lat9 for taking this mess on! i appreciate all of the documentation you have added (not that i understand it..), and eventually this will possibly make more sense to me...

similar to you, i come from an old school background, learning old school procedural languages, before transitioning into OOP. unlike you, i have not picked it up nearly as well.... ;)

some of the things that i have been forced to focus on deal with totals, and how ot_* groups never add up.

let's look at ot_subtotal.

here is some code that i was forced to add:

function eo_update_order_subtotal($order_id, $product, $add = true) {
	global $currencies, $db, $order;
	// forget their stuff...  just recalculate
	
	$RunningSubTotal = 0;
	$RunningTax = 0;
	foreach($order->products as $products_details) {
		$RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
		$RunningTax += (($products_details["tax"]/100) * ($products_details["qty"] * $products_details["final_price"]));
		$TaxRate = $products_details["tax"]/100;  // assume tax rate the same for all products
	}

	// Retrieve running subtotal

i have ZERO confidence in the amount in ot_subtotal. in fact, i had to create a new function to recalculate the ot_subtotal! granted, i'm making assumptions based on my knowledge of the constants stored in the configuration table, but still...

whether the ot_subtotal amount in your new version is correct now, i can not say.... but i swore off debugging this module! its just easier to recalculate it on my own.

with that said, i have made things work for my few ZC clients, without concern with how they will work for others.

another one of those things is taxes (you can see a little bit above). i make use of the ot_local_sales_tax which basically deals with 2 tax rates for orders. but more importantly, there is only ONE tax rate for any order. now, i am not sure how many ZC installs out there that have a different tax rate for different line items on the order, but i'm guessing they exist. i have non-ZC clients that is the case, although rare. mostly some items are for re-sale and not taxable and others are not. but there are no orders with 2 different non-zero rates.

if those exist, should ZC support those functions?

but i have never been able to get this add-on out of the box to calculate the tax correctly. especially when using a tax add-on module as the base ot_tax module does not work for my clients.

which is why i am forced to recalculate a tax rate above.

i hate the use of $GLOBALS. it would be great to eliminate all of those references.

ot_shipping, can include tax - although some times not.... depends on the store owners accountant (although they are no doubt interpreting tax law).... again, never got it to work.... and the same with ot_coupon. ot_coupon should reduce the tax amount of the order while a gift certificate should not.

i apologize. i suppose i am complaining more than doing anything constructive. if i get the energy to start with a vanilla install, add the ot_local_sales_tax module, then implement this edit_orders add-on and see how coupons and gift certificates work, how tax on shipping works, perhaps i can add more relevant information to the discussion.

at the end of the day, it just seems that there is too much reliant on numbers already stored in the DB as opposed to recalculating the numbers as they get done. whether that is the case in the new version i can not say... at least at this point.

again, i want to say that i appreciate all of your efforts, and i read all of your posts with interest as there is always the probability that i will learn something.

best.

6 Oct 2017, 11:58 AM
#1144
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

carlwhat:

ok... i have taken a cursory look, and i'll add a few comments and then i will move on.

first off, props to you @lat9 for taking this mess on! i appreciate all of the documentation you have added (not that i understand it..), and eventually this will possibly make more sense to me...

similar to you, i come from an old school background, learning old school procedural languages, before transitioning into OOP. unlike you, i have not picked it up nearly as well.... ;)

some of the things that i have been forced to focus on deal with totals, and how ot_* groups never add up.

let's look at ot_subtotal.

here is some code that i was forced to add:

function eo_update_order_subtotal($order_id, $product, $add = true) {
global $currencies, $db, $order;
// forget their stuff... just recalculate

$RunningSubTotal = 0;
$RunningTax = 0;
foreach($order->products as $products_details) {
    $RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
    $RunningTax += (($products_details["tax"]/100) * ($products_details["qty"] * $products_details["final_price"]));
    $TaxRate = $products_details["tax"]/100;  // assume tax rate the same for all products
}

// Retrieve running subtotal
> 
> i have ZERO confidence in the amount in ot_subtotal.  in fact, i had to create a new function to recalculate the ot_subtotal!  granted, i'm making assumptions based on my knowledge of the constants stored in the configuration table, but still...
> 
> whether the ot_subtotal amount in your new version is correct now, i can not say....  but i swore off debugging this module!  its just easier to recalculate it on my own.
Those pesky totals/taxes calculations were the reason for the addition of the additional configuration setting (and checkbox) in v4.3.0.  When the checkbox is checked, EO's totals calculations are given a "restart" (i.e. setting the order's total and tax to 0).

> **carlwhat:**
>
> with that said, i have made things work for my few ZC clients, without concern with how they will work for others.  
> 
> another one of those things is taxes (you can see a little bit above).  i make use of the ot_local_sales_tax which basically deals with 2 tax rates for orders.  but more importantly, there is only ONE tax rate for any order.  now, i am not sure how many ZC installs out there that have a different tax rate for different line items on the order, but i'm guessing they exist.  i have non-ZC clients that is the case, although rare.  mostly some items are for re-sale and not taxable and others are not.  but there are no orders with 2 different non-zero rates.
> 
> if those exist, should ZC support those functions?
> 
> but i have never been able to get this add-on out of the box to calculate the tax correctly.  especially when using a tax add-on module as the base ot_tax module does not work for my clients.
> 
> which is why i am forced to recalculate a tax rate above.
From what I remember from discussions with lhungil, the local_sales_tax plugin was always problematic for EO (it's even called out in the readme).  Since I don't use that plugin with EO, I don't know if the "reset totals" processing will help or not.

> **carlwhat:**
>
> i hate the use of $GLOBALS.  it would be great to eliminate all of those references.
Actually, I'm going in the opposite direction.  I find that (although it tends to uglify the code) using $GLOBALS helps me to remember that a value is being used and/or set outside the scope of a function or class.  I agree that there's no need for the $GLOBALS within the procedural portions (i.e. /admin/edit_orders.php) of the processing!

> **carlwhat:**
>
> ot_shipping, can include tax - although some times not....  depends on the store owners accountant (although they are no doubt interpreting tax law)....  again, never got it to work....  and the same with ot_coupon.  ot_coupon should reduce the tax amount of the order while a gift certificate should not.
> 
> i apologize.  i suppose i am complaining more than doing anything constructive.  if i get the energy to start with a vanilla install, add the ot_local_sales_tax module, then implement this edit_orders add-on and see how coupons and gift certificates work, how tax on shipping works, perhaps i can add more relevant information to the discussion.
> 
> at the end of the day, it just seems that there is too much reliant on numbers already stored in the DB as opposed to recalculating the numbers as they get done.  whether that is the case in the new version i can not say... at least at this point.
> 
> again, i want to say that i appreciate all of your efforts, and i read all of your posts with interest as there is always the probability that i will learn something.
> 
> best.
No apologies necessary, fresh ideas and discussion are always welcomed!
12 Oct 2017, 7:35 PM
#1145
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Great mod!!
I was hoping I could get some direction with an issue I have. I have a field "products_description" that displays in orders.php, but after I modify the order, it no longer appears.

Thanks,

13 Oct 2017, 11:46 AM
#1146
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

allmart:

Great mod!!
I was hoping I could get some direction with an issue I have. I have a field "products_description" that displays in orders.php, but after I modify the order, it no longer appears.

Thanks,
That behavior is due to the way that EO updates orders (currently), regenerating each product entry on each update.

The current version of EO includes Zen Cart notifiers to let other code know that it's about to remove a product from (so you could grab its description with an observer-class module) and another when it's about to add a product to the order.

13 Oct 2017, 12:07 PM
#1147
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Thanks for the prompt reply and I apologize but it's over my head and don't understand.

13 Oct 2017, 1:36 PM
#1148
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

allmart:

Thanks for the prompt reply and I apologize but it's over my head and don't understand.
No apologies necessary, here's a reply without the techno-babble ...

In the current implementation of* Edit Orders*, each time you update an order, the order's products (and associated attributes) records are removed from the database and then (if appropriate) re-inserted. Edit Orders doesn't know that you've added the products_description field to each ordered-product's record so, when you update the order, that field is not included in the update and is set to the field's default value (for your case, most likely an empty string).

If you want/need that ***products_description ***value to "survive" an order-update using Edit Orders, you'll need some custom code developed.

13 Oct 2017, 4:03 PM
#1149
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Thanks again for your prompt reply. I was able to find the solution from another thread: https://www.zen-cart.com/showthread.php?42503-Add-Product-Description-to-Invoice-orders-emails-ect/page5, which worked perfectly. Sorry for not digging a little deeper before posting and thanks again for another great mod from you.
Cheers!

12 Nov 2017, 6:42 AM
#1150
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I've never installed an add on, but I'd love to try this one. Probably a dumb question, but is there a video that shows how to install this? Really would love to have the ability to edit orders... Thank you!

12 Nov 2017, 12:31 PM
#1151
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

cindygordon:

I've never installed an add on, but I'd love to try this one. Probably a dumb question, but is there a video that shows how to install this? Really would love to have the ability to edit orders... Thank you!
There's no video, but the installation might be really easy ... depending on whether you've installed other plugins in your store (which you say you haven't) and whether you're using the most recent Zen Cart version (v1.5.5e).

How did you install your Zen Cart? Do you use an FTP (File Transfer Protocol) program to send files to your hosted site from your computer? Examples of these programs are WinSCP and FileZilla?

The answers to those questions will give me an idea of the best way to describe how to install the EO updates.

12 Nov 2017, 3:41 PM
#1152
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

There's no video, but the installation might be really easy ... depending on whether you've installed other plugins in your store (which you say you haven't) and whether you're using the most recent Zen Cart version (v1.5.5e).

How did you install your Zen Cart? Do you use an FTP (File Transfer Protocol) program to send files to your hosted site from your computer? Examples of these programs are WinSCP and FileZilla?

The answers to those questions will give me an idea of the best way to describe how to install the EO updates.

Thank you for the quick response! I have not installed other add ons, tho I would like to, but... same issue. Afraid to break it! Yes, I can use filezilla. If I recall, I think I actually set it up initially using godaddy's hosting interface, as there is a zencart icon in there. But I have logged in via filezilla to access files as well, that's no problem. I have set up other carts using ftp.

12 Nov 2017, 5:58 PM
#1153
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,067
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

Since you have no other changes to your cart, these instructions should get you going:

Download the plugin's zip-file from the Zen Cart downloads and unzip the Edit Orders plugin's zip-file into a directory on your computer. For the rest of these instructions, let's call that directory MyEditOrders.

  1. Rename the MyEditOrders/YOUR_ADMIN directory to match the name of your Zen Cart admin directory.
  2. Within that extracted file structure, create two subdirectories: MyEditOrders/includes/classes/saved and MyEditOrders/your-admin-directory/saved.
  3. Using FileZilla, download your current copy of /includes/classes/order.php into your local MyEditOrders/includes/classes/saved directory.
  4. Using FileZilla. download your current copy of /your-admin-directory/orders.php into your local MyEditOrders/your-admin-directory/saved directory.

Now that you have saved your current/backup copy of those two files, it's time to upload the Edit Orders files to your hosted site using FileZilla.

  1. Open FileZilla and log into your hosted site.
  2. On your FileZilla "Local site", navigate to your MyEditOrders/includes directory; on the "Remote site", navigate to your store's /includes directory.
  3. Upload the contents from the "Local" to the "Remote".
  4. On your FileZilla "Local site", navigate to your MyEditOrders/your-admin-directory; on the "Remote site", navigate to your store's /your-admin-directory.
  5. Upload the contents from the "Local" to the "Remote".

That should do it! Now, when you go to your admin's Customers->Orders, there's an additional link to "Edit Order". Happy editing!

12 Nov 2017, 8:42 PM
#1154
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

Since you have no other changes to your cart, these instructions should get you going:

Download the plugin's zip-file from the Zen Cart downloads and unzip the Edit Orders plugin's zip-file into a directory on your computer. For the rest of these instructions, let's call that directory MyEditOrders.

  1. Rename the MyEditOrders/YOUR_ADMIN directory to match the name of your Zen Cart admin directory.
  1. Within that extracted file structure, create two subdirectories: MyEditOrders/includes/classes/saved and MyEditOrders/your-admin-directory/saved.
  1. Using FileZilla, download your current copy of /includes/classes/order.php into your local MyEditOrders/includes/classes/saved directory.
  1. Using FileZilla. download your current copy of /your-admin-directory/orders.php into your local MyEditOrders/your-admin-directory/saved directory.

Now that you have saved your current/backup copy of those two files, it's time to upload the Edit Orders files to your hosted site using FileZilla.

  1. Open FileZilla and log into your hosted site.
  1. On your FileZilla "Local site", navigate to your MyEditOrders/includes directory; on the "Remote site", navigate to your store's /includes directory.
  1. Upload the contents from the "Local" to the "Remote".
  1. On your FileZilla "Local site", navigate to your MyEditOrders/your-admin-directory; on the "Remote site", navigate to your store's /your-admin-directory.
  1. Upload the contents from the "Local" to the "Remote".

That should do it! Now, when you go to your admin's Customers->Orders, there's an additional link to "Edit Order". Happy editing!

Oh thank you!!! So excited, I will try this tonight, you rock!! :D

12 Nov 2017, 9:44 PM
#1155
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

cindygordon:

Oh thank you!!! So excited, I will try this tonight, you rock!! :D

well phooey, I tried it, and followed it very meticulously, but my site is down now. :(

says "page isn't working"

12 Nov 2017, 9:56 PM
#1156
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Well, the ADMIN part of the site is down. The front end is still coming up, I can still browse, shop and checkout. Just can't get to the admin area. Or even the login page for it.

12 Nov 2017, 11:17 PM
#1157
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Edit Orders v4.0 Support Thread

cindygordon:

Well, the ADMIN part of the site is down. The front end is still coming up, I can still browse, shop and checkout. Just can't get to the admin area. Or even the login page for it.
Check your logs directory for the most recent mydebug log(s).

13 Nov 2017, 3:28 AM
#1158
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I see myDEBUG files there, but I don't really know what they mean.

13 Nov 2017, 3:32 AM
#1159
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Maybe I can try to do a fresh install in another directory? Is there a way I can transfer the products to the new store? And all of the user history? I do have access to the database. Ugh I'm sorry, this probably does not belong in this thread any longer. SOS for my site at this point.

13 Nov 2017, 4:08 AM
#1160
cindygordon avatar

cindygordon

New Zenner

Join Date:
Sep 2016
Location:
Dallas, TX USA
Posts:
71
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Is there anyone who can help me get my site back up? Feeling very defeated, not sure what to do. I can offer to pay if needed.