InsideDarkWeb.com

How to set different product attribute Default value for different store view?

I’m using magento 2.4, i just created a new product attribute like this:

     $eavSetup->addAttribute(
        MagentoCatalogModelProduct::ENTITY,
        'brand_history',
        [
            'type' => 'text',
            'label' => 'Brand History',
            'input' => 'textarea',
            'source' => '',
            'frontend' => '',
            'required' => false,
            'backend' => '',
            'sort_order' => '74',
            'global' => ScopedAttributeInterface::SCOPE_STORE,
            'visible' => true,
            'user_defined' => true,
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'unique' => false,
            'group' => 'General',
            'used_in_product_listing' => false,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => false,
            'is_filterable_in_grid' => false,
            'wysiwyg_enabled' => true,
            'option' => array('values' => array("")),
            'group' => $groupName,
            'apply_to' => 'brand',
            'default' => '<p><span><strong>History:</strong></span></p>
                          <ul>
                            <li><span>Built in: 1992.</span></li> 
                            <li><span>Can survive in the cold winter night.</span></li> 
                          </ul>',
        ]
    );

currently, when I create a new product, I can see the default value. The problem is i have a different store view that has a different language, and when i changed the store view when i create the product I need to have a different default value, how can I achieve this?

Magento Asked on February 16, 2021

0 Answers

Add your own answers!

Related Questions

Get userid of the admin logged in magento 2 helper

1  Asked on February 12, 2021 by fahad-bashir

   

Product saving problem in admin control panel

1  Asked on February 12, 2021 by venkatesha

 

Print Address / Shipping Label For Magento 2

0  Asked on February 12, 2021 by naveen-sama

     

are the two codes same?

1  Asked on February 11, 2021 by hong-thng

   

Create custom Attributes in Customer Form in magento 1.9

1  Asked on February 6, 2021 by maiitsyuj

 

Magento2 Language Character Problem

0  Asked on February 5, 2021 by stifboy

   

Magento 1.9.2.4 Add Cart To Header

2  Asked on February 5, 2021 by ks6814

         

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.