0

I import more than 2000 products in magento but I have a problem, I don't know what is the reason but now at the end of each sku appear _1 is there any way to remove this for all skus?

1 Answer 1

2

The quick and dirty way would be just to run this sql query on your database.

UPDATE catalog_product_entity
SET sku = CONCAT(LEFT(sku, CHAR_LENGTH(sku) -2), '')
WHERE sku LIKE '%_1';

You can add a where condition if you need it for a certain group of products.

Backup first.

5
  • thank you so much, but now I observe there only some sku's have _1 this value, not all, is there any way to idetify this value and replace it?
    – Robert
    Commented Mar 13, 2017 at 10:08
  • I added a where condition to filter out only the ones that end with _1.
    – Marius
    Commented Mar 13, 2017 at 10:09
  • catalog_entity_product in not exist, I change with catalog_product_entity, but now I have this #1054 - Unknown column '%_1' in 'where clause'
    – Robert
    Commented Mar 13, 2017 at 10:18
  • Sorry for that. I wrote the answer in a hurry. I changed the table name and some quotes. Try it again.
    – Marius
    Commented Mar 13, 2017 at 10:19
  • is perfect, my problem was solved, thank you so much for your help
    – Robert
    Commented Mar 13, 2017 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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