3

I am using Magento 2.2.4, I am having too many Disabled/OutofStock products which are useless.

Now the problem I am simply replacing all Disabled/OutofStock products with New Products. I can successfully change everything in every disable product and make it New Product Besides Url Key. When I simply remove everything from Url Key field and Click save than new Url Key Generates successfully as per new product name but when I try to open that product in the browser, it shows 404 page and that product is still showing with old product's URL key. After that I have to go Marketing-->Url Rewrites and change the URL key manually and than the new product's URL key works fine But when ever I change anything in the new product for example Price, Categories etc than the old product's url key reverts back and the new product shows 404 page on new product's url key and only show the page on old product's url key.

I tried everything I able to found on the internet but failed, unfortunately.

Please guide if anyone has the solution for my above issue. I never faced this issue with Magento 1, This seems very weird.

Update: I just found that this issue is coming with the products only imported from Magento 1 and the products created with Magento 2 are working fine with Url Key.

FYI: we imported products from Magento 1 to Magento 2 with UB Data Migration Lite extension

does any one have any idea on this issue?

  • reindex and check again: php bin/magento indexer:reindex – Nikunj Vadariya May 25 '18 at 4:54
  • i did this 100 times already but no success. I think because Magento 2 doesn't have URL Rewrite Index and Magento 1 was having URL Rewrite Index – zubair May 25 '18 at 9:07
  • try to php bin/magento indexer:clean & indexer:reindex – MR.R DNATH May 25 '18 at 23:54
  • issue resolved and i answered as well. Please check. Thank you so much. – zubair May 26 '18 at 13:33
  • Please check for this .. I hope it will works for you ... magento.stackexchange.com/questions/244801/… – 90RK Oct 9 '18 at 10:02
4

issue resolved with below solution.

As i said the url key was not regenerating only with Migrated Products from Magento 1 to Magento 2 with UB Migration Tool Lite Extension.

at the time of Migrating the products UB Migration Tool created multiple url_key and url_path entries for each product instead of creating just 1 entry for url_key. So i deleted the extra entries by using below queries.

DELETE FROM catalog_product_entity_varchar WHERE attribute_id = 120 (This was For url_path which is no longer needed with in my config circumstances and this was populated with the old products url value)

DELETE FROM catalog_product_entity_varchar WHERE store_id = 1 (This was also populated with old products url value and not needed because Magento by default is saving all the product url_key with store_id = 0 and not 1 because i am using single store mode)

after above i truncate url rewrite tables below

TRUNCATE catalog_url_rewrite_product_category TRUNCATE url_rewrite

after above i install the following module and this is excellent tool to regenerate the urls because Magento 2 is not providing such functionality.

https://github.com/karliuka/m2.IndexerUrlRewrite

after installation, i executed below commands

php bin/magento indexer:reindex

all urls reindexed successfully and after that i tested changing the url keys for old migrated products from Magento 1 and they are now successfully generating the new url key same time after saving the product they simply remove old url key and insert new url key in the database which is perfectly fine.

Thank you

0

Have you set up the cronjob to reindex your data?

If you haven't set up it, I would recommend you to log in by SSH and execute the reindex command manually support.weltpixel.com

  • Thanks but i already setup cronjob perfectly and tried reindexing manually as well but no success. Magento 2 doesn't have URL Rewrite index like Magento 1 – zubair May 25 '18 at 9:08

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.