3 votes

Is there a limit for Number of Options for a Dropdown Attribute?

Having over 1000 options in a dropdown is never a good idea. Just imagine having to scroll all those options and click the wrong one by mistake and the ordeal to do all the scrolling again. A better ...
user avatar
  • 4,585
1 vote
Accepted

Display product attribute dropdown box value on product page, with custom placement?

See the blocks original template (vendor/magento/module-catalog/view/frontend/templates/product/view/attribute.phtml), especially this condition: $_attributeType = $block->getAtType(); //[...] if ($...
user avatar
1 vote
Accepted

Is there any event for Create/edit/delete attributes Magento 2.4.2

Check for catalog_entity_attribute_save_before and catalog_entity_attribute_save_after
user avatar
1 vote

Magento 2 - How to hide/remove custom attribute from backend Account Information tab in customer page?

I have created a custom attribute for the customer entity and we are managing it internally so I will surely hide it. Would you please find the below code? Step 1: Create a file app/code/Vendor/...
user avatar
1 vote

addFieldToFilter() with OR Condition in magento2

$collection->addFieldToFilter(['status','status'],[['nin'=>$allnonactiveorderstatus],['null'=>true]])
user avatar
  • 1,341
1 vote
Accepted

Fastest way to get attribute value of custom product attribute by attribute_code and sku

I think best one and correct is using following logic: // better to initialize all related instances in __constructor $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $eavConfig ...
user avatar
1 vote

Show a Text if attribute is set to "yes"

Based on tags I guess you have an issue with loading product data on checkout cart page and let me explain 2 possible way to solve Magento loads restricted attribute list for category collection or ...
user avatar
1 vote

Magento 2 : Get Configurable Product using swatch-option

Following code work for me you can try it. app\code\Vendor\Extension\etc\di.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
user avatar
  • 2,584
1 vote
Accepted

How do I get all option value id's for a given attribute in a specific category in my custom block?

protected $eavConfig; protected $_productCollectionFactory; protected $_registry; public function __construct( ... ... \Magento\Catalog\Model\ResourceModel\Product\...
user avatar
  • 1,319
1 vote

How to enable Use in Layered Navigation field in admin panel?

Most likely the attribute you're trying to enable for Use in Layered Navigation doesn't have the proper type. Please check the Catalog Input Type for Store Owner option for this attribute and see if ...
user avatar
1 vote

Update attribute : add source

<?php namespace VVendor\Extension\Setup; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\...
user avatar
1 vote

How to display cms block in product page if some attribute is set to yes

you need to try this code. <?php if(($_product->getYourCustomattribute())) { echo $this->getLayout()->createBlock('cms/block')->setBlockID('Your_Block_Id')->tohtml(); ...
user avatar
1 vote

how to get custom product attribute in block file?

Try this code: $_helper = $this->helper('Magento\Catalog\Helper\Output'); echo $_attributeValue = $block->getProduct()->getResource()->getAttribute('your_attribute')->getFrontend()->...
user avatar
  • 198
1 vote
Accepted

Get attribute from using dropdown yes no

You need to do code like this : <ul class="safety-footwear-icons"> <?php if($product->getSafetyBasic()){ ?> <li class="sb"> <span class="...
user avatar
1 vote

Is there a limit for Number of Options for a Dropdown Attribute?

It's a limit of php configuration, because config max_input_vars by default has value 1000, in this case value of max_input_vars should be 10000. After increasing to 100000 it seems to work fine with ...
user avatar
1 vote

Is there a limit for Number of Options for a Dropdown Attribute?

I don't believe that there is a technical limit to the number of attribute option values other than the size of the primary key on the tables that store the data and the amount of space the database ...
user avatar
  • 612

Only top scored, non community-wiki answers of a minimum length are eligible