[Prestashop] How to fix edit product and delete product in back office order

Test should work for any 1.6.x.x, but only tested on 1.6.0.9, 1.6.0.11, and 1.6.1.4

There is a problem with the token. orders.js is the new file and orders.js.bak is the original js file. You will see the token is pulled from the url/href.

[email protected] [/home/bozzolo/www]# diff js/admin/orders.js js/admin/orders.js.bak
595c595
< 				token: window.location.href.split('token=')[1].split("&")[0],
---
> 				token: token,
685c685
< 			query = 'ajax=1&token='+window.location.href.split('token=')[1].split("&")[0]+'&action=editProductOnOrder&id_order='+id_order+'&';
---
> 			query = 'ajax=1&token='+token+'&action=editProductOnOrder&id_order='+id_order+'&';
762c762
< 		var query = 'ajax=1&action=deleteProductLine&token='+window.location.href.split('token=')[1].split("&")[0]+'&id_order_detail='+id_order_detail+'&id_order='+id_order;
---
> 		var query = 'ajax=1&action=deleteProductLine&token='+token+'&id_order_detail='+id_order_detail+'&id_order='+id_order;

 

Fix for this: Can’t edit/add ordered products in an order page

Leave a Reply