Post by kurieuo » Mon Jan 31, 2011 8:12 am

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!
2011-01-31_1002.png

2011-01-31_1002.png (31.54 KiB) Viewed 4208 times

Last edited by kurieuo on Thu Feb 03, 2011 11:06 am, edited 2 times in total.

Newbie

Posts

Joined
Thu Oct 07, 2010 1:50 pm

Post by jefrey1983 » Tue Feb 01, 2011 7:11 pm

have you tried using other browser?

User avatar
Active Member

Posts

Joined
Sat Jan 30, 2010 6:58 pm

Post by kurieuo » Wed Feb 02, 2011 8:50 am

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?

Newbie

Posts

Joined
Thu Oct 07, 2010 1:50 pm

Post by brrodes » Wed Feb 02, 2011 10:49 am

I am also getting the 'Failed' message when deleting products and I do not have the ProInvoice module installed.

Newbie

Posts

Joined
Wed Feb 02, 2011 10:47 am

Post by i2Paq » Wed Feb 02, 2011 2:48 pm

kurieuo wrote:Hopefully the developers of ProInvoice will release a patch soon.
What extension exactly and did you contact the developers?

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.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by kurieuo » Thu Feb 03, 2011 11:09 am

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.

Newbie

Posts

Joined
Thu Oct 07, 2010 1:50 pm

Post by rip_pit » Sun Feb 06, 2011 3:44 am

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 :

Code: Select all

<b>Notice</b>: Undefined index:  value in <b>xxx\upload\manage\model\sale\order.php</b> on line <b>85</b>...
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 :drunk:

EDIT:
After i disabled the "Show errors" setting in the "system > parameters > server" tab the problem seems to be gone

can you confirm ?

Newbie

Posts

Joined
Sun Feb 06, 2011 3:35 am

Post by kurieuo » Tue Mar 01, 2011 10:26 pm

No, disabling errors doesn't make the issue go away. But yes, it is obviously a javascript error.

Thanks for the thought.

Newbie

Posts

Joined
Thu Oct 07, 2010 1:50 pm

Post by kornovec » Tue Mar 08, 2011 9:48 pm

Same problem here :(
Have a clean install, no mods, no extensions. FAILED window appears when i try add or remove product in administration.
Tried in FF, MSIE, GCH...

Any ideas how to fix it???

Thanks,
K.

New member

Posts

Joined
Mon Jun 15, 2009 5:02 pm

Post by rip_pit » Wed Mar 09, 2011 12:26 am

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 :

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
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

Newbie

Posts

Joined
Sun Feb 06, 2011 3:35 am

Post by kornovec » Wed Mar 09, 2011 12:36 am

@rip_pit: Youre the man!!!

Thank you!
K.

New member

Posts

Joined
Mon Jun 15, 2009 5:02 pm

Post by rip_pit » Wed Mar 09, 2011 5:55 am

kornovec wrote:@rip_pit: Youre the man!!!

Thank you!
K.
ahah! i love when you talk like that ! :D
You're welcome ;)

Newbie

Posts

Joined
Sun Feb 06, 2011 3:35 am

Post by locktar » Thu Mar 24, 2011 2:54 am

hi,

i disable the show errors but ... a empty field still shows after i add the products

Image

how can i fix that?

Newbie

Posts

Joined
Sat Feb 05, 2011 5:26 am

Post by kurieuo » Mon Apr 11, 2011 7:47 am

rip_pit wrote:
kornovec wrote:@rip_pit: Youre the man!!!

Thank you!
K.
ahah! i love when you talk like that ! :D
You're welcome ;)
Hmm. My bad it seems.

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!

Newbie

Posts

Joined
Thu Oct 07, 2010 1:50 pm

Post by frymi » Mon Mar 25, 2013 6:00 am

In files "admin/controller/sale/order.php"
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

User avatar
New member

Posts

Joined
Thu Jun 02, 2011 10:47 pm
Location - Olomouc, Czech Republic

Post by inzula » Tue Dec 09, 2014 4:55 am

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: 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, '');

Newbie

Posts

Joined
Tue Dec 09, 2014 4:39 am
Who is online

Users browsing this forum: No registered users and 5 guests