@@ -310,10 +310,6 @@ public function getCollection($storeId)
310310 }
311311
312312 $ connection = $ this ->getConnection ();
313- $ urlsConfigCondition = '' ;
314- if ($ this ->isCategoryProductURLsConfig ($ storeId )) {
315- $ urlsConfigCondition = 'NOT ' ;
316- }
317313
318314 $ this ->_select = $ connection ->select ()->from (
319315 ['e ' => $ this ->getMainTable ()],
@@ -324,9 +320,7 @@ public function getCollection($storeId)
324320 []
325321 )->joinLeft (
326322 ['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 '
323+ 'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1 AND url_rewrite.metadata IS NULL '
330324 . $ connection ->quoteInto (' AND url_rewrite.store_id = ? ' , $ store ->getId ())
331325 . $ connection ->quoteInto (' AND url_rewrite.entity_type = ? ' , ProductUrlRewriteGenerator::ENTITY_TYPE ),
332326 ['url ' => 'request_path ' ]
@@ -490,20 +484,4 @@ private function getProductImageUrl($image)
490484 {
491485 return $ this ->imageUrlBuilder ->getUrl ($ image , 'product_page_image_large ' );
492486 }
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- }
509487}
0 commit comments