From $22K to $118K/Month: How CedCommerce Helped The Drive Clothing Turn TikTok Shop Into a Scalable Revenue Engine
Reading Time: 3 minutes About the Client The Drive Clothing is a lifestyle apparel brand…
In Magento 2 UI grid, sometimes when data-provider is passed in the XML file and we have to add the filter of store switcher, it doesn’t works,because when Magento call the collection of grid via ajax it use another controller(default -> mui/index/render) and it won’t have the parameter same as the previous URL, so to pass these parameters to new URL we can follow the below mentioned steps.
First add custom key, a filter_url_params section in the data-provider UI grid, as shown:
<dataSource name="driver_listing_data_source"> <argument name="dataProvider" xsi:type="configurableObject"> <argument name="class" xsi:type="string">MageNative\MobiDelivery\Ui\DataProvider\DriverDataProvider</argument> <argument name="name" xsi:type="string">driver_listing_data_source</argument> <argument name="primaryFieldName" xsi:type="string">id</argument> <argument name="requestFieldName" xsi:type="string">id</argument> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item> <item name="update_url" xsi:type="url" path="mui/index/render"/> <item name="storageConfig" xsi:type="array"> <item name="indexField" xsi:type="string">id</item> <item name="dataScope" xsi:type="string">store_id</item> </item> <item name="filter_url_params" xsi:type="array"> <item name="store" xsi:type="string">*</item> </item> </item> </argument> </argument> </dataSource>
In the second step, add the ‘$’ sign, this->prepares updateUrl(); in the __construct(…).
After that add the first add custom key below the filter_url_params section in the data-provider UI grid, as shown
/** * @return void */ protected function prepareUpdateUrl() { if (!isset($this->data['config']['filter_url_params'])) { return; } foreach ($this->data['config']['filter_url_params'] as $paramName => $paramValue) { if ('*' == $paramValue) { $paramValue = $this->request->getParam($paramName); } if ($paramValue) { $this->data['config']['update_url'] = sprintf( '%s%s/%s/', $this->data['config']['update_url'], $paramName, $paramValue ); $this->addFilter( $this->filterBuilder->setField($paramName)->setValue($paramValue)->setConditionType('eq')->create() ); } } }
Now in the end, as a conclusion, this process will help you to add another filter like store-switcher from outside the grid filters.
Reading Time: 3 minutes About the Client The Drive Clothing is a lifestyle apparel brand…
Reading Time: 3 minutes Amazon is updating its reference pricing rules in two phases that…
Reading Time: 4 minutes Temu has become a General Member of the International AntiCounterfeiting Coalition,…
Reading Time: 3 minutes eBay has shared early results from its 24 Hours of Drops…
Reading Time: 3 minutes eBay has been revealed as a beta partner in Meta’s new…
Reading Time: 3 minutes Etsy is updating its Purchase Protection programme from 7 May, and…
Reading Time: 2 minutes Walmart is doubling down on creator-driven social commerce, turning influencer content…
Reading Time: 2 minutes In a major follow-up to our earlier coverage — “Amazon Confirms:…
Reading Time: 12 minutes From Etsy policy changes, such as fees and payments, to creativity…
Reading Time: 1 minuteDigital Commerce 360 reports that eCommerce accounted for 25% of total retail…
Reading Time: 1 minuteA coalition of 23 WTO member countries, including the United States, Britain,…
Reading Time: 2 minutes Amazon has announced a 3.5% surcharge for sellers using its fulfilment network…
Reading Time: 2 minutes Amazon has officially expanded its free, box-free, label-free returns network by…
Reading Time: 2 minutes Walmart is bringing Sparky, its proprietary shopping assistant, into ChatGPT, marking…
Reading Time: 2 minutes Visa has rolled out six AI-powered dispute resolution tools aimed at…
Reading Time: 3 minutes On March 26, 2026, the European Parliament and the Council reached…
Reading Time: 4 minutes Kanzen Skincare and six other brands are preparing for what is…
Reading Time: 5 minutes When a seller expands to a new Walmart market, the first…
Reading Time: 11 minutes What if reaching hundreds of millions of Amazon customers didn’t mean…
Reading Time: 2 minutes Alibaba’s latest update shows that AI is becoming a much bigger…