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

Edit Orders v4.0 Support Thread

Views: 345,905

Results 781 to 800 of 1,927
02 Oct 2015, 09:02
#781
mc12345678 avatar

mc12345678

Totally Zenned

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

Edit Orders v4.0 Support Thread

That particular error pops up here and there every once in a while and in fact saw that someone else had it recently. Darned if I could remember the specific program/area to address, but if you install lat9's mydebug backtrace available in the plugins of this site, it should provide more detailed information about where the particular sql statement is that is causing that error.

02 Oct 2015, 12:38
#782
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

mc12345678:

That particular error pops up here and there every once in a while and in fact saw that someone else had it recently. Darned if I could remember the specific program/area to address, but if you install lat9's mydebug backtrace available in the plugins of this site, it should provide more detailed information about where the particular sql statement is that is causing that error.
See this (https://www.zen-cart.com/showthread.php?200407-Edit-Orders-v4-0-Support-Thread&p=1235066#post1235066) Edit Orders post for the solution.

11 Oct 2015, 18:56
#784
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Hi All. I have searched the forum and this EO thread to no avail. I'm hoping someone can help.

Installed:
ZC 1.5.1
EO 4.1.4
Admin New Order 1.5

2 issues:

  1. When creating a new order from the admin section, once a product is added, the tax field shows a 0 (product is set as a taxable item and zones are set properly). If I try to update, the updated tax% shows (as 5%), but is not calculated in the total.
  2. The coupon field also does not update when added.

Any help with this would be greatly appreciated!

If you need any further information, please let me know.

11 Oct 2015, 22:36
#785
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Update:

  1. I now have the tax rate being calculated in the total once the 0% is updated to 5%. (configuration settings)
    **However, all products show a 0% tax on being added in Edit Orders before manually updating tax %.
    **NOTE: when order is created via the online shop, tax is correctly added. This issue happens ONLY when adding a new order (Admin New Order) from the admin area.

  2. Coupon codes being added is fixed. Issue was in the coupon admin settings.

12 Oct 2015, 02:01
#786
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

gigi3:

... 1. I now have the tax rate being calculated in the total once the 0% is updated to 5%. (configuration settings)
**However, all products show a 0% tax on being added in Edit Orders before manually updating tax %.
**NOTE: when order is created via the online shop, tax is correctly added. This issue happens ONLY when adding a new order (Admin New Order) from the admin area. ...
What are your settings in "admin" -> "Configuration" -> "Customer Details"? In particular the settings for "State" and "State - Always display as pulldown?"?

What are your settings in "admin" -> "Configuration" -> "My Store"? In particular the settings for "Country", "Zone" (state), "Basis of Product Tax", and "Basis of Shipping Tax"?

Are there any other 3rd party tax plugins installed (such as those for VAT or Local Sales Taxes)?

Any Zen Cart debug logs (not asking for Edit Orders debug logs, just any Zen Cart debug logs)?

Have you verified the order contains the correct address to trigger Zen Cart tax rules (and the Zone / State exists in the database)? Please note if you change the address, you will need to save the new address information by clicking "update" before adding products (otherwise the address changes will not be saved).

Also note with the current version of Edit Orders (at the time of writing 4.1.4) once an editable field contains data (such as the tax rate containing a 0), this value will always be used (instead of the value automatically generated by Zen Cart for the field). This is necessary to allow people to override the default values.

When using "Admin New Order" to create a new "blank" order for a customer... "Edit Orders" appears to work as expected in my Zen Cart 1.5.1 and 1.5.4 test stores (clean install w/ demo data + "Admin New Customer", "Admin New Order", and "Edit Orders".)... When a product is added to a "blank" order, when adding a new product the correct tax rate is used for the product based upon the tax status of the product, the store settings, and the address.

To test I first added a product to an order with a state configured for no tax (this is all states except Florida in the demo data); resulting in a 0% tax rate on the added product. Next I changed the address to a state configured for tax (Florida is a 7% tax rate in the demo data); resulting in a 7% tax rate on the added product.

gigi3:

... 2. Coupon codes being added is fixed. Issue was in the coupon admin settings.
Can you elaborate (for all of the viewers at home)?

12 Oct 2015, 17:33
#787
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Thank you so much for your response, lhungil!

I think you've hit on my issue. These orders are created in the admin using the Admin New Order plugin because these orders are 'in store' and no address is needed. The products all have a 5% tax rate for in store sales. Is there a way to set the tax rate so there is no need to depend on the address of the client for calculation?

The online orders work proprerly, of course, because our online clients include an address for shipping in their order.

As for #2. The coupon was set to a minimum order of $100. blush Easy fix. ;)

12 Oct 2015, 17:44
#788
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Just an afterthought, the entire customer base, including both our online customers and our in store customers are in Canada. We have, and will have, no customers outside of Canada.

12 Oct 2015, 17:54
#789
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Fixed it.

Created a new Zone for all of Canada with a set tax rate. I had it set for 2 separate zones to accommodate shipping rates.

Seems to work. Thank you for taking the time!

12 Oct 2015, 18:39
#790
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

gigi3:

... I think you've hit on my issue. These orders are created in the admin using the Admin New Order plugin because these orders are 'in store' and no address is needed. The products all have a 5% tax rate for in store sales. Is there a way to set the tax rate so there is no need to depend on the address of the client for calculation? ...
You could just enter the store's address for the order. This way the tax rate for the store location would be used (and recorded as the location for reports and potential tax audits). And don't forget the store location must have a configured tax rate.

If you have time, you could modify "Admin New Order" to add an "In Store Purchase" button. When pressed, the code could be altered to automatically add the store's address to the order as the shipping address (and continue to pull the customer / billing from the database if present).

gigi3:

... Created a new Zone for all of Canada with a set tax rate. ...
Thank you for reporting more details about how you are using "Admin New Order" and "Edit Orders" and your solution!

I am not conversant with CAN tax rules (so ignore the next sentence if it does not apply)... My only concern would be this change may impact customers shopping online from other locations in CAN where you (the seller) may not be required to collect and remit tax (or need to do so at a different rate).

If you want better reporting (and order records), you may want to think about also adding the modifications I mentioned above to "Admin New Order" in the future (and add the tax rate for the physical store location).

12 Oct 2015, 21:39
#791
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Great info, lhungil. I will look into the "In Store Purchase" button!

As you say, the different areas of Canada do, indeed, have different tax rates, based on province. Luckily for us, we only charge GST (Country wide) and not PST (Provincial) so the set up we have will work, though, it may be smart to be prepared for possible changes. You never know!

13 Oct 2015, 17:17
#792
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Hi All,
Sorry to bug, yet again, but I am now getting the dreaded 'white screen' when attempting to update an order via edit_orders.php

log message: PHP Fatal error: Call to undefined function validate_for_category() in /home/content/11/6854611/html/shop/admin/includes/functions/extra_functions/edit_orders_functions.php on line 331

line 331

$allow_for_category = validate_for_category($product_id, $coupon_id);

Any help would be greatly appreciated!

13 Oct 2015, 18:09
#793
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Update:
I believe it was an edit I made to the edit_orders.php file (Cosmetic). I uploaded a fresh copy and it is working. Thx.

13 Oct 2015, 18:27
#794
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

gigi3:

Update:
I believe it was an edit I made to the edit_orders.php file (Cosmetic). I uploaded a fresh copy and it is working. Thx.
Thank You for letting us know. out of curiosity, what is the cosmetic change you desired?

14 Oct 2015, 15:32
#795
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I added another 'edit' button directly to the left of the 'add product' button, and added another 'details' button directly below the order total, renaming the .gif 'submit'. The idea is to simplify the screen for cashiers. Edit Orders automatically stores the order which we felt may be confusing for the cashiers with nothing to click to 'complete' the order....

I also commented out the payment method section, as we use only one payment method and currently don't use that portion, again, the goal being to simplify the page for the cashiers.

A fresh edit_orders.php version seems to work, and, after adding the 'edit' and the renamed 'details' button without commenting out the payment method WAS working for a while...then, all of a sudden, after attempting to add a coupon, I get the white screen again.

It seems to happen when a coupon is added. I have recently set up coupons with restricted categories. I'm wondering if that is part of the problem as the error message references categories?

Any thoughts?

14 Oct 2015, 15:48
#796
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

So, I just uploaded another fresh copy of edit_orders.php and it is giving me the 'white screen' when I attempt to add a coupon. It seems it is not the changes I have made.

I am receiving the same error message in the logs:

[14-Oct-2015 08:45:50] PHP Fatal error: Call to undefined function validate_for_category() in /html/shop/admin/includes/functions/extra_functions/edit_orders_functions.php on line 331

Any help would be greatly appreciated!

14 Oct 2015, 16:01
#797
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Added:
I am also noticing that after I get the initial white screen from adding a coupon, I get the white screen for ANY 'edit' I make on the page, save for adding a new product....

14 Oct 2015, 16:17
#798
lat9 avatar

lat9

Administrator

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

Re: Edit Orders v4.0 Support Thread

gigi3:

So, I just uploaded another fresh copy of edit_orders.php and it is giving me the 'white screen' when I attempt to add a coupon. It seems it is not the changes I have made.

I am receiving the same error message in the logs:

Any help would be greatly appreciated!
My copy of /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php has the following code block added, just above the function declaration for eo_debug_action_level_list:

//-bof-20140423-lat9-forum bugfix
if(!function_exists('validate_for_category')) {
	function validate_for_category($product_id, $coupon_id) {
		global $db;
		$retVal = 'none';
		$productCatPath = zen_get_product_path($product_id);
		$catPathArray = array_reverse(explode('_', $productCatPath));
		$sql = "SELECT count(*) AS total
            FROM " . TABLE_COUPON_RESTRICT . "
            WHERE category_id = -1
            AND coupon_restrict = 'Y'
            AND coupon_id = " . (int)$coupon_id . " LIMIT 1";
		$checkQuery = $db->execute($sql);
		foreach ($catPathArray as $catPath) {
			$sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "
              WHERE category_id = " . (int)$catPath . "
              AND coupon_id = " . (int)$coupon_id;
			$result = $db->execute($sql);
			if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'N') return true;
			if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'Y') return false;
		}
		if ($checkQuery->fields['total'] > 0) {
			return false;
		} else {
			return 'none';
		}
	}
}
if(!function_exists('validate_for_product')) {
	function validate_for_product($product_id, $coupon_id) {
		global $db;
		$sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "
            WHERE product_id = " . (int)$product_id . "
            AND coupon_id = " . (int)$coupon_id . " LIMIT 1";
		$result = $db->execute($sql);
		if ($result->recordCount() > 0) {
			if ($result->fields['coupon_restrict'] == 'N') return true;
			if ($result->fields['coupon_restrict'] == 'Y') return false;
		} else {
			return 'none';
		}
	}
}
//-eof-20140423-lat9
18 Oct 2015, 19:30
#799
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I apologize for my late response...I caught a nasty bug and was in bed for the last few days...ugh.

That update seems to work like a charm. Thank you, so much!

24 Oct 2015, 17:15
#800
gigi3 avatar

gigi3

New Zenner

Join Date:
Oct 2015
Location:
BC, Canada
Posts:
41
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Hi All,
I have been searching the forum for info, but haven't come across it yet and thought I'd ask here.

As we are using Zen Cart for In Store orders, I am wondering if there is any addon for when a client pays by cash where you can input the cash amount and it will calculate change?

I am posting this here in the Edit Order thread as it seems logical that most people using Zen Cart for In Store purchases will be using Edit Orders + New Order.

If anyone has any thoughts I'd love to hear them. Thanks!

Thanks.