@@ -89,7 +89,7 @@ public function __construct(
89
89
LocatorInterface $ locator ,
90
90
array $ data = []
91
91
) {
92
- parent ::__construct ($ context , $ data );
92
+ parent ::__construct ($ context , $ data, $ data [ ' jsonHelper ' ] ?? null , $ data [ ' directoryHelper ' ] ?? null );
93
93
$ this ->_configurableType = $ configurableType ;
94
94
$ this ->stockRegistry = $ stockRegistry ;
95
95
$ this ->variationMatrix = $ variationMatrix ;
@@ -278,7 +278,7 @@ private function getVariantAttributeComposition(): array
278
278
protected function _getAssociatedProducts ()
279
279
{
280
280
$ product = $ this ->getProduct ();
281
- $ ids = $ this -> getProduct () ->getAssociatedProductIds ();
281
+ $ ids = $ product ->getAssociatedProductIds ();
282
282
if ($ ids === null ) {
283
283
// form data overrides any relations stored in database
284
284
return $ this ->_configurableType ->getUsedProducts ($ product );
@@ -378,13 +378,13 @@ private function buildAttributeDetails(AbstractAttribute $attribute): array
378
378
];
379
379
380
380
foreach ($ attribute ->getOptions () as $ option ) {
381
- if (! empty ( $ option[ ' value ' ] )) {
381
+ if ($ option-> getValue ( )) {
382
382
$ details ['options ' ][] = [
383
383
'attribute_code ' => $ attribute ->getAttributeCode (),
384
384
'attribute_label ' => $ attribute ->getStoreLabel (0 ),
385
- 'id ' => $ option[ ' value ' ] ,
386
- 'label ' => $ option[ ' label ' ] ,
387
- 'value ' => $ option[ ' value ' ] ,
385
+ 'id ' => $ option-> getValue () ,
386
+ 'label ' => $ option-> getLabel () ,
387
+ 'value ' => $ option-> getValue () ,
388
388
'__disableTmpl ' => true ,
389
389
];
390
390
}
@@ -415,10 +415,10 @@ private function buildChildProductOption(array $attributeDetails): array
415
415
* Get label for a specific value of an attribute.
416
416
*
417
417
* @param AbstractAttribute $attribute
418
- * @param int $valueId
418
+ * @param mixed $valueId
419
419
* @return string
420
420
*/
421
- private function extractAttributeValueLabel (AbstractAttribute $ attribute , int $ valueId ): string
421
+ private function extractAttributeValueLabel (AbstractAttribute $ attribute , mixed $ valueId ): string
422
422
{
423
423
foreach ($ attribute ->getOptions () as $ attributeOption ) {
424
424
if ($ attributeOption ->getValue () == $ valueId ) {
0 commit comments