Hi,
Tried search forums but can't find the following, which means I'm guessing it is a unique issue to me.
When trying to add an item to an order (pre-generated invoice) from within the administration, a JavaScript "failed" error appears (see screenshot below).
Running latest version (1.4.9.3) with two modules (ProInvoice & Multiple Payment Fee). Code also minor custom edited but no javascript and can't think of anything that would affect this area of the system.
Any one else have this issue, or know where I should look to fix?
Many thanks!
Tried search forums but can't find the following, which means I'm guessing it is a unique issue to me.
When trying to add an item to an order (pre-generated invoice) from within the administration, a JavaScript "failed" error appears (see screenshot below).
Running latest version (1.4.9.3) with two modules (ProInvoice & Multiple Payment Fee). Code also minor custom edited but no javascript and can't think of anything that would affect this area of the system.
Any one else have this issue, or know where I should look to fix?
Many thanks!
Last edited by kurieuo on Thu Feb 03, 2011 11:06 am, edited 2 times in total.
Just updating that this is not a bug with OpenCart, but rather an incompatibility with ProInvoice module.
Changes were made to /admin/controller/sale/order.php in v1.4.9.2/3 which causes the "Failed" error to appear when adding or removing products, if the ProInvoice module is installed.
Hopefully the developers of ProInvoice will release a patch soon. Otherwise, I'm wondering whether it is safe to copy the order.php file from v1.4.9.1 over v1.4.9.3?
Changes were made to /admin/controller/sale/order.php in v1.4.9.2/3 which causes the "Failed" error to appear when adding or removing products, if the ProInvoice module is installed.
Hopefully the developers of ProInvoice will release a patch soon. Otherwise, I'm wondering whether it is safe to copy the order.php file from v1.4.9.1 over v1.4.9.3?
What extension exactly and did you contact the developers?kurieuo wrote:Hopefully the developers of ProInvoice will release a patch soon.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Given brrodes post, I did further testing.
I must apologise to ProInvoice developers for my initial conclusion. This is infact an OpenCart v1.4.9.3 issue. Some lines were commented out which I guess affect the addition of products.
The reason I thought it was ProInvoice is because I have merged the v1.4.9.2/3 order.php code with ProInvoice. Given noone else seemed to be experiencing this issue, I hastily concluded it was a ProInvoice extension issue.
When I copy the order.php from the original v1.4.9.3 over, the issue happens. So will need log a bug report.
Thanks to all who the replied.
I must apologise to ProInvoice developers for my initial conclusion. This is infact an OpenCart v1.4.9.3 issue. Some lines were commented out which I guess affect the addition of products.
The reason I thought it was ProInvoice is because I have merged the v1.4.9.2/3 order.php code with ProInvoice. Given noone else seemed to be experiencing this issue, I hastily concluded it was a ProInvoice extension issue.
When I copy the order.php from the original v1.4.9.3 over, the issue happens. So will need log a bug report.
Thanks to all who the replied.
Hi i got the same JS error "failed" when adding/removing products when editing an order.
I'm using v1.9.4.3 r142 updated to latest revision (r142) found on google code hosting
I investigate a little, i found that ajax calls when adding product produce PHP notices that could break the process.
ajax call :
domain.com/manage/index.php?route=sale/order/removeProduct&token=xxx&order_id=92&order_product_id=113
Responses start with :
I might be wrong. Let me know if you can confirm or find something new.
You can monitor ajax request/response using firefox + firebug
PS: this is not my main account on this forum, i had to create a new one at home
EDIT:
After i disabled the "Show errors" setting in the "system > parameters > server" tab the problem seems to be gone
can you confirm ?
I'm using v1.9.4.3 r142 updated to latest revision (r142) found on google code hosting
I investigate a little, i found that ajax calls when adding product produce PHP notices that could break the process.
ajax call :
domain.com/manage/index.php?route=sale/order/removeProduct&token=xxx&order_id=92&order_product_id=113
Responses start with :
Code: Select all
<b>Notice</b>: Undefined index: value in <b>xxx\upload\manage\model\sale\order.php</b> on line <b>85</b>...
You can monitor ajax request/response using firefox + firebug
PS: this is not my main account on this forum, i had to create a new one at home

EDIT:
After i disabled the "Show errors" setting in the "system > parameters > server" tab the problem seems to be gone
can you confirm ?
ok, i started over with a fresh intall 1943 eng.
here's the error that appears in the ajax call, that can cause the "failed" error message, also visible from error log tab :
but it works fine simply after i disable the "Show errors" setting in the "system > parameters > server" tab.
@kornovec : try it and let us know
here's the error that appears in the ajax call, that can cause the "failed" error message, also visible from error log tab :
Code: Select all
- PHP Notice: Undefined index: description in D:\weblocal\www\Tests\e-commerce\opencart_v1.4.9.3_eng\upload\admin\model\sale\order.php on line 69
@kornovec : try it and let us know
Hmm. My bad it seems.rip_pit wrote:ahah! i love when you talk like that !kornovec wrote:@rip_pit: Youre the man!!!
Thank you!
K.
You're welcome
I swear I turned off the right setting, but maybe I accidentally did error logging instead. Whatever the case, turn off the errors it now seems to work.
Thanks!
In files "admin/controller/sale/order.php"
commented this code:
commented this code:
Code: Select all
// TU START
$query = $this->db->query("SELECT order_total_id, value FROM " . DB_PREFIX . "order_total WHERE sort_order = '" . (int)$data['tax']['sort_order'] . "' AND order_id = '" . (int)$order_id . "' LIMIT 1");
$tax_value = $query->row;
if($tax_value) {
$new_value = $tax_value['value'] + ($data['tax']['rate'] / 100) * $data['price'] * $data['quantity'];
$this->db->query("UPDATE " . DB_PREFIX . "order_total SET text = '" . $this->db->escape($this->currency->format($new_value, $data['currency'], $data['currency_value'], true)) . "', value = '" . (float)$this->currency->format($new_value, $data['currency'], $data['currency_value'], false) . "' WHERE order_total_id = '" . $tax_value['order_total_id'] . "'");
} else {
$new_value = ($data['tax']['rate'] / 100) * $data['price'] * $data['quantity'];
$this->db->query("INSERT INTO " . DB_PREFIX . "order_total (order_id, title, text, value, sort_order) VALUES ('" . (int)$order_id . "', '" . $this->db->escape($data['tax']['description'] . ':') . "', '" . $this->db->escape($this->currency->format($new_value, $data['currency'], $data['currency_value'], true)) . "', '" . (float)$this->currency->format($new_value, $data['currency'], $data['currency_value'], false) . "', '" . (int)$data['tax']['sort_order'] . "')");
}
// TU END
I have version 1.5.6
Same problem as Kurieuo.
Listing log:
2014-12-08 21:23:54 - PHP Warning: Missing argument 4 for Cart::add(), called in /home/...../www/catalog/controller/checkout/manual.php on line 74 and defined in /home/...../www/system/library/cart.php on line 318
2014-12-08 21:23:54 - PHP Notice: Undefined variable: profile_id in /home/...../www/system/library/cart.php on line 327
2014-12-08 21:23:54 - PHP Warning: Missing argument 4 for Cart::add(), called in /home/...../www/catalog/controller/checkout/manual.php on line 104 and defined in /home/...../www/system/library/cart.php on line 318
2014-12-08 21:23:54 - PHP Notice: Undefined variable: profile_id in /home/...../www/system/library/cart.php on line 327
I added the missing 4th parameter to the function add ()
in the file: catalog/controller/checkout/manual.php
at line 74 and 104
And now it works:-)
Code before:
Code after:
Same problem as Kurieuo.
Listing log:
2014-12-08 21:23:54 - PHP Warning: Missing argument 4 for Cart::add(), called in /home/...../www/catalog/controller/checkout/manual.php on line 74 and defined in /home/...../www/system/library/cart.php on line 318
2014-12-08 21:23:54 - PHP Notice: Undefined variable: profile_id in /home/...../www/system/library/cart.php on line 327
2014-12-08 21:23:54 - PHP Warning: Missing argument 4 for Cart::add(), called in /home/...../www/catalog/controller/checkout/manual.php on line 104 and defined in /home/...../www/system/library/cart.php on line 318
2014-12-08 21:23:54 - PHP Notice: Undefined variable: profile_id in /home/...../www/system/library/cart.php on line 327
I added the missing 4th parameter to the function add ()
in the file: catalog/controller/checkout/manual.php
at line 74 and 104
And now it works:-)
Code before:
Code: Select all
$this->cart->add($order_product['product_id'], $order_product['quantity'], $option_data);
$this->cart->add($this->request->post['product_id'], $quantity, $option);
Code after:
Code: Select all
$this->cart->add($order_product['product_id'], $order_product['quantity'], $option_data, '');
$this->cart->add($this->request->post['product_id'], $quantity, $option, '');
Who is online
Users browsing this forum: No registered users and 13 guests