New answers tagged

0

You can try this code to get the sku of any product: $configProduct = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id); $_children = $configProduct->getTypeInstance()->getUsedProducts($configProduct); foreach ($_children as $child){     echo "Here are your child Product Ids ".$child->getID()."\n"; }...


0

When you want sku? After add to cart or before add to cart when customer select options?


1

If you want to display fields only if Select is YES Use below tag inside fields you want to display only on YES You have to use depends tag, it can be used to declare dependencies to other fields. Is used to only show specific fields/groups when a given field has a value of 1 <field id="A_UNIQUE_FIELD_ID" translate="label" sortOrder=&...


0

please follow this link if you want product collection using graphql https://github.com/viveksh2021/GraphQL


0

Try this code to show short description. <?php echo $item->getShortDescription(); ?>


0

In order to delete product attribute from backend navigate to Stores -> Attributes -> Product click on desired attribute and in next page you will see Delete Attribute button in the top bar, click on it to delete attribute. If you do not see the delete attribute button then it means the table column 'is_user_defined' in the eav_attribute table is set ...


1

You should use Magento\Eav\Setup\EavSetup in the Upgrade script or Data patch, as for Magento version > 2.3; $eavSetup->updateAttribute( \Magento\Catalog\Model\Product::ENTITY, 'old_attribute_code, 'attribute_code', 'new_attribute_code' );


0

To create a new attribute (I assume a textarea with WYSIWYG enabled would be nice), go to your module, and create a new patch in the location Vendor/module-name/Setup/Patch/Data/AddKeyFeaturesAttribute.php with the following content: <?php namespace Vendor\Module\Setup\Patch\Data; use Magento\Framework\Setup\Patch\DataPatchInterface; use Magento\Eav\...


0

The easiest way would be to create a Multi Select product attribute which you would populate with all possible options. When you create this attribute, you need to make sure that Storefront Properties > Used in Product Listing is set to YES. And then you would select which features apply on product level. Then you can simply add a new block to your ...


0

@adi Please see this below link Answered by me Follow the steps as mentioned and replace Magento\Sales\Api\Data\OrderItemInterface to Magento\Catalog\Api\Data\ProductAttributeInterface It will work Change the code as required


0

This is indeed an exceptional scenario and you should consider some optimizations. In time the list will grow only larger, as you already mentioned. On a quick thinking on the matter, here is what I suggest: you could group the products in different attribute sets and use a specific author attribute per attribute set. I don't know what type of products you ...


Top 50 recent answers are included