-
Re: Edit Orders v4.0 Support Thread
In the admin I am getting the message "Warning: Absolute's Product Attribute Grid was detected, however the Product Option Type for Attribute Grid was not fully installed in the database. Temporarily configuring PRODUCTS_OPTIONS_TYPE_ATTRIBUTE_GRID = 23997" whenever we go to the "orders" area in the admin. I tried reinstalling it. The version I had didn't have a database option to install (no SQL file).
The attribute grid group let me know it is edit orders generating this message. Can you tell me how to turn it off? Everything seems to be working...
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
avansant
In the admin I am getting the message "Warning: Absolute's Product Attribute Grid was detected, however the Product Option Type for Attribute Grid was not fully installed in the database. Temporarily configuring PRODUCTS_OPTIONS_TYPE_ATTRIBUTE_GRID = 23997" whenever we go to the "orders" area in the admin. I tried reinstalling it. The version I had didn't have a database option to install (no SQL file).
The attribute grid group let me know it is edit orders generating this message. Can you tell me how to turn it off? Everything seems to be working...
"Absolute's Product Attribute Grid" adds an extra "Product Option Type" to the database. However when testing compatibility with Edit Orders, we found "Absolute's Product Attribute Grid" does not follow the Zen Cart conventions (does not add the type to all locations in the database, does not use a constant, etc). This may cause unintended side effects and potential issues in the future when upgrading Zen Cart / installing additional plugins.
The "warning" will go away once the "Product Option Type" added by "Absolute's Product Attribute Grid" follows Zen Cart conventions. Please do not post "workarounds" in this thread on disabling the warning. Thank You.
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
southshorepizza
If I give something to a customer for free I cannot zero out the tax on an order.
Why not? Changing either the product "tax rate" or "price" both affect the calculation of tax by the Order Total Module (ot_tax). Either can be set to "0" which indicates the product cost was "free" to the customer. This works 100% of the time in a "stock" Zen Cart installation.
NOTE 1: Changing a product to "free" after purchase should not be something one needs to do on a regular basis... If one is offering an item for "free" w/ purchase of XYZ, then an order total module should be used to automatically apply the necessary changes to the products / order.
NOTE 2: If you look closely at coupons (in the US) for "free" or "bogo" offers, you will usually see "excluding sales tax". Why? Because any applicable sales tax must still be paid if the item was "sold" (invoiced at a price greater than 0). If one is required to collect taxes for a location, one usually still needs to collect on the invoiced price.
NOTE 3: In the US you will see some companies list an item as a "gift". In this case they have changed the product itself to be free (and paid any applicable sales tax when they bought the product from the supplier). "Gifts" are not "sales" (and if under a certain amount per year and per recipient) may be exempt from taxation as they are not "sales". Keep in mind the company giving the "gift" in this case paid the applicable "sales" tax for the item when they purchased the item.
NOTE 4: One should consult a tax lawyer about the implications of offering "free" or "discounted" offers. Depending on where the discount is applied (item vs order) different tax rules may apply. Different tax rules may also apply depending upon geographical locations, sales date, and other factors.
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
southshorepizza
... When you edit an order the quantity discount down in the total doesn't have a text box for the amount. ...
I am unable to duplicate this in a stock installation of Zen Cart 1.5+ with the current version of Edit Orders and the Quantity Discount order total module installed. When the Quantity Discount order total is present on an order, both the title and amount are shown inside editable textboxes.
Quote:
Originally Posted by
southshorepizza
... Unable to remove a quantity discount when editing an order. ... The discount also doesn't change if you remove any products. But that would be okay if I could adjust the amount of the discount or remove it. ...
The Quantity Discount order total module automatically calculates the discount amount for your order. The amount is calculated according to how one has configured Quantity Discounts. Because the amount is automatically configured one cannot modify the amount using Edit Orders (this is covered in the readme). This also means attempting to "remove" the Order Total will fail if the Order Total module says "Here is the amount you should charge / discount based upon the order".
I am able to successfully update an order (changing the products and quantities) and see the "Quantity Discount" amount change "automatically" according to settings I configured in a "test" store.
When the discount is no longer applicable for an order (no automatic order total data is returned), the Order Total can be removed the same way as any other order total module. Just clear both the title and the amount and click the update button.
I've verified both of the above on a stock Zen Cart 1.5.1 installation with the current version of Edit Orders and the Quantity Discount order total module installed.
NOTE 1: Currently "Edit Orders" will not remove Order Totals from an order automatically. This was done to support 3rd party modules which were unable to "automatically" calculate Order Total information when loaded in the Zen Cart admin interface.
NOTE 2: When you click "update" inside Edit Orders a number of things occur. Here is a SHORT list:
- The product data for each product is pulled from the database (same as during a customer checkout).
- The product data for each product is updated to reflect any changes entered on the Edit Orders page.
- The Order Total data for the order is calculated (same as during a customer checkout). Instead of using any custom code, Edit Orders calls the Zen Cart code handling modules.
- The Order Total data for the order is updated to reflect any changes entered on the Edit Orders page.
- The Order Total data for the order is re-calculated (same as during a customer checkout). This is done to allow modules doing "automatic calculation" (such as subtotal, tax, and total) to update their values.
-
4 Attachment(s)
Re: EO 4.1 + Reward Points
Sorry I miss understood what my manager was telling me. there is a box.
Attachment 13967
that you can make all the items above free and remove the coupons, and delete the words "quantity discount" and the amount "9.37" from.
Attachment 13969
However when you update and you get the
Attachment 13970
update successful box. You get a total of $2.51
Attachment 13971
I will try to recreate the quantity discount not getting removed. It may have been a browser issue at the store not reloading the entire page since we just upgraded this plugin. But this tax thing needs to be sorted out.
-
Re: EO 4.1 + Reward Points
Free order would be something didn't go right and to make the customer happy they just gave it to them. Perhaps there was a donation.
I called for specifics on quantity discount. He wanted to remove the quantity discount on a large order he sold at a special price. For example a pizza normally cost $10. A school called and wanted 10 and he sold them for $6.00 each. So he edits the order and makes each pizza $6.00 each. But because he has 10 pizzas he cannot get rid of the quantity discount. He has to figure out how much each pizza should cost before the quantity discount. I guess we just have to work around this now that we know what to expect.
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
southshorepizza
... But this tax thing needs to be sorted out.
Yup, especially since I cannot duplicate the "tax thing" you are seeing in a stock Zen Cart 1.5.1 installation with Edit Orders and Quality Discounts. I'd "guess" a modification has been made to your store (and causing the issue)... Or "possibly" the example order you were working with is / was corrupt. Edit Orders does not calculate the tax (ot_tax or whatever tax plugin you have installed does).
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
southshorepizza
Free order would be something didn't go right and to make the customer happy they just gave it to them. Perhaps there was a donation. ...
This would probably be best done using the "Onetime Discount" order total module and adding a note in the order comments as to why the discount was given.
Why? Using the "Onetime Discount" module provides an easy way to record and audit how many times an order is discounted (and how much overall revenue was lost due to unhappy customers, issues, etc). Using such an order total module would also ensure all invoices, reports, and the customer's order history reflect the customer was given a onetime discount.
-
Edit Orders: Add notifiers?
lhungil, would you consider adding a couple of notifiers to the Edit Orders functions?
I've created some customizations that alter the handling of a product within an order and need to perform some additional processing when a product is removed and/or added to the order via Edit Orders. Following are the changes that I've made to /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php to accomplish what I need:
Code:
function eo_add_product_to_order($order_id, $product) {
global $db, $order, $zco_notifier;
...
$order->products[] = $product;
$zco_notifier->notify ('EDIT_ORDERS_ADD_PRODUCT', array ( 'order_id' => (int)$order_id, 'orders_products_id' => $order_products_id, 'product' => $product ));
return $product;
}
Code:
function eo_remove_product_from_order($order_id, $orders_products_id) {
global $db, $order, $zco_notifier;
// First grab the order <==> product mappings
$orders_products_id_mapping = eo_get_orders_products_id_mappings((int)$order_id);
// Handle product stock
if (STOCK_LIMITED == 'true') {
$query = $db->Execute(
'SELECT `products_id`, `products_quantity` ' .
'FROM `' . TABLE_ORDERS_PRODUCTS . '` ' .
'WHERE `orders_id`=\'' . (int)$order_id . '\' ' .
'AND `orders_products_id`=\'' . (int)$orders_products_id . '\''
);
while (!$query->EOF) {
if (DOWNLOAD_ENABLED == 'true') {
$check = $db->Execute(
'SELECT `p`.`products_quantity`, `pad`.`products_attributes_filename`, `p`.`product_is_always_free_shipping` ' .
'FROM `' . TABLE_PRODUCTS . '` AS `p` ' .
'LEFT JOIN `' . TABLE_PRODUCTS_ATTRIBUTES . '` AS `pa` ON `p`.`products_id`=`pa`.`products_id` ' .
'LEFT JOIN `' . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . '` AS `pad` ON `pa`.`products_attributes_id`=`pad`.`products_attributes_id` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
}
else {
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` AS `p`' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
}
if (!$check->EOF && (DOWNLOAD_ENABLED != 'true' || $check->fields['product_is_always_free_shipping'] == 2 || !$check->fields['products_attributes_filename'] )) {
$sql_data_array = array(
'products_quantity' => $check->fields['products_quantity'] + $query->fields['products_quantity'],
'products_ordered' => $check->fields['products_ordered'] - $query->fields['products_quantity']
);
if($sql_data_array['products_ordered'] < 0) $sql_data_array['products_ordered'] = 0;
if($sql_data_array['products_quantity'] > 0) {
// Only set status to on when not displaying sold out
if (SHOW_PRODUCTS_SOLD_OUT == '0') {
$sql_data_array['products_status'] = 1;
}
}
zen_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', 'products_id = \'' . (int)$query->fields['products_id'] . '\'');
}
$query->MoveNext();
}
unset($check, $query, $sql_data_array);
}
$zco_notifier->notify ('EDIT_ORDERS_REMOVE_PRODUCT', array ( 'order_id' => (int)$order_id, 'orders_products_id' => (int)$orders_products_id ));
...
}
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
izar74
Sorry Diva, the only purpouse of the post was to point out that the modules have problems together, and if someone already figured it out to say it.
New to this forum hope I am posting correctly. Sorry if this has been fixed but I searched and searched. I'm not a web site developer or hard core programmer but I had this problem when I originally installed edit orders v2. I fixed it then and forgot about it but I just upgraded to v4 with zen cart 1.5.1. When I did I was very careful to merge the core files but I just wasn't thinking and copied over some files. The same problem arouse. When you try to add an order from admin -- blank screen.
This is what I did to fix it.
includes/classes/order_total.php around line 81.
changed this:
if (!isset($GLOBALS[$class])) continue;
to this:
if (IS_ADMIN_FLAG)
if (isset($GLOBALS[$class])) continue;
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
burtonte
... I'm not a web site developer or hard core programmer ... I just upgraded to v4 with zen cart 1.5.1. When I did I was very careful to merge the core files ... When (I) try to add an order from admin -- blank screen. ...
A "blank screen" in Zen Cart means a problem occurred. There WILL in most cases be a log of the issue. The starting point for diagnosing any problem is to locate any log file (Zen Cart debug log). The contents of the log files will usually tell you where (and why) a problem occurred and allow for troubleshooting. This log would be useful to the volunteers here at the Zen Cart forums (to help us help you).
Zen Cart does not natively (out of box) support creating a new order from the administrative interface. What "modification" are you using to "create" a new order using the Zen Cart admin? Name + Version + Link would be useful. If errors are occurring there is a good possibility something is not quite right with either the 3rd party module or the installation of the 3rd party module.
In a "stock" Zen Cart 1.5.1 installation, there is no code around line 81 of "/includes/classes/order_total.php" which looks like what you are describing. I am going to guess you (or someone else) made modifications to the file (introducing an issue)...
Edit Orders 4.1+ requires "/includes/classes/order_total.php" to properly load under both the catalog (store front) and admin interface. If order total modules or other processing are "excluded" via a check like the one you are describing other errors and miscalculations may occur. I would not recommend disabling portions of this critical module loader (as it appears your line of code may)...
NOTE 1: I would strongly suggest rechecking your upgrade to Zen Cart 1.5 and make sure all the core files were updated / merged correctly. Typically when upgrading Zen Cart one starts with clean files from the new version of Zen Cart, determines what alterations (if any) have been made to the old files, and only (if needed) applies the "changes". Doing a full merge can cause issues...
NOTE 2: Edit Orders 4.1+ includes a "slightly" modified version of "/includes/classes/order_total.php" designed to allow the "stock" (and most other) order total modules to load from the administrative side of Zen Cart. The one supplied with Edit Orders 4.1+ can directly replace the stock Zen Cart 1.5 version of the file.
-
Re: Edit Orders v4.0 Support Thread
I will try to supply as much info as I can. I am sunning zen cart 1.5.1 and I originally installed edit orders version 2.x.x. I have many many addons installed on top of the out-of-the box zen cart plus some of my own. I realize that this doesn't help but I seem to remember during the original install of zen cart and edit orders this problem arouse. I searched and searched then and found other people with the same problem when installing edit orders but no fixes. The log files complained about GetRewardPoints() as an undefined function. I assumed this was because it's not an admin function. I tried setting up the scope so admin could see this function but again I don't fully understand how php/zen cart handles scope. My assumption again was that reward points might not be calculated during an admin order entry. This was not a problem with me because I was going to use that as an excuse to drive customers to use my web site instead of phone orders but all seems to work for now. It's a new release so...we will see I'm sure
-
Re: Edit Orders v4.0 Support Thread
right... but keep in mind that no one can help you on the support forums with guesses. you really are going to have to post your error log messages.. it really helps the community to help you
Quote:
Originally Posted by
burtonte
I will try to supply as much info as I can. I am sunning zen cart 1.5.1 and I originally installed edit orders version 2.x.x. I have many many addons installed on top of the out-of-the box zen cart plus some of my own. I realize that this doesn't help but I seem to remember during the original install of zen cart and edit orders this problem arouse. I searched and searched then and found other people with the same problem when installing edit orders but no fixes. The log files complained about GetRewardPoints() as an undefined function. I assumed this was because it's not an admin function. I tried setting up the scope so admin could see this function but again I don't fully understand how php/zen cart handles scope. My assumption again was that reward points might not be calculated during an admin order entry. This was not a problem with me because I was going to use that as an excuse to drive customers to use my web site instead of phone orders but all seems to work for now. It's a new release so...we will see I'm sure
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
burtonte
... I am sunning zen cart 1.5.1 and I originally installed edit orders version 2.x.x. I have many many addons installed on top of the out-of-the box zen cart plus some of my own. ...
Edit Orders 2.x and 4.1.x run completely different code. So what applied to a past version does not necessarily apply to the current version.
Edit Orders 2.x is not (to my knowledge) compatible with Zen Cart 1.5.x. Based on your statement of installing Edit Orders 2.x, it sounds like your store may have been upgraded "in-place" multiple times over the years. Over time this can result in lots of clutter, outdated files, and other issues. If this is the case with your site, it could be a contributing factor...
It may be in your best interest to start over with a clean install of the current version of Zen Cart 1.5.x (if the above is true). Once installed, start with a new template (designed for 1.5.x). Upgrade a "copy" of your old database and test. Only install Zen Cart plugins / modifications designed for 1.5.x (and required by your business needs). When done testing (and ensuring all required functionality works), deploy to the new site.
NOTE 1: I will not be responding further on this subject until answers to all of the questions listed in the "Posting Tips" have been supplied, answers to the questions asked in this thread have been supplied, and the response shows appropriate research (including reading the README, searching the forums, and applying known patches) has been completed.
NOTE 2: The appropriate place to change how individual order total modules operate is inside the order total modules themselves. Changes should not applied by editing the core loader / processing class "order_total.php".
-
Re: Edit Orders v4.0 Support Thread
Ok sorry for the missing information. I have included the differences between the vanilla zencart 1.5.1 install and the edit_orders 4.1.4 install. The responses I received caused me to go back and research what I think to be the real issue. Thanks again for your responses...
includes/classes/order_total.php
function order_total() {
global $messageStack;
if (defined('MODULE_ORDER_TOTAL_INSTALLED') && zen_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
$module_list = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
reset($module_list);
while (list(, $value) = each($module_list)) {
// Fixes for when called from ADMIN
$lang_file = null;
// edit_orders v4.1.4 has this here.. causes blank screen when add new order from admin
// $module_file = DIR_WS_MODULES . 'order_total/' . $value;
if(IS_ADMIN_FLAG === true) {
$lang_file = zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/', $value, 'false');
$module_file = DIR_FS_CATALOG . $module_file;
}
else {
$lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/', $value, 'false');
}
if (@file_exists($lang_file)) {
include_once($lang_file);
} else {
if (IS_ADMIN_FLAG === false && is_object($messageStack)) {
$messageStack->add('header', WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
} else {
$messageStack->add_session(WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
}
}
// Moved to original position from zen cart 1.5.1 install to make add new order work in admin
$module_file = DIR_WS_MODULES . 'order_total/' . $value;
if (@file_exists($module_file)) {
include_once($module_file);
$class = substr($value, 0, strrpos($value, '.'));
$GLOBALS[$class] = new $class;
$this->modules[] = $value;
}
}
}
}
-
Re: Edit Orders v4.0 Support Thread
For anyone else reading this thread. Please disregard changes posted by burtonte.
In a properly configured store, moving that line will usually result in order total modules not loading from the admin interface. This includes "subtotal", "total", "tax", etc.
If order total modules are not loaded Edit Orders 4.1+ will not function correctly.
-
Re: Edit Orders v4.0 Support Thread
Does anyone have a copy of the plugin's v4.0.2 zip-file? I'm trying to "get a feeling" for the complexity of an upgrade to the most recent version.
-
Re: Edit Orders v4.0 Support Thread
FWIW, EO 4.1.4 installed without a hitch over the v4.0.2 "mystery version"!
I did, however, run into an issue that I'm not sure how to resolve:
SCENARIO: I've got an order total (a deduction) where the amount of the deduction is, essentially, dependent on the value of the cart/order. It uses the order-class structure to determine the overall order value and, if the order's total is less than some configurable value, then discount is not applied.
EO and my OT recalculate the deduction properly so long as the deduction doesn't change from a non-zero to a zero value! That's because, when the deduction is 0, the order-total class doesn't return that OT value as part of its modules. The order's subtotal, tax and total values are correct, it's just that the now-zero deduction doesn't get removed from the order's totals.
Any guidance would be much appreciated.
-
Re: Edit Orders v4.0 Support Thread
FWIW, here's how I corrected my issue (/YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php):
Code:
function eo_update_database_order_totals($oID) {
global $db, $order;
// Load required modules for order totals if enabled
if(defined('MODULE_ORDER_TOTAL_INSTALLED') && zen_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
// Load order totals.
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'order_total.php');
$GLOBALS['order_total_modules'] = new order_total();
// Load the shopping cart class into the session
eo_shopping_cart();
// This fixes an issue caused by ot_shipping assuming shipping tax amount
// has not already been added to the shipping cost and order tax.
if(array_key_exists('shipping_tax', $order->info)) {
$order->info['tax'] -= $order->info['shipping_tax'];
if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] -= $order->info['shipping_tax'];
}
// Reset the final total (include tax if not already tax-inc)
// This code causes the order totals to be correctly calculated.
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost'];
} else {
$order->info['total'] = $order->info['subtotal'] + $order->info['tax'] + $order->info['shipping_cost'];
}
// Process the order totals
$order_totals = $GLOBALS['order_total_modules']->process();
// Update the order totals in the database
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
eo_update_database_order_total($oID, $order_totals[$i]);
}
//-BOF-lat9-account for order total modules that have been removed
if (count ($order->totals) > $n) {
for ($i=0, $totals_titles = array (); $i<$n; $i++) {
$totals_titles[] = $order_totals[$i]['title'];
}
for ($i=0, $n=count($order->totals); $i<$n; $i++) {
if (!in_array ($order->totals[$i]['title'], $totals_titles)) {
$db->Execute ("DELETE FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = $oID AND title = '" . zen_db_input ($order->totals[$i]['title']) . "' LIMIT 1");
}
}
unset ($totals_titles);
}
//-EOF-lat9
unset($order_totals);
}
}
-
Re: Edit Orders v4.0 Support Thread
Hello,
I'm running a fresh install of ZenCart v1.5.1 and Edit Orders 4.1.4.
I've searched the threads and installation document and don't see the answer to this.
Is this compatible with "Fast and Easy Checkout". Are there any issues I need to consider before installing it?
Thanks
-
Re: Edit Orders v4.0 Support Thread
Hello all,
I have just installed this on a fresh 1.51 installation and it didn't throw up any error messages on installation.
Adding products to an existing order works without a hitch but attempting to edit an order in any way, such as the quantities, results in a HTTP 500 Internal Server Error being thrown up.
Can someone offer any advice or help troubleshooting?
Thanks!
Edit Orders 4.1.4
ZC 1.51
PHP Version 5.4.28
-
Re: Edit Orders v4.0 Support Thread
From the order details page, the order status can be updated without problems, however, when updating the status from the edit order page I get the same Error 500 but on clicking back, the order status has indeed been updated.
-
Re: Edit Orders v4.0 Support Thread
A "500" error typically indicates an error occured. Please check your server error logs. This should contain additional information (unless logging is disabled). Please post the error messages so we can help futher troubleshoot.
The most common causes are issues with the "manual" portion of the installation or 3rd party order total modules installed (and enabled) which do not support being loaded from the Zen Cart admin interface.
-
1 Attachment(s)
Re: Edit Orders v4.0 Support Thread
I've got some baffling math going on and not sure what to poke to get Edit Orders to wake up.
ZC 1.5.1, Edit Orders 4.1.4
I had to change one of the items in this person's order. Same price, different style. Everything seemed to be ok yesterday and I printed out a correct packing slip. When I glanced at the order this morning as I was preparing to ship, one item was missing ($17.47); this was not the item that was editted. So I manually added the missing item in and now the math is incorrect.
3@ $18 - $54
1@ $18 - $18
2@ $18 - $36
1@ $17.47
1@ $17.47
subtotal- $160.40 ?
the extra amount comes to $17.46. Note that this was a currency conversion order from Russia and so that would account for the penny.
No error messages or other warnings. There won't be a log file since I did not have this turned on initially. It's not stopping me from shipping but it would be nice to figure out what's going on...
Attachment 14122
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
linniedarling
... I had to change one of the items in this person's order. Same price, different style. Everything seemed to be ok yesterday and I printed out a correct packing slip. When I glanced at the order this morning as I was preparing to ship, one item was missing ($17.47); this was not the item that was editted. ...
The list of products and product attributes for an order are stored in the database. You have indicated everything looked correct yesterday. If you still have a copy of the "packing slip" you printed yesterday can you double check and see if everything was correct yesterday?
If the packing slip was correct
This indicates something OTHER than this module most likely resulted in one of the products going missing from the database table "orders_products"... If this is the case it would be a really good idea to determine what the cause was to avoid running into it again.
I'd backup the database and then run a "repair" of the tables (if needed). If no repair was needed, I'd check the MySQL logs and the Zen Cart activity log (to see when and possibly what and who made the change).
If the packing slip was not correct
Are there any Zen Cart debug logs (these are enabled by default in Zen Cart 1.5.1)?
What order total modules are enabled?
Can you provide some additional details about your server environment ("admin" -> "version")?
Have you been able to duplicate this behavior with a test order? Specific steps to duplicate?
If occurs with specific products / attributes, what differs from other products?
Quote:
Originally Posted by
linniedarling
... So I manually added the missing item (using Edit Orders) and now the math is incorrect. ...
This is what I would expect if somehow one of the database tables relating to the order were somehow modified outside Edit Orders (or if a 3rd party order total module crashed during the update).
When a product is added the final price is added to the "subtotal" in the database.
When a product is removed the final price is subtracted to the "subtotal" in the database.
Basically what appears to have occurred is somehow the database entry storing the running "subtotal" for the order is out of sync with the actual order's subtotal.
If you know the order number and are comfortable working with phpmyadmin:
- Make a database backup to be on the safe side.
- Correct the products (including attributes, quantities, and price) using "Edit Orders".
- Calculate the correct "subtotal" and store for future reference.
- In phpmyadmin open up the "orders_total" database table and find the row matching the affected "orders_id" with "class"="ot_subtotal".
- Edit both the "text" and "value" columns in the row with the correct "subtotal".
- Go back to "Edit Orders" and click "update".
- Verify pricing is now correct.
NOTE: The above instructions will only work when the subtotal is calculated based only upon the products added to an order. There are some circumstances where the subtotal may contain additional costs or deductions.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
Running EO 4.1.2 on Zen Cart v1.5.1. Storefront highly customized; admin not so much! The only thing that might be interfering is the "Minimum Customer Account" plugin, since I'm getting the edit_orders message:
Code:
Warning: One or more of the customer address fields contains a country name unknown to Zen Cart ("Locations / Taxes"->"Countries").
Taxes and some shipping modules may not function correctly until the issue has been resolved.
This typically occurs if someone deletes or renames a country's name from Zen Cart ("Locations / Taxes"->"Countries"). You can fix the issue by doing one of the following:
Add the country (and name) back to the Zen Cart database.
Adjust the country name to match one of the country names in the Zen Cart database.
There is a virtual product that is $1.00 and the product-quantity is used to determine the final price. When an order is initially placed, the quantity is 1. I go to the admin to use edit_orders and change the quantity to 100 and click "Update", the line-item total for the product is updated to $100.00 but the order_totals total remains at $1.00. The order includes neither tax nor shipping.
I don't know if this is a procedural issue on my part, an incompatibility or something else. I'm off to investigate further.
--> One other thing I noticed is that the only order_total that is enabled is the ot_total (no ot_subtotal).
I got this same error when trying to edit orders for products that didn't require a shipping address such as virtual orders. I temporarily resolved this Warning error by editing the edit_order.php file from Edit Order 1.4.1. Line 655 was throwing the error as it was checking for a shipping address country when none was needed. So I commented out the line.
Original:
if(!is_array($order->customer['country']) || !array_key_exists('id', $order->customer['country']) ||
!is_array($order->billing['country']) || !array_key_exists('id', $order->billing['country']) ||
!is_array($order->delivery['country']) || !array_key_exists('id', $order->delivery['country'])) {
$messageStack->add(WARNING_ADDRESS_COUNTRY_NOT_FOUND, 'warning');
to:
if(!is_array($order->customer['country']) || !array_key_exists('id', $order->customer['country']) ||
!is_array($order->billing['country']) || !array_key_exists('id', $order->billing['country']) /*||
!is_array($order->delivery['country']) || !array_key_exists('id', $order->delivery['country'])*/) {
$messageStack->add(WARNING_ADDRESS_COUNTRY_NOT_FOUND, 'warning');
This section
|| !is_array($order->delivery['country']) || !array_key_exists('id', $order->delivery['country'])
is commented out. Now is doesn't check for the country and no more error.
Might not be totally related to your problem but my issue gave the same error.
-
Re: Edit Orders v4.0 Support Thread
Hi Niki,
Thanks for the tip. I have not had to actually edit any orders since. I'm waiting until it happens again to try to debug further.
However I do think it's related to Shipstation "pushing" some of the order information back after I had editted. I'm in a one sided dialog right now trying to discover what's going on.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
Niki
I got this same error when trying to edit orders for products that didn't require a shipping address such as virtual orders. I temporarily resolved this Warning error by editing the edit_order.php file from Edit Order ...
I would caution against disabling warnings output by Edit Orders. Warnings are usually displayed for well thought out reasons. The one you mention exists to indicate the order details (specifically all of the addresses) are not fully populated in the database (or may contain invalid information). It goes on to let you know the missing / incorrect data may cause problems with some order total modules and tax calculation. This specific WARNING is only a warning and does not indicate a failure within Edit Orders.
You do bring up a good point however. Perhaps this warning should be split into two parts... One for missing information and a second one for invalid data. This would allow us to emit more accurate "how to fix" information. Or perhaps "Edit Orders" should just automatically copy the billing address to the shipping address fields when no shipping address is entered...
Some of the reasons for this warning message:
A handful of the order total modules for Zen Cart attempt to read addresses (such as the shipping address) and can crash / emit invalid totals when various address fields are not populated (or contain invalid data). When this address data is not present and one of these order total modules enabled, editing an order may result in corrupted order information (and pricing) in the database.
When a new order is created (on behalf of a customer - such as email or phone orders) directly in the administrative interface, this also serves as a reminder to the person entering the order to fill out all of the address fields which may be required by various order total modules.
For example, what happens if for some reason the order needs to have one of the products shipped? While a rare case, a customer may call in and ask instead for a physical copy and to have the physical copy shipped. Editing the order to add shipping will cause problems with pricing and tax if the billing address is not present
So even when a purchase may be for "virtual only" products, if you are going to edit the order, entering the shipping address (populating with the billing address) is usually a good idea.
NOTE 1: just as a reminder, Edit Orders should ONLY be used to edit customer details / addresses, products in the order, and order totals. It should not be used simply for changing the order status. If only changing the order status (or adding comments), it is always better to use the "details" button instead.
NOTE 2: If one reads the very next post after the one quoted by Niki, one will notice the actual cause of the problem for the OP (Edit Orders requires ot_subtotal enabled). The current versions of Edit Orders display a warning when ot_subtotal is not enabled.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
linniedarling
... I do think it's related to Shipstation "pushing" some of the order information back after I had editted. ...
Hmmm. I do not see any SQL statements in the Shipstation module (in the plugins section of this website) which would alter products or order totals... Are you using a different module for Shipstation?
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
So even when a purchase may be for "virtual only" products, if you are going to edit the order, entering the shipping address (populating with the billing address) is usually a good idea.
The front-end checkout skips the shipping step of the checkout if the entire order contains only virtual products. I would think that f the ENTIRE order contains only virtual products that Edit Orders should NOT throw this warning at all...
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
DivaVocals
The front-end checkout skips the shipping step of the checkout if the entire order contains only virtual products. I would think that f the ENTIRE order contains only virtual products that Edit Orders should NOT throw this warning at all...
So you would be in favor of me splitting up this error message. :-)
One warning for when ZERO shipping information has been added AND if after looping through the current products in the order all items are virtual.
One warning for the actual reason this check was added (invalid country data which causes pricing, tax, and some order total modules to crash).
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
So you would be in favor of me splitting up this error message. :-)
One warning for when ZERO shipping information has been added AND if after looping through the current products in the order all items are virtual.
One warning for the actual reason this check was added (invalid country data which causes pricing, tax, and some order total modules to crash).
Not sure that first warning is required at all if the entire order consists of virtual products... The front-end checkout doesn't show any warning message.. it simply skips the shipping step..
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
DivaVocals
Not sure that first warning is required at all if the entire order consists of virtual products... The front-end checkout doesn't show any warning message.. it simply skips the shipping step..
:lookaroun That is what I said in my head when typing that last post (although I seem to have typed the opposite).
Perhaps some sleep (or at least a break) is in order :cool:
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
:lookaroun That is what I said in my head when typing that last post (although I seem to have typed the opposite).
Perhaps some sleep (or at least a break) is in order :cool:
Perhaps a nap is in order.. :laugh:
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Hmmm. I do not see any SQL statements in the Shipstation module (in the plugins section of this website) which would alter products or order totals... Are you using a different module for Shipstation?
Wow, I wasn't even aware of a Shipstation module. No, I'm not using any ZC Shipstation modules. I gave Shipstation an admin access and password and it updates the order(s) as shipped or cancelled and perhaps even does some other things.
The particular order that I had this problem with I had to modify not just the items in the order but also the shipping address as it was too long to print on the 4x6 label. I made the mistake, probably, of fixing the address within Shipstation. Afterwards I found out that the customer wanted a different color and then changed the items in her order and printed the packing slip. The next morning I pulled the order again from the Shipstation side which removed my address fix; I fixed the address a second time within Shipstation, prepped the label and found all the customs information had disappeared. I hand entered the customs information and then printed the shipping label at which time Shipstation sends back a "delivered" status. When I went back to my admin area I caught the bad total.
I'm waiting until I have to edit another order and will carefully monitor each step to see if I can catch where (and if) things go awry.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
linniedarling
Hi Niki,
Thanks for the tip. I have not had to actually edit any orders since. I'm waiting until it happens again to try to debug further.
However I do think it's related to Shipstation "pushing" some of the order information back after I had editted. I'm in a one sided dialog right now trying to discover what's going on.
Quote:
Originally Posted by
linniedarling
Wow, I wasn't even aware of a Shipstation module. No, I'm not using any ZC Shipstation modules. I gave Shipstation an admin access and password and it updates the order(s) as shipped or cancelled and perhaps even does some other things.
The particular order that I had this problem with I had to modify not just the items in the order but also the shipping address as it was too long to print on the 4x6 label. I made the mistake, probably, of fixing the address within Shipstation. Afterwards I found out that the customer wanted a different color and then changed the items in her order and printed the packing slip. The next morning I pulled the order again from the Shipstation side which removed my address fix; I fixed the address a second time within Shipstation, prepped the label and found all the customs information had disappeared. I hand entered the customs information and then printed the shipping label at which time Shipstation sends back a "delivered" status. When I went back to my admin area I caught the bad total.
I'm waiting until I have to edit another order and will carefully monitor each step to see if I can catch where (and if) things go awry.
Ummmmm there is a Shipstation module.. the only way your store could communicate with Shipstation is if a module is installed.. It's probably this one:
http://www.zen-cart.com/downloads.php?do=file&id=1324 (ShipStation USPS, UPS, and FedEx Shipping Module) Which is described as follows:
This module integrates your Zen Cart site with the ShipStation web-based shipping system.
and you've just described the problem and confirmed that the issue isn't with Edit Orders but with Shipstation overriding your order edits with the original order data.. (happens when you pull order from Shipstation back to Zen Cart)
-
Re: Edit Orders v4.0 Support Thread
Running zencart 1.51
Edit order vs 1.4.1 along side Admin New Customer 1.3 and Admin New Order 1.4
When entering order details via Edit Orders to add a new product, along each step I get the following 'error' messages from the browser i.e Done but with errors.... Object Required
Line numbers are in relation to "action Add Product" along each step
258 char 4 - <TR> tag
263 char 4 - seems to refer to If statement regarding eo_debug_action_level ??
268 char 4 - IF statement
After clicking [Add Now]
Line numbers are
1269 char 4 - </TR> closing table row tag
1274 char 4 - </TR> closing table row tag with <?php>.... unset ()
All error notifications don't seem to cause an issue with the function of the module. I'm just curious what could be throwing out these errors. What "object" are they requiring.
Also, I don't use TY Tracker as I'm in Australia. Can I remove these code blocks or will they just be ignored by the Edit Order module?
Thank you in advance for any input.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
Niki
Also, I don't use TY Tracker as I'm in Australia. Can I remove these code blocks or will they just be ignored by the Edit Order module?
Thank you in advance for any input.
Leave the code alone.. If you don't use Ty Tracker then the code doesn't need to be removed..
BTW, Ty Package Tracker isn't an "American" module, it is a SHIPPING TRACKING module.. which means it can be used with nearly any shipper you add when it is configured.. (Including those in Australia)
-
Re: EO 4.1 + Reward Points
I'm confused. I carefully read the read me instructions and successfully installed Super Orders.
I'm in trouble now, because I want to add Edit Orders and according the the read-me, Edit Orders should have been installed BEFORE Super Orders.
Quote:
Originally Posted by Super Orders Add-On's Integration
In order for these modules to work with Super Orders it is presumed that you already have these modules installed and working correctly. To use them with Super Orders, you only need to turn on the corresponding admin flag - see Figure 2 & 3 below.
If you don't have any of these modules installed, but DO plan to install them to use with Super Orders, we STRONGLY suggest that you install them BEFORE YOU INSTALL SUPER ORDERS. Make sure you get them working correctly FIRST before you install Super Orders.
However, in searching to find out what to do about this I saw this:
Quote:
Originally Posted by
lhungil
....Once everything with Ty Package Tracker and Super Orders is installed (and fully working), running the Edit Orders installer again should get you back up and running.
NOTE 1: Reading the README for Edit Orders, it states Ty Package Tracker and Super Orders should be installed PRIOR to Edit Orders... Reading the README for Super Orders, it states Ty Package Tracker should be installed PRIOR to installing Super Orders to avoid potential problems... So the correct order of installation to avoid issues would be Ty Package Tracker, Super Orders, Edit Order.
So - I installed Edit Orders, and I get a nice blank screen when I click on the edit button.
Before I start re-installing stuff, can someone clarify what order I should do things in? Is this fixable?
Should I completely install Edit Orders again and then completely re-install Super Orders? I have no personally modified files to merge.
AND - what if I ever want to add TY Package Tracker? Should I do it now - before I re-install Super Orders to avoid trouble later?
-
Re: EO 4.1 + Reward Points
In general a "blank page" means an error occurred. Before starting over, if you could answer a few questions, we may be able to give more specific help.
Quote:
Originally Posted by
Three Sisters
... I installed Edit Orders, and I get a nice blank screen when I click on the edit button. ...
Did you run the edit orders installer (step 3 - Install)?
What messages (if any) did you see at the top of the screen (during step 3 - Install)?
What is the URL in the browser's address bar after you click "edit" (replace your admin folder name with admin)?
What are the contents of any Zen Cart "debug" logs generated when clicking "edit" (use code tags)?
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
lhungil
Did you run the edit orders installer (step 3 - Install)?
Yes.
Quote:
Originally Posted by
lhungil
What messages (if any) did you see at the top of the screen (during step 3 - Install)?
I can't remember the message exactly, but it was successful. No errors.
Quote:
Originally Posted by
lhungil
What is the URL in the browser's address bar after you click "edit" (replace your admin folder name with admin)?
/admin/edit_orders.php?page=1&oID=8696&action=edit
Quote:
Originally Posted by
lhungil
What are the contents of any Zen Cart "debug" logs generated when clicking "edit" (use code tags)?
[19-Jun-2014 12:20:17] PHP Warning: include_once(/path_I_know/includes/modules/shipping/ups.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /path_I_know/includes/classes/shipping.php on line 67
[19-Jun-2014 12:20:17] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening '/path_I_know/includes/modules/shipping/ups.php' for inclusion (include_path='.:/usr/lib64/php:/usr/lib/php') in /path_I_know/includes/classes/shipping.php on line 67
[19-Jun-2014 12:20:17] PHP Fatal error: Class 'ups' not found in /path_I_know/includes/classes/shipping.php on line 68
OK - that was revealing - but what does it mean? I forgot the new version of ZC can do that. I'm re-building my site. Was a 1.3.8a database upgraded to a 1.5.1.
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
Three Sisters
... "Failed opening '/path_I_know/includes/modules/shipping/ups.php'" ...
Basically, that error message is PHP stating it was unable to load the specified file.
If "path_I_know" is your "catalog" (/) directory:
The usual cause is the "old" store had a "ups" shipping module installed and enabled. I'd guess the "new" store does not have the "ups" shipping module installed. I'd also guess before exporting / upgrading the database the shipping modules were not removed using the Zen Cart admin. When this sequence of events occurs, the Zen Cart database still thinks the modules exists and are enabled. This triggers the shipping class to load the corresponding files (which are not present) and thus the above error message.
Potential Fixes: Install the "ups" module (files, then remove and install from the Zen Cart admin interface to clean up the database). Or manually remove the entry for "ups.php" from the list of installed modules in the Zen Cart database. "SELECT * FROM `configuration` WHERE `configuration_key`='MODULE_SHIPPING_INSTALLED'".
If "path_I_know" is your "admin" (/admin) directory:
Most likely one of the paths in "/admin/includes/configure.php" is not right or when merging files during the installation of "Edit Orders" a merge was bungled (possibly in "/includes/classes/shopping.php").
-
Re: EO 4.1 + Reward Points
Simple fix! Thanks a million for explaining. It was the catalog directory. Sorry - didn't mean to be ambiguous. Thought if I didn't write "admin" it was assumed. But then, I guess it's never safe to assume. :)
So everything works now (Super Orders and Edit Orders). Is it too late to add the TY Package Tracker?
-
Re: EO 4.1 + Reward Points
Quote:
Originally Posted by
Three Sisters
Simple fix! Thanks a million for explaining. It was the catalog directory. Sorry - didn't mean to be ambiguous. Thought if I didn't write "admin" it was assumed. But then, I guess it's never safe to assume. :)
So everything works now (Super Orders and Edit Orders). Is it too late to add the TY Package Tracker?
No.. follow the readme instructions pay particular attention the the integration with other modules..
-
Re: EO 4.1 + Reward Points
Never mind, I'm not sure what I saw.
-
Re: Edit Orders v4.0 Support Thread
Back again (sigh). Running Edit Orders 1.4.4 (all forum-specified updates applied) on Zen Cart v1.5.1 for a store that uses a bunch of dropdown attributes to include onetime-charges for various product features.
If I edit an order and change one of these attributes (clicking the "Update" button), the proper onetime charge is recorded in the orders_products_attributes table, but the orders_products table's onetime_charges field does not get updated. The following code fragment is in the edit_orders_functions.php module's eo_get_new_product function; I'm thinking that this is where I need to make the change, given the fact that the DROPDOWN type attribute is being handled by the do-nothing default clause. Any guidance would be appreciated!
Code:
// Handle attributes
if(is_array($product_options) && count($product_options > 0))
{
$retval['attributes'] = array();
include_once(DIR_WS_CLASSES . 'attributes.php');
$attributes = new attributes();
foreach($product_options as $option_id => $details) {
$attr = array();
switch($details['type']) {
case PRODUCTS_OPTIONS_TYPE_TEXT:
case PRODUCTS_OPTIONS_TYPE_FILE:
$attr['option_id'] = $option_id;
$attr['value'] = $details['value'];
if($attr['value'] == '') continue 2;
// There should only be one text per name.....
$get_attr_id = $attributes->get_attributes_by_option($product_id, $option_id);
if(count($get_attr_id) == 1) $details['value'] = $get_attr_id[0]['products_attributes_id'];
unset($get_attr_id);
break;
case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
if(!array_key_exists('value', $details)) continue 2;
$tmp_id = array_shift($details['value']);
foreach($details['value'] as $attribute_id) {
// We only get here if more than one checkbox per
// option was selected.
$tmp = $attributes->get_attribute_by_id($attribute_id, 'order');
$retval['attributes'][] = $tmp;
// Handle pricing
$prices = eo_get_product_attribute_prices(
$attribute_id, $tmp['value'], $product_qty
);
unset($tmp);
if(!$query->EOF) {
$retval['onetime_charges'] += $prices['onetime_charges'];
$retval['final_price'] += $prices['price'];
}
}
$details['value'] = $tmp_id;
$attr = $attributes->get_attribute_by_id($details['value'], 'order');
unset($attribute_id); unset($attribute_value); unset($tmp_id);
break;
default:
$attr = $attributes->get_attribute_by_id($details['value'], 'order');
}
$retval['attributes'][] = $attr;
if(!$query->EOF) {
// Handle pricing
$prices = eo_get_product_attribute_prices(
$details['value'], $attr['value'], $product_qty
);
$retval['onetime_charges'] += $prices['onetime_charges'];
$retval['final_price'] += $prices['price'];
}
}
unset($query, $attr, $prices, $option_id, $details);
}
-
Re: Edit Orders v4.0 Support Thread
-
Re: Edit Orders v4.0 Support Thread
Thanks, lhungil. I found another "funny" with the dropdown (and possibly other flavors) of attributes; the ordering of the attribute values in the dropdown were all over the place, i.e. not in their defined sort-order. I made the following change to the /YOUR_ADMIN/includes/classes/attributes.php module to correct:
Code:
/**
* Returns a multidimensional array containing the product attribute options
* id / name / value rows for the specified product sorted by option id.
*
* @param int|string $zf_product_id the specified product id.
* @param bool $readonly include readonly attributes not required to add a
* product to the cart, defaults to false.
* @return array
*/
function get_attributes_options($zf_product_id, $readonly = false) {
global $db;
$query = 'SELECT attr.products_attributes_id, attr.products_id, attr.options_id, opt.products_options_name, val.products_options_values_name, opt.products_options_type, products_options_size, opt.products_options_rows ' .
'FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' AS attr ' .
'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS .
' AS opt ON attr.options_id = opt.products_options_id ' .
'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS_VALUES .
' AS val ON attr.options_values_id = val.products_options_values_id ' .
'WHERE attr.products_id = \'' . (int)$zf_product_id . '\' ' .
'AND val.language_id = \'' . (int)$_SESSION['languages_id'] . '\' ' .
'AND val.language_id = opt.language_id ';
// Don't include READONLY attributes if product can be added to cart without them
if(PRODUCTS_OPTIONS_TYPE_READONLY_IGNORED == '1' && $readonly === false) {
$query .= 'AND opt.products_options_type != \'' . PRODUCTS_OPTIONS_TYPE_READONLY . '\' ';
}
//-bof-20140712-lat9-Fix up attributes' sort order.
// $query .= 'ORDER BY `opt`.`products_options_sort_order`, `attr`.`options_id`';
$query .= 'ORDER BY `attr`.`options_id`, `attr`.`products_options_sort_order`';
//-eof-20140712-lat9
if($this->cache_time == 0) $queryResult = $db->Execute($query);
else $queryResult = $db->Execute($query, false, true, $this->cache_time);
$retval = array();
while (!$queryResult->EOF) {
$retval[$queryResult->fields['products_attributes_id']] = array(
'id' => $queryResult->fields['options_id'],
'name' => $queryResult->fields['products_options_name'],
'value' => $queryResult->fields['products_options_values_name'],
'type' => $queryResult->fields['products_options_type'],
'length' => $queryResult->fields['products_options_length'],
'size' => $queryResult->fields['products_options_size'],
'rows' => $queryResult->fields['products_options_rows']
);
$queryResult->MoveNext();
}
return $retval;
}
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
Thanks, lhungil. I found another "funny" with the dropdown (and possibly other flavors) of attributes; the ordering of the attribute values in the dropdown were all over the place, i.e. not in their defined sort-order. I made the following change to the /YOUR_ADMIN/includes/classes/attributes.php module to correct:
Code:
/**
* Returns a multidimensional array containing the product attribute options
* id / name / value rows for the specified product sorted by option id.
*
* @param int|string $zf_product_id the specified product id.
* @param bool $readonly include readonly attributes not required to add a
* product to the cart, defaults to false.
* @return array
*/
function get_attributes_options($zf_product_id, $readonly = false) {
global $db;
$query = 'SELECT attr.products_attributes_id, attr.products_id, attr.options_id, opt.products_options_name, val.products_options_values_name, opt.products_options_type, products_options_size, opt.products_options_rows ' .
'FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' AS attr ' .
'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS .
' AS opt ON attr.options_id = opt.products_options_id ' .
'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS_VALUES .
' AS val ON attr.options_values_id = val.products_options_values_id ' .
'WHERE attr.products_id = \'' . (int)$zf_product_id . '\' ' .
'AND val.language_id = \'' . (int)$_SESSION['languages_id'] . '\' ' .
'AND val.language_id = opt.language_id ';
// Don't include READONLY attributes if product can be added to cart without them
if(PRODUCTS_OPTIONS_TYPE_READONLY_IGNORED == '1' && $readonly === false) {
$query .= 'AND opt.products_options_type != \'' . PRODUCTS_OPTIONS_TYPE_READONLY . '\' ';
}
//-bof-20140712-lat9-Fix up attributes' sort order.
// $query .= 'ORDER BY `opt`.`products_options_sort_order`, `attr`.`options_id`';
$query .= 'ORDER BY `attr`.`options_id`, `attr`.`products_options_sort_order`';
//-eof-20140712-lat9
if($this->cache_time == 0) $queryResult = $db->Execute($query);
else $queryResult = $db->Execute($query, false, true, $this->cache_time);
$retval = array();
while (!$queryResult->EOF) {
$retval[$queryResult->fields['products_attributes_id']] = array(
'id' => $queryResult->fields['options_id'],
'name' => $queryResult->fields['products_options_name'],
'value' => $queryResult->fields['products_options_values_name'],
'type' => $queryResult->fields['products_options_type'],
'length' => $queryResult->fields['products_options_length'],
'size' => $queryResult->fields['products_options_size'],
'rows' => $queryResult->fields['products_options_rows']
);
$queryResult->MoveNext();
}
return $retval;
}
Hmm, that was closer but not totally correct. This works all the way:
Code:
/**
* Returns a multidimensional array containing the product attribute options
* id / name / value rows for the specified product sorted by option id.
*
* @param int|string $zf_product_id the specified product id.
* @param bool $readonly include readonly attributes not required to add a
* product to the cart, defaults to false.
* @return array
*/
function get_attributes_options($zf_product_id, $readonly = false) {
global $db;
$query = 'SELECT attr.products_attributes_id, attr.products_id, attr.options_id, opt.products_options_name, val.products_options_values_name, opt.products_options_type, products_options_size, opt.products_options_rows ' .
'FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' AS attr ' .
'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS .
' AS opt ON attr.options_id = opt.products_options_id ' .
'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS_VALUES .
' AS val ON attr.options_values_id = val.products_options_values_id ' .
'WHERE attr.products_id = \'' . (int)$zf_product_id . '\' ' .
'AND val.language_id = \'' . (int)$_SESSION['languages_id'] . '\' ' .
'AND val.language_id = opt.language_id ';
// Don't include READONLY attributes if product can be added to cart without them
if(PRODUCTS_OPTIONS_TYPE_READONLY_IGNORED == '1' && $readonly === false) {
$query .= 'AND opt.products_options_type != \'' . PRODUCTS_OPTIONS_TYPE_READONLY . '\' ';
}
//-bof-20140712-lat9-Fix up attributes' sort order.
// $query .= 'ORDER BY `opt`.`products_options_sort_order`, `attr`.`options_id`';
$query .= 'ORDER BY `opt`.`products_options_sort_order`, `attr`.`products_options_sort_order`';
//-eof-20140712-lat9
if($this->cache_time == 0) $queryResult = $db->Execute($query);
else $queryResult = $db->Execute($query, false, true, $this->cache_time);
$retval = array();
while (!$queryResult->EOF) {
$retval[$queryResult->fields['products_attributes_id']] = array(
'id' => $queryResult->fields['options_id'],
'name' => $queryResult->fields['products_options_name'],
'value' => $queryResult->fields['products_options_values_name'],
'type' => $queryResult->fields['products_options_type'],
'length' => $queryResult->fields['products_options_length'],
'size' => $queryResult->fields['products_options_size'],
'rows' => $queryResult->fields['products_options_rows']
);
$queryResult->MoveNext();
}
return $retval;
}
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
... I found another "funny" with the dropdown (and possibly other flavors) of attributes; the ordering of the attribute values in the dropdown were all over the place, i.e. not in their defined sort-order. ...
Not a surprise, the "attributes.php" file does not sort the attributes. Mostly because the file came from one of my other modules which does not care about the sort order (does it's own sorting dynamically based upon the attributes, attribute type, and some other external criteria). So the code omitted the database sort to improve performance.
I can see how some store owners would prefer to see the attributes in the same order (when adding a product) as they appear to customers, so will add modifications in the next release to allow both sorted and unsorted options in the "attributes.php" file.
Thank you for mentioning the behavior and posting an interim fix!
-
Re: Edit Orders v4.0 Support Thread
Looking for some community feedback
In an effort to make using Edit Orders easier to use (and more intuitive) a few changes have been proposed to the handling of products and attributes. Additional ideas / thoughts are welcome.
Background
Currently product and attribute fields in Edit Orders always override any automatic calculations. This behavior allows store owners to change / alter names, prices, taxes, onetime charges, etc. However if a store owner changes an attribute, price changes (onetime and total) are not updated to reflect the change (because they are overridden by the editable fields).
Proposal #1
- Only allow editing the quantity, name, and tax, and attributes on products by default.
- Do not allow editing of price and onetime charges.
Proposal #2
- Allow editing everything by default.
- Add a "checkbox" to indicate charges should be recalculated (ignoring the input fields).
Proposal #3
- Only allow editing the quantity, name, and tax, and attributes on products by default.
- Add a "checkbox" to enable editing of price and onetime charges.
- Save the preference to a new database field (remember for the customer + order + product).
Initial Thoughts
Proposal #1 would be the easiest to implement and continues the process of moving Edit Orders towards mimicking the customer facing experience. Store owners can still manipulate the overall price of the order using the included "ot_onetime_discount" order total module. Use of a separate order total module provides additional data for the creation of reports on margin erosion and discounting (and supports auditing).
Proposal #2 would require a little more coding, but retains the current behavior of Edit Orders (while optionally allowing "recalculation" of pricing according to product / attribute rules). One of my great dislikes about this proposal: allowing direct edits by default encourages store owners to be lazy and just edit product pricing (without entering auditing information). Generating a report of margin erosion and discounting becomes much more difficult (and in some cases will provide less data). I feel if prices need to be changed frequently after an order has been placed the price of the product (or attributes) should be changed instead.
Proposal #3 would require additional database and PHP coding. This proposal is a compromise between Proposal #1 and Proposal #2. By default store owners are not allowed to change product pricing. By requiring store owners to check another checkbox (per product), hopefully it would at the least spark the thoughts: "Why is this not the default? Can it cause issues? Is there another (better) way?".
-
Re: Edit Orders v4.0 Support Thread
FWIW, my choice would be Proposal #1 for the reasons you stated.
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
FWIW, my choice would be Proposal #1 for the reasons you stated.
**nods in agreement** :yes:
-
Re: Edit Orders v4.0 Support Thread
I keep getting a "The webpage cannot be found" when I click the Edit button on the order page. The URL is "myadmin/FILENAME_ORDER_EDIT.php?oID=1013".
I have Super Orders 4.0.4 installed and also had Edit Orders 4.0.4 installed. It worked fine. Then I wanted to update Edit Orders to version 4.1.4. It installed fine without errors, the only problem is when I click the Edit button.
I tried completely uninstalling Edit Orders and reinstalled again, but same problem happens.
What am I doing wrong?
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
DML73
I keep getting a "The webpage cannot be found" when I click the Edit button on the order page. The URL is "myadmin/FILENAME_ORDER_EDIT.php?oID=1013".
I have Super Orders 4.0.4 installed and also had Edit Orders 4.0.4 installed. It worked fine. Then I wanted to update Edit Orders to version 4.1.4. It installed fine without errors, the only problem is when I click the Edit button.
I tried completely uninstalling Edit Orders and reinstalled again, but same problem happens.
What am I doing wrong?
Missing a define for FILENAME_ORDER_EDIT. Either file not uploaded, not uploaded completely.
-
Re: Edit Orders v4.0 Support Thread
This is also common when the "install" step of Edit Orders 4.1.x (inside Zen Cart) is skipped (or does not complete successfully and displays a warning)... Or Super Orders is installed after Edit Orders and the Edit Orders "install" step has not been run again.
Basically the constant changed in Edit Orders 4.1.x (and the installer automatically fixes the constant name for older versions of Super Orders).
-
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
This is also common when the "install" step of Edit Orders 4.1.x (inside Zen Cart) is skipped (or does not complete successfully and displays a warning)... Or Super Orders is installed after Edit Orders and the Edit Orders "install" step has not been run again.
Basically the constant changed in Edit Orders 4.1.x (and the installer automatically fixes the constant name for older versions of Super Orders).
Thanks, the problem is that I did do the install step and it did say that the installation was successful. Also, Super Orders was installed before I installed Edit Orders. I carefully followed all installation instructions.
When I check admin/orders.php then I can see that all instances of FILENAME_ORDER_EDIT has not been replaced with FILENAME_EDIT_ORDERS as I believe it should. Any ideas why?
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
DML73
... When I check admin/orders.php then I can see that all instances of FILENAME_ORDER_EDIT has not been replaced with FILENAME_EDIT_ORDERS as I believe it should. Any ideas why?
So when you RERUN the "install" step of Edit Orders you only see a "success" message, no other messages? Very curious! A preg_replace is run over the contents of the file checking for FILENAME_ORDER_EDIT and replacing with FILENAME_EDIT_ORDERS. If unable to write the contents of the changed file to disk the installer then reports a warning message...
Unless of course you have a version of Super Orders 4.0.6+ installed and manually changed the "orders.php" included with Super Orders (to make it work with Edit Orders 4.0.x)... Another possibility could be left over database entries from a failed attempt to install a newer version of Super Orders... Versions of Super Orders >= 4.0.6 already include the necessary changes to work with Edit Orders 4.1.x. So when the Edit Orders installer detects a newer version of Super Orders (from the database), the installer does not run the above check / replace against "orders.php"...
NOTE: If you have a development copy of the site somewhere exhibiting this behavior I would be interested in taking a further look at the database and files... Feel free to send me a PM with applicable information and when I get some time I will take a look.
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lhungil
So when you RERUN the "install" step of Edit Orders you only see a "success" message, no other messages? Very curious! A preg_replace is run over the contents of the file checking for FILENAME_ORDER_EDIT and replacing with FILENAME_EDIT_ORDERS. If unable to write the contents of the changed file to disk the installer then reports a warning message...
Unless of course you have a version of Super Orders 4.0.6+ installed and manually changed the "orders.php" included with Super Orders (to make it work with Edit Orders 4.0.x)... Another possibility could be left over database entries from a failed attempt to install a newer version of Super Orders... Versions of Super Orders >= 4.0.6 already include the necessary changes to work with Edit Orders 4.1.x. So when the Edit Orders installer detects a newer version of Super Orders (from the database), the installer does not run the above check / replace against "orders.php"...
NOTE: If you have a development copy of the site somewhere exhibiting this behavior I would be interested in taking a further look at the database and files... Feel free to send me a PM with applicable information and when I get some time I will take a look.
That is correct, I have run the "install" step several times and every time I get a green successful message, without any error or warning messages.
The current version of Super orders I have is 4.0.4, I installed that long time ago, and I don't recall that I have manually changed the orders.php or have any failed attempts to install Super Orders.
Could the problem be that my current version of Super Orders is 4.0.4?
Should I try and uninstall Super Orders and then install version 4.0.9?
-
Re: Super Orders + Edit Orders
Ok I removed Super Orders 4.0.4. I removed it instead of upgrading just to be sure everything is removed. Then I installed Super Orders 4.0.9 and it installed and works without errors or problems. Then I ran the install step for Edit Orders and got the following error when I click the "Admin home" link in Admin:
Filesystem Error: Unable to access 'myadmin/includes/init_includes/init_eo_remove.php'. Please make sure the file exists on the webserver and the webserver has access to read the file!
Error Edit Orders installation / upgrade failed!
As far as I can see then init_eo_remove.php is not a part of the Edit Orders module, I can't find that file in the 4.1.4 version installation folder, so why is the installation asking for that file?? and what can I do to solve the problem ? :blink:
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
DML73
Ok I removed Super Orders 4.0.4. I removed it instead of upgrading just to be sure everything is removed. Then I installed Super Orders 4.0.9 and it installed and works without errors or problems. ...
And what if anything did you do with Edit Orders? Did you leave everything as-is? Did you run the uninstall? Did you remove the files? Did you remove the database entries?
Quote:
Originally Posted by
DML73
... As far as I can see then init_eo_remove.php is not a part of the Edit Orders module...
It is part of the distribution zip related to uninstallation of Edit Orders.
Quote:
Originally Posted by
DML73
... What can I do to solve the problem ? :blink:
Is this on a production website (or a test website)?
Do you have a backup from before you started the upgrade (step 0)?
Are you leaving "extra" backup copies of PHP files on the web server?
Where do you store your backups?
How are you uploading files to the web server?
What version of Zen Cart and PHP are installed?
Was Zen Cart or PHP upgraded from a previous version (if so how were they upgraded)?
What web server software is the hosting provider running (Apache, IIS, Nginx, etc)?
Is the hosting provider using APC, eAccelerator, or Xcache?
Did you re-perform step #0, #1, and #2 of the Edit Orders installation (before step #3: Install)?
-
Re: Super Orders + Edit Orders
Hi All,
I want to know, if I want to install both Edit Order 4.x and Super Order 3.x, actually, install which one first? Or do they have the relationship which one must first, which one must after?
Since see the files both have some override ...
Thank you.
Best Regards,
Jimmy Chan
http://www.jimmychan.tk
http://explorerhome.no-ip.org/blog
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
explorer1979
Hi All,
I want to know, if I want to install both Edit Order 4.x and Super Order 3.x, actually, install which one first? Or do they have the relationship which one must first, which one must after?
Since see the files both have some override ...
Thank you.
Best Regards,
Jimmy Chan
http://www.jimmychan.tk
http://explorerhome.no-ip.org/blog
It actually does not matter which you install first. As always, make a backup first, and install on a test site to see if it works accordingly. I seen far too many cases that have not done those 2 simple things. Just take care when merging the core files, especially when the same file affects both mods.
-
Re: Super Orders + Edit Orders
When I'm in the edit order screen I have this highlighted in red at the top of the screen:
https://manoszapotecas.com/shop/ctrl...ns/warning.gif WARNING_ORDER_TOTAL_SUBTOTAL
my admin debug file says:
[21-Jul-2014 21:53:45 UTC] PHP Warning: include_once(includes/modules/shipping/table.php): failed to open stream: No such file or directory in /home/mz/public_html/shop/includes/classes/shipping.php on line 58
[21-Jul-2014 21:53:45 UTC] PHP Warning: include_once(): Failed opening 'includes/modules/shipping/table.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mz/public_html/shop/includes/classes/shipping.php on line 58
[21-Jul-2014 21:53:45 UTC] PHP Fatal error: Class 'table' not found in /home/mz/public_html/shop/includes/classes/shipping.php on line 59
But these errors are only generated by edit orders. I don't recieve these errors when looking at the shipping modules in admin or as an error in regular debug files.
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lhungil
And what if anything did you do with Edit Orders? Did you leave everything as-is? Did you run the uninstall? Did you remove the files? Did you remove the database entries?
It is part of the distribution zip related to uninstallation of Edit Orders.
Is this on a production website (or a test website)?
Do you have a backup from before you started the upgrade (step 0)?
Are you leaving "extra" backup copies of PHP files on the web server?
Where do you store your backups?
How are you uploading files to the web server?
What version of Zen Cart and PHP are installed?
Was Zen Cart or PHP upgraded from a previous version (if so how were they upgraded)?
What web server software is the hosting provider running (Apache, IIS, Nginx, etc)?
Is the hosting provider using APC, eAccelerator, or Xcache?
Did you re-perform step #0, #1, and #2 of the Edit Orders installation (before step #3: Install)?
Thanks a lot, your reply made me start thinking :blush:
I kept getting errors no matter what I did, so I decided to revert back to zero and then uninstall both Edit Orders 404 and Super Orders 404. While I was uninstalling I found some old Super Orders files which I believe I forgot to uninstall earlier. I then first installed Edit Orders 414 and then Super Orders 409 and now its finally working :jump:
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
explorer1979
Hi All,
I want to know, if I want to install both Edit Order 4.x and Super Order 3.x, actually, install which one first? Or do they have the relationship which one must first, which one must after?
Since see the files both have some override ...
Thank you.
Best Regards,
Jimmy Chan
http://www.jimmychan.tk
http://explorerhome.no-ip.org/blog
Quote:
Originally Posted by
yaritai
It actually does not matter which you install first. As always, make a backup first, and install on a test site to see if it works accordingly. I seen far too many cases that have not done those 2 simple things. Just take care when merging the core files, especially when the same file affects both mods.
It is suggested that if installing BOTH the order you install doesn't matter, but HOW you approach the installing does..
If you install Super Orders AFTER Edit Orders, you can simply replace the orders.php file with the one from Super Orders (no merging required unless you have other modifications to this file). Though is is suggested if Super Orders is installed after Edit Orders that the Edit Orders "install" step should be run again, current versions of Super Orders makes that step unnecessary.
If you already have Super Orders installed you DO NOT need to upload the orders.php file from Edit Orders. Though the Edit Orders "install" step could be run again, current versions of Super Orders probably makes that step unnecessary.
-
Re: Super Orders + Edit Orders
DivaVocals, and yaritai,
Thank you very much of this detail inform. Very useful for me :-)
Best Regards,
Jimmy Chan
http://www.jimmychan.tk
http://explorerhome.no-ip.org/blog
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
BGundlach
This indicates you either have the Zen Cart "order total modules" system disabled or do not have the subtotal (ot_subtotal) order total module enabled. The order total system needs to be enabled (and both ot_subtotal and ot_total enabled at the minimum) for Edit Orders 4.1+ to operate.
Thank You for the reminder I still need to add some language for WARNING_ORDER_TOTAL_SUBTOTAL and WARNING_ORDER_TOTAL_TOTAL.
Quote:
Originally Posted by
BGundlach
...
my admin debug file says:
[21-Jul-2014 21:53:45 UTC] PHP Warning: include_once(includes/modules/shipping/table.php): failed to open stream: No such file or directory in /home/mz/public_html/shop/includes/classes/shipping.php on line 58
[21-Jul-2014 21:53:45 UTC] PHP Warning: include_once(): Failed opening 'includes/modules/shipping/table.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mz/public_html/shop/includes/classes/shipping.php on line 58
[21-Jul-2014 21:53:45 UTC] PHP Fatal error: Class 'table' not found in /home/mz/public_html/shop/includes/classes/shipping.php on line 59
... But these errors are only generated by edit orders. I don't recieve these errors when looking at the shipping modules in admin or as an error in regular debug files. ...
This can happen if "/includes/classes/shipping.php" has not been correctly merged to load the module from the correct location (I'm not seeing any value for DIR_FS_CATALOG prepended to the filename). The usual fix is to redo the installation of Edit Orders, paying especially close attention when merging changes to core Zen Cart files.
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
DML73
... now its finally working :jump:
:clap: Glad you are back in business!
Thank You for letting us know a removal and re-installation of Super Orders and Edit Orders solved the issues your store was experiencing.
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
DivaVocals
... If you install Super Orders AFTER Edit Orders, you can simply replace the orders.php file with the one from Super Orders (no merging required unless you have other modifications to this file). Though is is suggested if Super Orders is installed after Edit Orders that the Edit Orders "install" step should be run again, current versions of Super Orders makes that step unnecessary.
If you already have Super Orders installed you DO NOT need to upload the orders.php file from Edit Orders. Though the Edit Orders "install" step could be run again, current versions of Super Orders probably makes that step unnecessary.
...
Correct (and nicely summarized). Just to clarify: You do need to run the Edit Orders installer after installing / upgrading Edit Orders. Does not matter if Super Orders is or is not installed.
If Edit Orders 4.1+ is installed first:
- Overwrite "/admin/orders.php" with the version from Super Orders.
- Finish the installation of Super Orders.
- If Super Orders <= 4.0.5 was installed, run the Edit Orders installer.
If Super Orders 4.0+ is installed first:
- Do not overwrite (or merge) "/admin/orders.php" with the version from Edit Orders.
- Run the Edit Orders installer (when that step of the installation is reached).
Note: Running the Edit Orders installer after installing Super Orders >= 4.0.6 will not cause any issues. So no need to fret too much one way or the other.
-
Re: Super Orders + Edit Orders
lhungil,
Thank you of this additional inform with version number. This very helpful too.
-
Re: Super Orders + Edit Orders
FYI, I had to manually create folders and move the readme files around to get the installation instructions to work. The /readme/ folder and subfolders didn't exist in other words. It was just the files with the path enclosed in the file name, if that makes any sense. :) I've unzipped a bunch of plugins this evening and this one was the only one that I had to do this with. Someone might want to give the ZIP file a look to make sure all is hunky-dory. :)
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
laurelsstitchery
FYI, I had to manually create folders and move the readme files around to get the installation instructions to work. The /readme/ folder and subfolders didn't exist in other words. It was just the files with the path enclosed in the file name, if that makes any sense. :) I've unzipped a bunch of plugins this evening and this one was the only one that I had to do this with. Someone might want to give the ZIP file a look to make sure all is hunky-dory. :)
I have no issues with unzipping the files to access the readme..
-
Re: Super Orders + Edit Orders
OK, I need some help, and I am not sure if this is the correct spot.
I have upgraded to v1.5.3
when i install your module to complete.
then go to order => edit => update
i get "WARNING: An error occurred, please refresh the page and try again." when I try to look at the order in the admin.
Help what am I doing wrong or missing.
I use zen 1.5.3
Thanks
-
Re: Super Orders + Edit Orders
When you receive the message "Warning an error occurred ...", there's a debug log in your store's /logs directory that identifies the source of the issue. You can post that here (make sure to XXXX-out your admin directory's name first!) to get some further help.
I've got Edit Orders v4.1.4 happily installed on Zen Cart v1.5.3, so it's got to be something in your setup.
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lat9
When you receive the message "Warning an error occurred ...", there's a debug log in your store's /logs directory that identifies the source of the issue. You can post that here (make sure to XXXX-out your admin directory's name first!) to get some further help.
I've got Edit Orders v4.1.4 happily installed on Zen Cart v1.5.3, so it's got to be something in your setup.
this is the message :
PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' :: SELECT `p`.`products_quantity` FROM `zen_products` WHERE `p`.`products_id` = '1069' ==> (as called by) /home/store/public_html/admin/includes/functions/extra_functions/edit_orders_functions.php on line 1028 <== in /home/store/public_html/includes/classes/db/mysql/query_factory.php on line 155
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lhungil
Verified Bug.
Edit "/admin/includes/functions/extra_functions/edit_orders_functions.php". Around line 1025 change:
Code:
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
to read:
Code:
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` AS `p` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
Please let me know if this solves the problem.
Quote:
Originally Posted by
iqbal007
this is the message :
PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' :: SELECT `p`.`products_quantity` FROM `zen_products` WHERE `p`.`products_id` = '1069' ==> (as called by) /home/store/public_html/admin/includes/functions/extra_functions/edit_orders_functions.php on line 1028 <== in /home/store/public_html/includes/classes/db/mysql/query_factory.php on line 155
That's a known issue. See the quoted correction.
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lat9
That's a known issue. See the quoted correction.
wow this works bro. thanks for your help :D
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
iqbal007
wow this works bro. thanks for your help :D
That "bro" is a LADY.. a "sheila" as the Aussies would say.. :smile:
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
DivaVocals
That "bro" is a LADY.. a "sheila" as the Aussies would say.. :smile:
uupss :P
-
Re: Edit Orders v4.0 Support Thread
Hello Everybody.
how to add new inputs and can be displayed on the packing slips and invoices?
I want to add a phone number section that can be edited on "the delivery section"
so the phone number into a billing and shipping is different
What files should I change / add?
thx :smile:
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lat9
That's a known issue. See the quoted correction.
Just had this issue too and fixed it using your instructions - thanks! :)
-
Re: Super Orders + Edit Orders
No problem, there's a bunch of pages to be read to find that!
-
Re: Super Orders + Edit Orders
Quote:
Originally Posted by
lat9
No problem, there's a bunch of pages to be read to find that!
Hot tip for all who installed this mod (and other plugins):
Simply subscribe to this thread with instant email notifications and you won't be left in the dark. All you need to do is read the latest updates :smile:
To subscribe click on 'Thread Tools' on the header bar of this thread.
-
4 Attachment(s)
Re: Super Orders + Edit Orders (VAT problem)
Hi everybody,
ZC 1.5.1 + Super Orders 4.1.4
I have no problems in VAT calculation when inserting new orders, but problems come while editing exixting orders.
Here's some exmple pic:
This is the order right after its creation:
Attachment 14412
Attachment 14413
1 item, net price is 1.64, gross price is 2.00, VAT is 22%, gross shipping is 7.00, net shipping is 5.7377
Following is the same order after editing it by modifying gross shipping to 8,00
Attachment 14414
Total is ok, but not VAT (it should be 1.80, not 2.12)
And now the "surprise":
Attachment 14415
I just put net shipping in shipping box instead of gross shipping: now VAT is OK, but Total is wrong.
Any idea about that?
Thanks in advance
-
Re: Super Orders + Edit Orders (VAT problem)
Seems like there is a bug in Edit Orders 4.1.4 in the file admin/includes/functions/extra_functions/edit_orders_functions.php
Line 1025 - 1028:
Code:
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
Which probably instead should be (a p isn't defined):
Code:
$check = $db->Execute(
'SELECT `products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
Else it trows an error like:
Quote:
PHP Fatal error: 1054:Unknown column 'p.products_quantity' in 'field list' :: SELECT `p`.`products_quantity` FROM `products` WHERE `p`.`products_id` = '32' ==> (as called by) /public_html/admin/includes/functions/extra_functions/edit_orders_functions.php on line 1028 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 155
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
rued
Seems like there is a bug in Edit Orders 4.1.4 in the file
admin/includes/functions/extra_functions/edit_orders_functions.php
Line 1025 - 1028:
Code:
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
Which probably instead should be (a p isn't defined):
Code:
$check = $db->Execute(
'SELECT `products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
Else it trows an error like:
Known issue; see post #577.
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
lat9
Known issue; see post #577.
Hehe ... this tread is 59 pages, I surely didn't bother or take time to go trough it (as search didn't give me anything for some reason), I just fixed it. :)
-
Re: Super Orders + Edit Orders (VAT problem)
Just wanted to ask a rather basic question...
I noticed that older versions of Edit Orders installs data into the SQL - but when going through the files of Edit Orders 4 I don't see anything that adds new columns or tables. I assume this version doesn't require SQL changes for installation? Or am I missing it...
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
yaseent
Just wanted to ask a rather basic question...
I noticed that older versions of Edit Orders installs data into the SQL - but when going through the files of Edit Orders 4 I don't see anything that adds new columns or tables. I assume this version doesn't require SQL changes for installation? Or am I missing it...
v4.1.4 installs some items in the configuration menu (Configuration->Edit Orders) via the file /YOUR_ADMIN/includes/classes/eo_plugin.php.
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
lat9
v4.1.4 installs some items in the configuration menu (Configuration->Edit Orders) via the file /YOUR_ADMIN/includes/classes/eo_plugin.php.
Thanks :)
-
Re: Super Orders + Edit Orders (VAT problem)
Hi TIA.
My store is using text attributes with multiple lines of text, when editing a order the attribute looses the line breaks and combines into one line without spaces, is there any fix for it to keep the formatting?
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
ShopVille
Hi TIA.
My store is using text attributes with multiple lines of text, when editing a order the attribute looses the line breaks and combines into one line without spaces, is there any fix for it to keep the formatting?
Try changing the "text" input box into a "textarea" (/admin/edit_orders.php). Most browsers strip newlines and extraneous spaces from "text" input boxes.
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
lhungil
Try changing the "text" input box into a "textarea" (/admin/edit_orders.php). Most browsers strip newlines and extraneous spaces from "text" input boxes.
Thanks can you help with where in the file i have to edit?
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
ShopVille
Thanks can you help with where in the file i have to edit?
Change the field type of your text attributes to a textarea..
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
DivaVocals
Change the field type of your text attributes to a textarea..
I only have the following options:
Dropdown
Text
Radio
Checkbox
File
Read Only
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
ShopVille
I only have the following options:
Dropdown
Text
Radio
Checkbox
File
Read Only
Not sure if there is a "fix" for your issue.. As lhungil pointed out "Most browsers strip newlines and extraneous spaces from "text" input boxes.". Not an issue caused persay by Edit Orders..
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
DivaVocals
Not sure if there is a "fix" for your issue.. As lhungil pointed out "Most browsers strip newlines and extraneous spaces from "text" input boxes.". Not an issue caused persay by Edit Orders..
Right not caused by Edit Orders but only happens when editing since the browser will strip the lines
-
Re: Super Orders + Edit Orders (VAT problem)
After looking a bit further, there is a real easy option to allow product attributes with user entered multiline text. So I was wrong earlier, no need to edit "/admin/edit_orders.php" (it has been awhile since I have looked through the product attribute display code in Zen Cart).
Zen Cart out of box supports changing individual "text" option names (attributes) to use a textarea HTML element instead of an input HTML element (with a type attribute of text). As Edit Orders uses almost the exact same code as a stock Zen Cart product page (minor modifications for handling of downloads), turning this option on for the "text" option name in Zen Cart will also switch to using a textarea HTML element.
How to enable support for multiline "text" product options:
- Log into the Zen Cart administrative interface.
- Navigate the menu's to "Catalog" -> "Option Name Manager".
- Find the option name (option type: text) and click the associated "edit" button.
- Change "rows" to the number of rows to display (for multiline input must be greater than 1).
- Click the "update" button.
NOTE: Tested and verified to work under Zen Cart 1.5.1+ and Edit Orders 4.1.3+ (probably earlier as well - but these are my current test environments. The setting is documented in the wiki (Google FTW).
-
Re: Super Orders + Edit Orders (VAT problem)
Quote:
Originally Posted by
lhungil
After looking a bit further, there is a real easy option to allow product attributes with user entered multiline text. So I was wrong earlier, no need to edit "/admin/edit_orders.php" (it has been awhile since I have looked through the product attribute display code in Zen Cart).
Zen Cart out of box supports changing individual "text" option names (attributes) to use a textarea HTML element instead of an input HTML element (with a type attribute of text). As Edit Orders uses almost the exact same code as a stock Zen Cart product page (minor modifications for handling of downloads), turning this option on for the "text" option name in Zen Cart will also switch to using a textarea HTML element.
How to enable support for multiline "text" product options:
- Log into the Zen Cart administrative interface.
- Navigate the menu's to "Catalog" -> "Option Name Manager".
- Find the option name (option type: text) and click the associated "edit" button.
- Change "rows" to the number of rows to display (for multiline input must be greater than 1).
- Click the "update" button.
NOTE: Tested and verified to work under Zen Cart 1.5.1+ and Edit Orders 4.1.3+ (probably earlier as well - but these are my current test environments. The setting is documented in the wiki (Google FTW).
This is how i'm set up it keeps the line formatting in the order, however when editing it displays as one line