X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   ItemList Update Fields (https://forum.x-cart.com/showthread.php?t=76005)

Soptareanu Alex 02-19-2018 06:34 AM

ItemList Update Fields
 
1 Attachment(s)
I need some help in order to achive an update of ItemList Table. I have an field in table Order Details. This field has an drop-down with some different option, if I chose one of them and after make the recalculate, the value remains the same. I attached some picture in order to understand what i want to do.

qualiteam 02-19-2018 10:16 PM

Re: ItemList Update Fields
 
When you click the "Recalculate" button it submits the form to the \XLite\Controller\Admin\Order controller class and runs the doActionRecalculate() method there.

The controller recalculates the values and returns them back to JavaScript (see the displayRecalculateData() and displayRecalculateShippingData() methods).

JavaScript is configured to react on these events and update the page. See these files:
- skins/admin/order/page/info.js
- skins/admin/form_field/inline/select/shipping_method/controller.js

I never tried to add custom fields on that page, but I guess you should a) update the doActionRecalculate() method in the controller and make it return your custom data; b) add a custom JS file that will update the page in a way similar to how existing info.js and controller.js files react on events from the controller.

Soptareanu Alex 02-22-2018 03:42 AM

Re: ItemList Update Fields
 
Quote:

Originally Posted by qualiteam
When you click the "Recalculate" button it submits the form to the \XLite\Controller\Admin\Order controller class and runs the doActionRecalculate() method there.

The controller recalculates the values and returns them back to JavaScript (see the displayRecalculateData() and displayRecalculateShippingData() methods).

JavaScript is configured to react on these events and update the page. See these files:
- skins/admin/order/page/info.js
- skins/admin/form_field/inline/select/shipping_method/controller.js

I never tried to add custom fields on that page, but I guess you should a) update the doActionRecalculate() method in the controller and make it return your custom data; b) add a custom JS file that will update the page in a way similar to how existing info.js and controller.js files react on events from the controller.


I resolved the problem. I get the data from the form submit using \Xlite\Core\Reuquest::getInstance() and I override my old value of that field with data camed form the instance.


All times are GMT -8. The time now is 01:39 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.