I have a custom admin grid, which lists only the orders that contain the product given as a URL parameter.
My URL is of form https://www.example.com/admin/mymodule/orders/index/product_id/123/
I have defined a custom data provider for the grid in
The admin page itself works fine, and I get the correct orders when I use a hard-coded product id inside the data provider.
I'm however not able to figure out how to pass the product id into the data provider from the URL.
The actual data for the grid is fetched using AJAX, so perhaps the parameter should somehow be included into that request? Or are there some other ways to achieve it?