New answers tagged product-attribute
0
votes
How to get the product type?
For ordered product list, from order collection we can use $item->getProductType() to get the Product type.
Sample code set
<?php
......
foreach ($orders->getAllItems() as $item) {
echo $...
- 2,651
1
vote
Accepted
How to Create Bulk Product Attributes in magento 2?
Can you try using below script and create bulk product attributes:-
<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/../app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $...
- 3,550
0
votes
Add Wysiwyg attribute to Product in Magento 2
The answer shared by Msquare is indeed correct but there are some small issues. First in the InstallData.php file which creates the attribute
is_wysiwyg_enabled => true,
should be changed to
...
0
votes
magento 2.4 product collection filter by custom attribute value instead of id
Get Option id from $product Object
$attr = $product->getResource()->getAttribute('color');
if ($attr->usesSource()) {
$optionId = $attr->getSource()->getOptionId("Red");...
- 5,961
0
votes
magento 2.4 product collection filter by custom attribute value instead of id
Yes, you can filter the product collection using the option value instead of the option id in Magento 2.4. To achieve this, you need to use the addAttributeToFilter method with an array as the value ...
- 391
2
votes
Accepted
How to delete empty attribute values in Magento 2
Okay, I figured it out. I couldn't find a single SQL command to do everything but this is the process I used to fix this.
go to the eav_attribute table of your database and find the attribute_id of ...
- 33
Top 50 recent answers are included
Related Tags
product-attribute × 1819magento2 × 687
magento-1.9 × 341
attributes × 336
product × 276
configurable-product × 137
custom-attributes × 113
magento-2.1 × 93
attribute-set × 70
magento2.3 × 58
collection × 53
magento-1.7 × 51
magento-1 × 50
php × 49
admin × 49
product-collection × 47
magento2.2 × 45
database × 43
custom-options × 42
magento-1.8 × 41
products × 36
event-observer × 35
price × 34
adminhtml × 30
catalog × 30