View Single Post
  #4  
Old 05-03-2018, 04:24 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Working with ItemsList

Quote:
Originally Posted by Soptareanu @Alex
Yes, I need this form_id, because i use it to fillter the list. In the URL i have a param order=<Value>. That value is coresponding with form_id, and show me a list of items with form_id = order. If I update the item it works very fine, but if i want to create a new one, i want that the form_id remain the same based on url param. I used \XLite\Core\Request::getInstance()->order;

I see. Thanks for explanation.

The problem looks to be that 'order' param is not in POST request when you submit the ItemsList. It is in GET parameters when you open the page with ItemsList, but when the ItemsList's form is submitted, it is not there.

To add 'order' as a hidden input to your ItemsList's form, create the following method in your ItemsList class:

Code:
protected function getFormParams() { return parent::getFormParams() + [ 'order' => \XLite\Core\Request::getInstance()->order ]; }

Please, let me know if it helps.

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote