Centralized Catalog, Faster Publishing: 40ParkLane’s Marketplace Success with CedCommerce
Reading Time: 4 minutesAbout the Brand: 40ParkLane LLC Studio40ParkLane is a design-led print-on-demand brand created…
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: 4 minutesAbout the Brand: 40ParkLane LLC Studio40ParkLane is a design-led print-on-demand brand created…
Reading Time: 3 minutesAbout the Company Brand Name: David Protein Industry: Health & Nutrition (Protein…
Reading Time: 3 minutesOnline retail spending in Germany is entering a renewed growth phase after…
Reading Time: 4 minutesTikTok Shop has released a comprehensive Beauty and Personal Care Products Policy,…
Reading Time: 4 minutesTikTok Shop has formally outlined comprehensive requirements for expiration date labeling and…
Reading Time: 3 minutesTikTok Shop is raising its sales commission for merchants across five active…
Reading Time: 11 minutesBy now you have seen your BFCM 2025 numbers. The harder question…
Reading Time: 3 minutesAbout the Brand Name: Vanity Slabs Inc Industry: Trading Slabs- Vanity Slabs…
Reading Time: 2 minutesAbout the Brand Name: Ramjet.com Industry: Automotive Parts & Accessories Location: United…
Reading Time: 2 minutesAmazon is rolling out strategic referral fee reductions across five major European…
Reading Time: 4 minutesQuick Summary: Scaling Lifestyle Powersports on eBay with CedCommerce Challenge: Zero marketplace…
Reading Time: 4 minutesTikTok has surpassed 460 million users across Southeast Asia, reinforcing its position…
Reading Time: 3 minuteseBay has released its final seller news update for 2025, with a…
Reading Time: 3 minutesAmazon has clarified its stance regarding speculation around a potential breakup between…
Reading Time: 4 minutesWalmart is accelerating its push into next-generation fulfillment by expanding its drone…
Reading Time: 4 minutesFaire, the fast-growing wholesale marketplace connecting independent retailers with emerging brands, has…
Reading Time: 4 minutesB2B buying in the United States is undergoing a fundamental behavioral shift…
Reading Time: 3 minutesSummary Cyber Monday 2025 has officially become the largest online shopping day…
Reading Time: 2 minutesSummary Amazon kicked off December with two major developments shaping the future…
Reading Time: 2 minutesSummary Walmart has entered December with two major moves that signal a…