New answers tagged

0

You can use Magento\Eav\Api\AttributeOptionManagementInterface, it has method delete which you can use. /** * @var \Magento\Eav\Api\AttributeOptionManagementInterface */ protected $attributeOptionManagement; ... $this->attributeOptionManagement->delete( 'catalog_product', $attributeId, $...


0

Check "eav_entity_type" table. It will show you all the attribute type code you can use while fetching the information.


0

Magento 2 created this attribute using the size 64, you can create a module to change this column in the table catalog_product_entity.


2

You need to use catalog_product_gallery_prepare_layout observer event for that and override gallery.phtml file. Follow the below steps to add custom drop-down in product edit form : 1) Create events.xml file on this below path for add events catalog_product_gallery_prepare_layout : /app/code/CompanyName/ModuleName/etc/adminhtml <?xml version="1.0"?&...


0

You could perform SQL joins to reduce multiple requests to SQL server. In your case you could write query as SELECT eav_attribute.*, eav_entity_type.additional_attribute_table, catalog_eav_attribute.* FROM eav_attribute LEFT JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_attribute.entity_type_id LEFT JOIN catalog_eav_attribute ON ...


0

I am facing same issue in Magento2.3 $eavSetup->addAttribute(Customer::ENTITY, 'organization', [ // Attribute parameters 'type' => 'varchar', 'label' => 'Organization', 'input' => 'text', 'required' => false, 'visible' => true, 'is_visible' => true, ...


0

I solved this issue by doing the following: AND: Stores > Configuration > Catalog > Catalog > Storefront > Show Swatches in Product List = YES


1

Try this, $value="test"; $product->setEpaisseur(trim($value)); $product->getResource()->saveAttribute($product, 'epaisseur');


1

Please try with below code : $_product->setData('epaisseur', $namep); OR $_product->setEpaisseur($namep); I hope its helpful to you.


0

Thank you to the other answers. I've put together a full fix to migrate the affected attributes. This issue can be caused by a product migration. The multi-select attribute has the backend_type value as text when it should be varchar. See if this issue affects the website (you will get no records returned if you are okay): SELECT * from eav_attribute ...


2

First read this below articles: https://store.fooman.co.nz/blog/an-introduction-to-extension-attributes.html https://devdocs.magento.com/guides/v2.3/extension-dev-guide/extension_attributes/adding-attributes.html If you want to add a field them you need to use extension_atttibutes Extension attribute gives the facility to add a new field to existing API ...


0

As per question request after the overview (short description) need to load other product attribute data. in magento product.info.overview block is responsible to load short description (overview). so for example moving sku attribute section after overview. create a xml file catalog_product_view.xml in your theme at app/design/frontend/[NAMESPACE]/[THEME]/...


1

For your requirement, you need to create a view section means create block class,phtml, layout file . Create a custom Block on block class call product collection \Magento\Catalog\Model\ResourceModel\Product\Collection and filter that collection by this attribute value. Block Class: Assume that Block file CustomProducts.php location: app/code/{...


1

Option 1: Create catalog_product_view.xml in your theme Magento_Root/app/design/frontend/Yourtheme/Magento_Catalog/layout And paste below code. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> &...


2

protected $_attributeFactory; public function __construct( .... \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeFactory, .... ) { .... $this->_attributeFactory = $attributeFactory; .... } public function <func_name>() { $attributeInfo = $this->_attributeFactory->getCollection(); foreach($...


0

Ok, I didn't solve the problem how I wanted, but I just ended up stripping out the problematic attributes and re-importing them using traditional methods.


Top 50 recent answers are included