Sell on Pinterest this Holiday Season: CedCommerce Etsy Integration Adds Pinterest Publishing
Why Pinterest Is a Growth Channel for Etsy Sellers Discovery drives eCommerce growth. With 482
In Magento2, referring to the products’ form attributes and their options, get ‘render dynamically,’ means that as an admin you can add as many attributes and as many options to that product attribute as you want. This is handled by using the strategy of data and meta-data. Now the problem is if you create a custom attribute with 100 options then it will be hard for the user to select any particular one if it’s not sorted alphabetically. In this blog, we will explain how can you sort product attributes options alphabetically to make it user-friendly.
We are assuming that you already have an idea to create a custom module in Magento2. In Case you don’t, then no worries you can follow the below-mentioned steps-
Here we are going to use a plugin for extending the functionality of meta-data. But if you have no idea how to create a plugin you may check it on Magento2 dev-docs to get a brief idea about Magento2 plugins.
We assume that you already have a basic idea about Magento2 coding.
Write the below code in your Vendor\Module\etc\adminhtml\di.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav"> <plugin name="after_ui_eav_product_form_modifier" type="Vendor\Module\Plugin\Ui\DataProvider\Product\Form\Modifier\Eav" sortOrder="1" disabled="false"/> </type> </config>
Now create a plugin file with the namespace
Vendor\Module\Plugin\Ui\DataProvider\Product\Form\Modifier\Eav, and add the below code.
<?php namespace Vendor\Module\Plugin\Ui\DataProvider\Product\Form\Modifier; use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav; /** * Class Eav */ class Eav { const ATTRIBUTE_TO_SORT = ['xyz_attr1' ,'xyz_attr2']; /** * Initial meta setup * * @param Eav $subject * @param array $result * @return array */ public function afterSetupAttributeMeta(Eav $subject, $result){ if (isset($result['arguments']['data']['config']['code'])) { $code = $result['arguments']['data']['config']['code']; if (in_array($code, self::ATTRIBUTE_TO_SORT)){ if (isset($result['arguments']['data']['config']['options'])) { $options = &$result['arguments']['data']['config']['options']; usort($options, function($a, $b) { return $a['label'] > $b['label']; }); } } } return $result; } }
In this, we are using “usort” for the multi-select attribute options, so this code will sort only the multidimensional array, it will sort the array options by labels.
Why Pinterest Is a Growth Channel for Etsy Sellers Discovery drives eCommerce growth. With 482
In a strategic move to enable smaller businesses with global ambitions, international logistics giant DHL
In a turn of events that highlights the volatility and responsiveness of global eCommerce logistics,
About the Brand Name: Intense Oud Industry: Luxury Fragrance Location: US Luxury isn’t just a
Tariffs. AI-driven marketplace algorithms. The repeal of de minimis. And ad costs rise Y-O-Y. For
What’s Changing Beginning September 1, 2025, TikTok Shop will require all advertisers to run promotions
Amazon is making one of the biggest catalog cleanups in recent memory. Starting September 2,
Amazon Business is marking its 10th anniversary in 2025, celebrating a decade of transforming business
Best Buy has entered the growing “marketplace-as-a-service” trend by launching its first U.S. online marketplace
Etsy is experimenting with a new tiered ad strategy for sellers—currently in beta—that requires a
As announced, Amazon has officially opened submissions for its Prime Big Deal Days (October) and
Amazon is making grocery delivery more convenient than ever for its Prime members. As of
TikTok is no longer just shaping shopping trends—it’s now building the infrastructure to deliver them.
As eBay celebrates its 30th anniversary, the marketplace is doubling down on artificial intelligence to
eCommerce sellers, and those selling on Amazon, are entering a critical pre-Black Friday Cyber Monday
Germany’s eCommerce heavyweight Kaufland officially launched its online marketplace in France, marking its sixth market
Shein’s UK arm posted pre-tax profits of £38.2 million in 2024—an eye-catching 56.5% increase—as revenues
UPS will align its dimensional weight (DIM) calculation method with FedEx starting August 18, 2025,
Release Highlights WooCommerce’s latest updates bring WCAG 2.2 compliance, shareable checkout URLs, and faster, more
The global pet care market is booming, with projections estimating it will hit $236.1 billion