Change product_id in mysql

  • Posts: 1
  • Thank you received: 0
3 years 5 months ago #335713

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.2

Hello,

I need to recreate identically deleted products and reassign them the same product_id (so that a CRM can edit past stats...).

Can you confirm that I just need to modify the product_id in the hikashop_product and in the hikashop_product_category tables for a simple product without variants. Don't I forget other tables where the product_id is present?

Thanks in advance for your feedback.

Please Log in or Create an account to join the conversation.

  • Posts: 83402
  • Thank you received: 13496
  • MODERATOR
3 years 5 months ago #335719

Hi,

You need to do this:
1 - create a new product and save it, without changing anything in it.
2 - change its id in both the hikashop_product and the hikahop_product_category tables
3 - then, you can add prices, images, options, etc via the interface

If you do step 3 before step 2, then you also need to update the product_id in the other tables, like hikashop_price where the prices are stored, or hikashop_file where the files and images are stored, etc. So it will get more complex and you might miss some entries.

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum