@@ -194,7 +194,6 @@ protected function _addFilter($storeId, $attributeCode, $value, $type = '=')
194194 break ;
195195 default :
196196 return false ;
197- break ;
198197 }
199198
200199 $ attribute = $ this ->_getAttribute ($ attributeCode );
@@ -310,10 +309,6 @@ public function getCollection($storeId)
310309 }
311310
312311 $ connection = $ this ->getConnection ();
313- $ urlsConfigCondition = '' ;
314- if ($ this ->isCategoryProductURLsConfig ($ storeId )) {
315- $ urlsConfigCondition = 'NOT ' ;
316- }
317312
318313 $ this ->_select = $ connection ->select ()->from (
319314 ['e ' => $ this ->getMainTable ()],
@@ -324,9 +319,7 @@ public function getCollection($storeId)
324319 []
325320 )->joinLeft (
326321 ['url_rewrite ' => $ this ->getTable ('url_rewrite ' )],
327- 'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1 '
328- . 'AND NULLIF(url_rewrite.metadata,"") IS '
329- . $ urlsConfigCondition . 'NULL '
322+ 'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1 AND url_rewrite.metadata IS NULL '
330323 . $ connection ->quoteInto (' AND url_rewrite.store_id = ? ' , $ store ->getId ())
331324 . $ connection ->quoteInto (' AND url_rewrite.entity_type = ? ' , ProductUrlRewriteGenerator::ENTITY_TYPE ),
332325 ['url ' => 'request_path ' ]
@@ -490,20 +483,4 @@ private function getProductImageUrl($image)
490483 {
491484 return $ this ->imageUrlBuilder ->getUrl ($ image , 'product_page_image_large ' );
492485 }
493-
494- /**
495- * Return Use Categories Path for Product URLs config value
496- *
497- * @param null|string $storeId
498- *
499- * @return bool
500- */
501- private function isCategoryProductURLsConfig ($ storeId )
502- {
503- return $ this ->scopeConfig ->isSetFlag (
504- HelperProduct::XML_PATH_PRODUCT_URL_USE_CATEGORY ,
505- ScopeInterface::SCOPE_STORE ,
506- $ storeId
507- );
508- }
509486}
0 commit comments