Updating Product Codes Using Import Function

  • Posts: 59
  • Thank you received: 4
  • Hikashop Business
2 weeks 2 days ago #364274

-- HikaShop version -- : 5.1.1 Biz
-- Joomla version -- : 4.4.9
-- PHP version -- : 8.2.25
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : none

Greetings,

My client is redefining their part #'s. We have over 700 product codes to update including both main products and variants.

I'm attempting to use the product import function to perform these updates.

After some trial and error I've found a .csv file format that uploads without generating hikashop errors.

My latest iteration of .csv file format looks like this.....

product_id,product_parent_id,product_code,product_type
557,556,8511-BX,variant
558,556,8511-CS,variant
570,,690-159200201,main
581,,6400-SERIES,main
601,,TYPE-I-BARRICADE-SERIES,main
602,,TYPE-II-BARRICADE-SERIES,main
.....

It successfully uploads but leaves me with mixed results....

- some main products and variants update fine
- some update the product_code but also alter other fields.....descriptions, seo fields and others contents have disappeared, quantity has been changed to 0
- some products are updated in the database but no longer appear in the front end nor backend of the site.

got any ideas on what i;m doing wrong ?

your support is always appreciated,

Dave

Last edit: 2 weeks 2 days ago by daduts.

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

  • Posts: 82862
  • Thank you received: 13370
  • MODERATOR
2 weeks 2 days ago #364279

Hi,

The import system bases itself on the product_code to match the products in the database with the products in the CSV.
Also, the import system is geared towards import of all the product information. Small updates won't work well with it. I would recommend reverting the changes made by your import.

Here is what I recommend instead in your case:
- create a custom product field via the menu Display>Custom fields where you'll be storing the new product code
- modify your CSV file to have the old product code in the product_code column, add a new column for the custom field with the new product code, and remove the product_id, product_parent_id and product_type columns. You don't need to bother with that.
- create a mass action via the menu System>Mass actions and use the filter "CSV import" to import the CSV file with the two columns. Run the mass action with the checkbox of the filter to save checked.
- create another mass action with a filter on the custom field column not being empty, and an action "update the values" on the "product_code" column with the mode "operation" and the value product.xxx where xxx is the column of the custom field. When you run the mass action, it will replace the old product code with the new one from the custom field.

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

  • Posts: 59
  • Thank you received: 4
  • Hikashop Business
2 weeks 1 day ago #364311

Thanks nicholas for the quick response.

One question....

could the new method work if the two columns in my import file are product_id and the custom field instead of product_code and the custom field ?
would save me a bunch of work.

Thanks

Dave

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

  • Posts: 82862
  • Thank you received: 13370
  • MODERATOR
2 weeks 1 day ago #364318

Hi,

No, the mass action import also bases itself on the product_code, not the product_id.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum