File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
SalesSampleData/Model/Order Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ protected function getProductAttributes($configurableAttributes)
197
197
}
198
198
$ options = $ this ->productConverter ->getAttributeOptions ($ attribute ->getAttributeCode ());
199
199
$ attributeOption = $ options ->getItemByColumnValue ('value ' , $ value );
200
+ if (!$ attributeOption ) {
201
+ throw new \RuntimeException ('Required option " ' .$ value .'" for ' .$ attributeCode .' does not exist ' );
202
+ }
200
203
$ attributeId = $ attributeOption ->getDataByKey ('attribute_id ' );
201
204
$ attributesData [$ attributeId ] = $ attributeOption ->getDataByKey ('option_id ' );
202
205
}
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ private function getOptionSwatchVisual(array $attributeData)
128
128
foreach ($ attributeData ['option ' ] as $ optionKey => $ optionValue ) {
129
129
if (substr ($ optionValue , 0 , 1 ) == '# ' && strlen ($ optionValue ) == 7 ) {
130
130
$ optionSwatch ['value ' ][$ optionKey ] = $ optionValue ;
131
- } else if ($ this ->colorMap [$ optionValue ]) {
131
+ } else if (! empty ( $ this ->colorMap [$ optionValue ]) ) {
132
132
$ optionSwatch ['value ' ][$ optionKey ] = $ this ->colorMap [$ optionValue ];
133
133
} else {
134
134
$ optionSwatch ['value ' ][$ optionKey ] = $ this ->colorMap ['White ' ];
You can’t perform that action at this time.
0 commit comments