File tree 3 files changed +23
-5
lines changed
3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,15 @@ public function getPathSuffix()
69
69
return '/ ' . $ productTweakwiseId . parent ::getPathSuffix ();
70
70
}
71
71
72
- private function getSimpleProduct (Product $ product )
72
+ /**
73
+ * @param Product $product
74
+ * @return Product
75
+ */
76
+ private function getSimpleProduct (Product $ product ): Product
73
77
{
74
78
$ children = $ product ->getTypeInstance ()->getUsedProducts ($ product );
75
79
foreach ($ children as $ child ) {
76
- if ($ child ->isSaleable () && $ child ->getTypeId () === ' simple ' ) {
80
+ if ($ child ->isSaleable () && $ child ->getTypeId () === Magento \ Catalog \ Model \ Product \Type:: TYPE_SIMPLE ) {
77
81
return $ child ;
78
82
}
79
83
}
Original file line number Diff line number Diff line change 17
17
18
18
class RecommendationsResponse extends Response
19
19
{
20
+ /**
21
+ * @var bool
22
+ */
20
23
private bool $ proccessedGroupedProducts = false ;
21
24
25
+ /**
26
+ * RecommendationsResponse constructor.
27
+ *
28
+ * @param Helper $helper
29
+ * @param Request $request
30
+ * @param Config $config
31
+ * @param array|null $data
32
+ */
22
33
public function __construct (
23
34
Helper $ helper ,
24
35
Request $ request ,
@@ -56,7 +67,7 @@ public function setRecommendation(array $recommendation)
56
67
public function getItems (): array
57
68
{
58
69
if ($ this ->config ->isGroupedProductsEnabled () && !$ this ->proccessedGroupedProducts ) {
59
- //manually group items since recommendations doesn't have an grouped call yet.
70
+ // Manually group items since recommendations doesn't have a grouped call yet.
60
71
$ items = parent ::getItems ();
61
72
$ groups = [];
62
73
if (empty ($ items )) {
Original file line number Diff line number Diff line change @@ -118,7 +118,10 @@ public function getUrl()
118
118
return (string ) $ this ->getDataValue ('url ' );
119
119
}
120
120
121
- public function getGroupCodeFromAttributes ()
121
+ /**
122
+ * @return string
123
+ */
124
+ public function getGroupCodeFromAttributes (): string
122
125
{
123
126
$ attributes = $ this ->getDataValue ('attributes ' );
124
127
@@ -132,7 +135,7 @@ public function getGroupCodeFromAttributes()
132
135
$ attribute ['name ' ] === 'groupcode ' &&
133
136
isset ($ attribute ['values ' ]['value ' ])
134
137
) {
135
- return (string )( $ attribute ['values ' ]['value ' ]) ;
138
+ return (string )$ attribute ['values ' ]['value ' ];
136
139
}
137
140
}
138
141
You can’t perform that action at this time.
0 commit comments