File tree 1 file changed +13
-2
lines changed
Model/Client/Request/Recommendations
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,12 @@ public function getProduct()
33
33
*/
34
34
public function setProduct (Product $ product )
35
35
{
36
- if ( $ this ->config -> isGroupedProductsEnabled () && $ product-> getTypeId () === ' configurable ' ) {
36
+ $ this ->product = $ product ;
37
37
38
+ if ($ this ->config ->isGroupedProductsEnabled () && $ product ->getTypeId () === 'configurable ' ) {
39
+ $ this ->product = $ this ->getSimpleProduct ($ product );
38
40
}
39
41
40
- $ this ->product = $ product ;
41
42
return $ this ;
42
43
}
43
44
@@ -67,4 +68,14 @@ public function getPathSuffix()
67
68
68
69
return '/ ' . $ productTweakwiseId . parent ::getPathSuffix ();
69
70
}
71
+
72
+ private function getSimpleProduct (Product $ product )
73
+ {
74
+ $ children = $ product ->getTypeInstance ()->getUsedProducts ($ product );
75
+ foreach ($ children as $ child ) {
76
+ if ($ child ->isSaleable () && $ child ->getTypeId () === 'simple ' ) {
77
+ return $ child ;
78
+ }
79
+ }
80
+ }
70
81
}
You can’t perform that action at this time.
0 commit comments