Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit c4fe761

Browse files
author
Dinesh V B
committed
issue-8347-made the requested changes
1 parent 92fc13a commit c4fe761

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/_videos/fundamentals/add-new-product-attribute.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,13 @@ For use case `2` (a 'mutable' set of options), see ["EAV and extension attribute
355355

356356
With `\Magento\Eav\Setup\EavSetup.php::addAttribute()` and `\Magento\Eav\Setup\EavSetup.php::addAttributeOptions()` you can add a series of options with the following array:
357357

358-
```
359-
'option' => ['values' => ['Option 1', 'Option 2', 'Option 3', etc.]]
358+
```php
359+
'option' => ['values' => ['Option 1', 'Option 2', 'Option 3', etc.]];
360360
```
361361

362362
Alternatively, you may designate a specific option sorting order as follows:
363363

364-
```
364+
```php
365365
'option' => ['values' => [8 => 'Option 1', 3 => 'Option 2', 11 => 'Option 3', etc.]]
366366
```
367367

@@ -373,18 +373,18 @@ Alternatively, you may designate a specific option sorting order as follows:
373373

374374
1. Assign an array of new options to a variable:
375375

376-
```
376+
```php
377377
$options = ['attribute_id' => null, 'values' => 'Option 1', 'Option 2', etc]];
378378
```
379379

380380
1. Update your array with the attribute ID from the database:
381381

382-
```
382+
```php
383383
$options['attribute_id'] = $eavSetup->getAttributeId($eavSetup->getEntityTypeId('catalog_product'), 'your_attribute_code');
384384
```
385385

386386
1. Add your options:
387387

388-
```
388+
```php
389389
$eavSetup->addAttributeOption($options);
390390
```

0 commit comments

Comments
 (0)