File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
app/code/Magento/ConfigurableProduct/Block/Product/View/Type Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -154,14 +154,14 @@ public function hasOptions()
154
154
public function getAllowProducts ()
155
155
{
156
156
if (!$ this ->hasAllowProducts ()) {
157
- $ products = [];
158
157
$ skipSaleableCheck = $ this ->catalogProduct ->getSkipSaleableCheck ();
159
- $ allProducts = $ this -> getProduct ()-> getTypeInstance ()-> getUsedProducts ( $ this -> getProduct (), null );
160
- foreach ($ allProducts as $ product ) {
161
- if ( $ product -> isSaleable () || $ skipSaleableCheck ) {
162
- $ products [] = $ product ;
163
- }
158
+
159
+ if ($ skipSaleableCheck ) {
160
+ $ products = $ this -> getProduct ()-> getTypeInstance ()-> getUsedProducts ( $ this -> getProduct (), null );
161
+ } else {
162
+ $ products = $ this -> getProduct ()-> getTypeInstance ()-> getSalableUsedProducts ( $ this -> getProduct (), null );
164
163
}
164
+
165
165
$ this ->setAllowProducts ($ products );
166
166
}
167
167
return $ this ->getData ('allow_products ' );
You can’t perform that action at this time.
0 commit comments