[Skip to main content](#vessel-content)

#   Updating variant product data

##

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#125066](#125066) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125066 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")* was created by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")*

All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product_width and product_length but will also want to use this to update price.

I have prepared a csv file with product_id and the fields that takes this form ...

product_id,product_width,product_length
110,914.4,9144
111,1066.8,9144
93,1066.8,9144

But when I import I get this message ...

The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.

There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product_parent_id column to the csv file, or how else does it work?

Many thanks,

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 2 months ago -  13 years 2 months ago [\#125089](#125089) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125089 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

Actually, the best way to edit the products / variants is to use the mass actions via the menu System &gt; Massaction.
It allow you to filter the elements, and update their values easily.

Here is some documentation:
[ www.hikashop.com/support/2013-08-08-00-1...massaction-form.html](http://www.hikashop.com/support/2013-08-08-00-18-51/integrated-documentation/10-hikashop/167-massaction-form.html)

Last edit: 13 years 2 months ago by [Xavier](/forum/user/4105-xavier "View Xavier's Profile"). Reason: giving documentation link

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#125105](#125105) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125105 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

Thanks for the prompt reply, and mass actions look like a really powerful feature, but it doesn't really answer my question.

I have a csv file with a list of product ids and their respective dimensions (Length and width) - these dimensions are different for each product so mass actions wouldn't be appropriate. The mass actions documentation talks about triggering a csv import but there doesn't seem to be an option to actually do this, maybe this has been replaced by the cron function?

Anyway I am concerned now that when I come to update my product prices, which I was planning to do from a csv file triggered by cron, the file will be rejected because the products are variants. So can anyone answer my original question, how do I import product data from a csv file when the product ids are all for variants?

Many thanks,

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 2 months ago [\#125161](#125161) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125161 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

I come back with my mass actions ![:)](/media/kunena/emoticons/3.png ":)")
In the mass actions, you can select the filter "CSV products" and check the option "Save the products on Mass Action csv import.". This should update your products.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#125231](#125231) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125231 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Ok, the documentation is a bit thin on how this works but I think I get it now, but unless I am misunderstanding something there would appear to be a couple of bugs.

I have configured a mass action to import my csv and and "save the products on Mass Action csv import "as you suggest, I have then set the action to Display the results. There are two problems, one is that I get a notice that a number of lines can not be imported saying the product doesn't exist when in fact if I look at the database it does.

The other problem is the results output is showing the same value for width length and height when in fact these values are different. The results page also lists some of the products which the import said don't exist, highlighted in red on the attached screenshot.

I hope you can explain / address these issues.

Many thanks for the support.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

- [ ![h25961cc.JPG](/forum/attachment/12516) ](/forum/attachment/12516 "h25961cc.JPG") [ ](/forum/attachment/12516?download=1 "h25961cc.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 2 months ago [\#125367](#125367) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125367 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

Thanks to give us your csv file in order to see if it's well formatted.

And a backend + ftp access in order to debug that problem.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#125371](#125371) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125371 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Thanks for the reply. Annoyingly my broadband connection is down today. I'll pm you the details as soon as I am reconnected.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#125377](#125377) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125377 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

My broadband connection is back, so attached is the csv file which was designed to update the product_width and product_length for variants. I've sent site login details and ftp via a private message.

Many thanks for your help,

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 2 months ago [\#125701](#125701) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125701 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

I have reproduced the bug on my end, so I have debugged it on local.
It will be in the new package of HikaShop which should be uploaded for tomorrow, thanks to download it from our website, it will still have the version 2.2.2

The following user(s) said Thank You: [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#125856](#125856) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125856 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi Xavier,

Thank you for the update, that has fixed the display issue but I still have the problem on csv import that I am getting a notice that says some products can not be found when they do actually exist, they are even listed in the report at the end of the mass action.

See attached screen shot. The red crosses mark lines in the notice that I think are incorrect as the products do exist.

[ ![h20f357c.JPG](/forum/attachment/12602) ](/forum/attachment/12602 "h20f357c.JPG")

I have attached the csv file I am using and will also pm you login details to the site on my development server as these have changed.

Thanks again for the excellent support.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

- [ ![h20f357c.JPG](/forum/attachment/12602) ](/forum/attachment/12602 "h20f357c.JPG") [ ](/forum/attachment/12602?download=1 "h20f357c.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 2 months ago [\#125859](#125859) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125859 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

Have you tried without the double quotes in the csv file ? (for the columns name)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago -  13 years 2 months ago [\#125861](#125861) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#125861 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Yes, I have. Originally I didn't use the quotes but had the same problem. It's odd because I get errors up to product_id 16 then the other 500 or so products are fine. I was wondering if the fact that some products are missing is causing a flag to be set that isn't reset but there doesn't seem to be any pattern to it.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Last edit: 13 years 2 months ago by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 2 months ago [\#126050](#126050) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#126050 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

Thanks for your reports, it allow us to improve our features.

I have corrected many things about this importCsv, this will be in the next release.
To correct it now, thanks to replace the function "getFromFile()" in "administrator/components/com_hikashop/classes/massaction.php" by: Code:

function getFromFile($element, $check = false){ $data = new stdClass(); $app = JFactory::getApplication(); // get the elements from the file $importHelper = hikashop_get('helper.import'); $importFile = array(); $elts = explode('/',$element['path']); if($elts == null) return false; $nb = count($elts); if($nb == 1){ $elts = explode('\\',$element['path']); $nb = count($elts); } if(!file_exists($element['path'])){ if(!$check)$app-&gt;enqueueMessage(JText::sprintf( 'NO_FILE_FOUND',$element['path']), 'error'); $data-&gt;error = 'not_found'; return $data; } hikashop_increasePerf(); $contentFile = @file_get_contents($element['path']); if(!$contentFile){ if(!$check)$app-&gt;enqueueMessage(JText::sprintf( 'FAIL_OPEN',$element['path']), 'error'); $data-&gt;error = 'fail_open'; return $data; }; $contentFile = str_replace(array("\r\n","\r"),"\n",$contentFile); $contentFile = strip_tags($contentFile); $importLines = explode("\n", $contentFile); $importLines = str_replace('"','',$importLines); // Get the columns $columns = str_replace('"','',$importLines[0]); $listSeparators = array(';',',','&#124;',"\t"); $separator = ';'; foreach($listSeparators as $sep){ if(preg_match('#(?!\\\\)'.$sep.'#',$columns)){ $separator = $sep; $columns=str_replace($sep,'&#124;',$columns); break; } } unset($importLines[0]); if(empty($importLines)){ if(!$check)$app-&gt;enqueueMessage('EMPTY','error'); $data-&gt;error = 'empty'; return $data; } $columns = explode('&#124;',$columns); $numberColumns = count($columns); // Check if the columns exists in db $db = JFactory::getDBO(); if(!HIKASHOP_J25) { $tmp = $db-&gt;getTableFields(hikashop_table('product')); $productColumns = reset($tmp); unset($tmp); $tmp = $db-&gt;getTableFields(hikashop_table('price')); $priceColumns = reset($tmp); unset($tmp); } else { $productColumns = $db-&gt;getTableColumns(hikashop_table('product')); $priceColumns = $db-&gt;getTableColumns(hikashop_table('price')); } $db-&gt;setQuery('SELECT characteristic_value FROM '.hikashop_table('characteristic').' WHERE characteristic_parent_id = 0'); $characteristicColumns = $db-&gt;loadResultArray(); $categoryColumns = array('categories_ordering','parent_category','categories_image','categories'); $otherColumns = array('files','images','related','options'); if(!is_array($characteristicColumns)) $characteristicColumns = array($characteristicColumns); $mergedColumns = array_merge(array_keys($productColumns),array_keys($priceColumns),$categoryColumns,$characteristicColumns,$otherColumns); $wrongColumns = array_diff($columns,$mergedColumns); if(!empty($wrongColumns) &amp;&amp; $check){ if(!$check)$app-&gt;enqueueMessage('WRONG_COLUMNS','error'); $data-&gt;wrongColumns = $wrongColumns; $data-&gt;validColumns = $mergedColumns; $data-&gt;error = 'wrong_columns'; return $data; }elseif($check){ $data-&gt;error = 'valid'; return $data; } // Change the column if the column in the csv is wrong and set in parameters, else delete this column if(isset($element['change']) &amp;&amp; is_array($element['change'])){ foreach($columns as $num =&gt; $column){ foreach($element['change'] as $key =&gt; $value){ if($column == $key &amp;&amp; $value != 'delete'){ $columns[$num] = $value; } elseif($column == $key &amp;&amp; $value == 'delete'){ unset($columns[$num]); } } } } // Get the missing product_code / product_id $pool = array(); $missingIds = array(); $missingCodes = array(); foreach($importLines as $key =&gt; $importLine){ $product = $this-&gt;getProduct($importLines, $key, $numberColumns, $separator); if(!is_array($product)) continue; $newProduct = new stdClass(); foreach($product as $num =&gt; $value){ if(!empty($columns[$num])){ $field = $columns[$num]; if( strpos('&#124;',$field) !== false ) { $field = str_replace('&#124;','__tr__',$field); } //$newProduct-&gt;$field = trim($value,'\'" '); $newProduct-&gt;$field = preg_replace('#^[\'" ]{1}(.*)[\'" ]{1}$#','$1',$value); } } $pool[$key] = new stdClass(); if(isset($newProduct-&gt;product_id)){ $pool[$key]-&gt;product_id = $newProduct-&gt;product_id; } if(isset($newProduct-&gt;product_code)){ $pool[$key]-&gt;product_code = $newProduct-&gt;product_code; } if(!isset($pool[$key]-&gt;product_id) &amp;&amp; !isset($pool[$key]-&gt;product_code)){ continue; } if(!isset($pool[$key]-&gt;product_code)){ $missingCodes[] = $pool[$key]-&gt;product_id; } if(!isset($pool[$key]-&gt;product_id)){ $missingIds[] = $pool[$key]-&gt;product_code; } } $missing = array(); if(!empty($missingCodes)){ $db-&gt;setQuery('SELECT * FROM '.hikashop_table('product').' WHERE product_id IN ('.implode(',',$missingCodes).')'); $missingCodes = $db-&gt;loadObjectList(); } if(!empty($missingIds)){ $db-&gt;setQuery('SELECT * FROM '.hikashop_table('product').' WHERE product_code IN ('.implode(',',$db-&gt;quote($missingIds)).')'); $missingIds = $db-&gt;loadObjectList(); } $errorcount = 0; $importProducts = array(); foreach($importLines as $key =&gt; $importLine){ $product = $this-&gt;getProduct($importLines, $key, $numberColumns, $separator); if(!is_array($product)) continue; $newProduct = new stdClass(); foreach($product as $num =&gt; $value){ if(!empty($columns[$num])){ $field = $columns[$num]; if( strpos('&#124;',$field) !== false ) { $field = str_replace('&#124;','__tr__',$field); } //$newProduct-&gt;$field = trim($value,'\'" '); $newProduct-&gt;$field = preg_replace('#^[\'" ]{1}(.*)[\'" ]{1}$#','$1',$value); } } // need the product code and the product id if(empty($newProduct-&gt;product_id)){ foreach($missingIds as $missingId){ if($newProduct-&gt;product_code == $missingId-&gt;product_code){ $newProduct-&gt;product_id = $missingId-&gt;product_id; } } } if(empty($newProduct-&gt;product_code)){ foreach($missingCodes as $missingCode){ if($newProduct-&gt;product_id == $missingCode-&gt;product_id){ $newProduct-&gt;product_code = $missingCode-&gt;product_code; } } } if(empty($newProduct-&gt;product_code) &#124;&#124; empty($newProduct-&gt;product_id)){ $errorcount++; if($errorcount&lt;20){ if(isset($importLine[$key-1]))$app-&gt;enqueueMessage(JText::sprintf('IMPORT_ERRORLINE',$importLines[$key-1]).' '.JText::_('PRODUCT_NOT_FOUND'),'notice'); }elseif($errorcount == 20){ $app-&gt;enqueueMessage('...','notice'); } }else{ $importProducts[$newProduct-&gt;product_id] = $newProduct; $ids[] = $newProduct-&gt;product_id; } } $data-&gt;ids = $ids; $data-&gt;elements = $importProducts; return $data; }

And the function "onProcessProductMassFiltercsvImport" in "plugins/plg_hikashop_massaction_product/massaction_product.php" by: Code:

function onProcessProductMassFiltercsvImport(&amp;$elements,&amp;$query,$filter,$num){ if(empty($filter['type']) &#124;&#124; $filter['type']=='all') return; if(!isset($this-&gt;massaction))$this-&gt;massaction = hikashop_get('class.massaction'); if(count($elements)){ foreach($elements as $k =&gt; $element){ if($element-&gt;$filter['type']!=$filter['value']) unset($elements[$k]); } }else{ $data = $this-&gt;massaction-&gt;getFromFile($filter); if(empty($data-&gt;ids) &#124;&#124; isset($data-&gt;error)) return false; JArrayHelper::toInteger($data-&gt;ids); $db = JFactory::getDBO(); $productClass = hikashop_get('class.product'); $productClass-&gt;getProducts($data-&gt;ids); // Get all the product code - id - parent_id in the csv $pool = array(); foreach($data-&gt;ids as $i =&gt; $id){ if(!isset($data-&gt;elements[$id]-&gt;product_id) &#124;&#124; !isset($data-&gt;elements[$id]-&gt;product_code) &#124;&#124; !isset($data-&gt;elements[$id]-&gt;product_parent_id)) continue; $pool[$data-&gt;elements[$id]-&gt;product_code] = array(); $pool[$data-&gt;elements[$id]-&gt;product_code]['id'] = $data-&gt;elements[$id]-&gt;product_id; $pool[$data-&gt;elements[$id]-&gt;product_code]['parent_id'] = $data-&gt;elements[$id]-&gt;product_parent_id; } // Get all the missing product parent id $toGet = array(); foreach($data-&gt;ids as $i =&gt; $id){ if(isset($data-&gt;elements[$id]-&gt;product_parent_id) &amp;&amp; $data-&gt;elements[$id]-&gt;product_parent_id != '' &amp;&amp; (int)$data-&gt;elements[$id]-&gt;product_parent_id == 0 &amp;&amp; !in_array($data-&gt;elements[$id]-&gt;product_parent_id,$pool) &amp;&amp; !in_array($data-&gt;elements[$id]-&gt;product_parent_id,$toGet)){ $toGet[] = $data-&gt;elements[$id]-&gt;product_parent_id; } } // Select all the missing product parent id $db-&gt;setQuery('SELECT * FROM '.hikashop_table('product').' WHERE product_code IN (\''.implode('\',\'',$toGet).'\')'); $gets = $db-&gt;loadObjectList(); foreach($gets as $get){ $pool[$get-&gt;product_code]['id'] = $get-&gt;product_id; $pool[$get-&gt;product_code]['parent_id'] = $get-&gt;product_parent_id; } if(!is_array($data-&gt;ids)) $data-&gt;ids = array($data-&gt;ids); foreach($data-&gt;ids as $i =&gt; $id){ if(!isset($data-&gt;elements[$id])) continue; $data-&gt;elements[$id]-&gt;product_id = (int)$data-&gt;elements[$id]-&gt;product_id; if(isset($data-&gt;elements[$id]-&gt;product_type) &amp;&amp; $data-&gt;elements[$id]-&gt;product_type == 'variant' &amp;&amp; (int)$data-&gt;elements[$id]-&gt;product_parent_id == 0){ if(array_key_exists($data-&gt;elements[$id]-&gt;product_parent_id,$pool)){ $data-&gt;elements[$id]-&gt;product_parent_id = $pool[$data-&gt;elements[$id]-&gt;product_parent_id]['id']; }else{ continue; } } $oldElement = $productClass-&gt;all_products[$id]; // Manage the prices if(!empty($data-&gt;elements[$id]-&gt;price_value)){ $data-&gt;elements[$id]-&gt;prices = array(); $price_values = explode('&#124;',$data-&gt;elements[$id]-&gt;price_value); $price_currencies = explode('&#124;',$data-&gt;elements[$id]-&gt;price_currency_id); $price_min_quantities = explode('&#124;',$data-&gt;elements[$id]-&gt;price_min_quantity); $price_accesses = explode('&#124;',$data-&gt;elements[$id]-&gt;price_access); foreach($price_values as $k =&gt; $price_value){ $data-&gt;elements[$id]-&gt;prices[$k] = new stdClass(); $data-&gt;elements[$id]-&gt;prices[$k]-&gt;price_value = $price_value; } foreach($price_currencies as $k =&gt; $price_currency){ if(!is_int($price_currency)){ $db-&gt;setQuery('SELECT currency_id FROM '.hikashop_table('currency').' WHERE currency_code LIKE '.$db-&gt;quote($price_currency)); $price_currency_id = $db-&gt;loadResult(); } $data-&gt;elements[$id]-&gt;prices[$k]-&gt;price_currency_id = $price_currency_id; } foreach($price_min_quantities as $k =&gt; $price_min_quantity){ $data-&gt;elements[$id]-&gt;prices[$k]-&gt;price_min_quantity = $price_min_quantity; } foreach($price_accesses as $k =&gt; $price_access){ $price_access_clean = str_replace(',','',$price_access); $data-&gt;elements[$id]-&gt;prices[$k]-&gt;price_access = $price_access_clean; } } unset($data-&gt;elements[$id]-&gt;price_value); unset($data-&gt;elements[$id]-&gt;price_currency_id); unset($data-&gt;elements[$id]-&gt;price_min_quantity); unset($data-&gt;elements[$id]-&gt;price_access); // Manage the files if(!empty($data-&gt;elements[$id]-&gt;files)){ $newFiles = explode(';',$data-&gt;elements[$id]-&gt;files); $data-&gt;elements[$id]-&gt;files = array(); foreach($newFiles as $k =&gt; $newFile){ $same = 0; foreach($oldElement-&gt;files as $oldFile){ if($oldFile-&gt;file_path == $newFile){ $data-&gt;elements[$id]-&gt;files[] = $oldFile-&gt;file_id; $same = 1; } } if(!empty($newFile) &amp;&amp; $same == 0){ $db-&gt;setQuery('SELECT file_id FROM '.hikashop_table('file').' WHERE file_path LIKE '.$db-&gt;quote($newFile)); $newFileId = $db-&gt;loadResult(); if(!empty($newFileId)) $data-&gt;elements[$id]-&gt;files[] = $newFileId; } } } // Manage the images if(!empty($data-&gt;elements[$id]-&gt;images)){ $newImages = explode(';',$data-&gt;elements[$id]-&gt;images); $data-&gt;elements[$id]-&gt;images = array(); foreach($newImages as $k =&gt; $newImage){ $same = 0; foreach($oldElement-&gt;images as $oldImage){ if(!empty($newImage) &amp;&amp; $oldImage-&gt;file_path == $newImage){ $data-&gt;elements[$id]-&gt;images[] = $oldImage-&gt;file_id; $same = 1; } } if(!empty($newImage) &amp;&amp; $same == 0){ $db-&gt;setQuery('SELECT file_id FROM '.hikashop_table('file').' WHERE file_path LIKE '.$db-&gt;quote($newImage)); $newImageId = $db-&gt;loadResult(); if(!empty($newImageId)) $data-&gt;elements[$id]-&gt;images[] = $newImageId; } } } // Manage the categories if(!empty($data-&gt;elements[$id]-&gt;categories)){ $categories = explode(';',$data-&gt;elements[$id]-&gt;categories); $data-&gt;elements[$id]-&gt;categories = array(); foreach($categories as $category){ $db-&gt;setQuery('SELECT category_id FROM '.hikashop_table('category').' WHERE category_name LIKE '.$db-&gt;quote($category)); $data-&gt;elements[$id]-&gt;categories[] = $db-&gt;loadResult(); } unset($oldElement-&gt;categories); } if(!empty($data-&gt;elements[$id]-&gt;categories_ordering)){ $data-&gt;elements[$id]-&gt;categories_ordering = explode(';',$data-&gt;elements[$id]-&gt;categories_ordering); unset($oldElement-&gt;categories_ordering); } // Manage the relateds if(!empty($data-&gt;elements[$id]-&gt;related)){ $relateds = explode(';',$data-&gt;elements[$id]-&gt;related); $data-&gt;elements[$id]-&gt;related = array(); foreach($relateds as $k =&gt; $related){ $db-&gt;setQuery('SELECT product_id FROM '.hikashop_table('product').' WHERE product_code LIKE '.$db-&gt;quote($related)); $data-&gt;elements[$id]-&gt;related[$k]-&gt;product_related_id = $db-&gt;loadResult(); $data-&gt;elements[$id]-&gt;related[$k]-&gt;product_id = $id; $data-&gt;elements[$id]-&gt;related[$k]-&gt;product_related_ordering = $k; $data-&gt;elements[$id]-&gt;related[$k]-&gt;product_related_type = 'related'; } } // Manage the options if(!empty($data-&gt;elements[$id]-&gt;options)){ $options = explode(';',$data-&gt;elements[$id]-&gt;options); $data-&gt;elements[$id]-&gt;options = array(); foreach($options as $option){ $db-&gt;setQuery('SELECT product_id FROM '.hikashop_table('product').' WHERE product_code LIKE '.$db-&gt;quote($option)); $data-&gt;elements[$id]-&gt;options[$k]-&gt;product_related_id = $db-&gt;loadResult(); $data-&gt;elements[$id]-&gt;options[$k]-&gt;product_id = $id; $data-&gt;elements[$id]-&gt;options[$k]-&gt;product_related_ordering = $k; $data-&gt;elements[$id]-&gt;options[$k]-&gt;product_related_type = 'related'; } } unset($oldElement-&gt;images); unset($oldElement-&gt;files); unset($oldElement-&gt;related); unset($oldElement-&gt;options); // Replace the old values in the oldElement becoming the element foreach($oldElement as $k =&gt; $old){ foreach($data-&gt;elements[$id] as $l =&gt; $new){ if($k == $l){ $oldElement-&gt;$k = $new; } } } $data-&gt;elements[$id] = $oldElement; // Save the elements if checkbox checked if(isset($filter['save'])){ if(isset($data-&gt;elements[$id]-&gt;prices)) $productClass-&gt;updatePrices($data-&gt;elements[$id],$id); if($data-&gt;elements[$id]-&gt;product_type!='variant') $productClass-&gt;updateCategories($data-&gt;elements[$id],$id); if(!empty($data-&gt;elements[$id]-&gt;files)) $productClass-&gt;updateFiles($data-&gt;elements[$id],$id,'files'); if(!empty($data-&gt;elements[$id]-&gt;images)) $productClass-&gt;updateFiles($data-&gt;elements[$id],$id,'images'); if(!empty($data-&gt;elements[$id]-&gt;related)) $productClass-&gt;updateRelated($data-&gt;elements[$id],$id,'related'); if(!empty($data-&gt;elements[$id]-&gt;options)) $productClass-&gt;updateRelated($data-&gt;elements[$id],$id,'options'); // unset all the vars which are not in the product table $db-&gt;setQuery('SHOW columns FROM '.hikashop_table('product')); $cols = $db-&gt;loadObjectList(); $fields = array(); foreach($cols as $col){ $fields[] = $col-&gt;Field; } foreach($data-&gt;elements[$id] as $l =&gt; $content){ if(!in_array($l,$fields)){ unset($data-&gt;elements[$id]-&gt;$l); } } if(isset($data-&gt;elements[$id]-&gt;product_created) &amp;&amp; (int)$data-&gt;elements[$id]-&gt;product_created == 0){ unset($data-&gt;elements[$id]-&gt;product_created); } $data-&gt;elements[$id]-&gt;product_modified = time(); $data-&gt;elements[$id]-&gt;product_width = str_replace($data-&gt;elements[$id]-&gt;product_dimension_unit,'',$data-&gt;elements[$id]-&gt;product_width); $data-&gt;elements[$id]-&gt;product_length = str_replace($data-&gt;elements[$id]-&gt;product_dimension_unit,'',$data-&gt;elements[$id]-&gt;product_length); $data-&gt;elements[$id]-&gt;product_height = str_replace($data-&gt;elements[$id]-&gt;product_dimension_unit,'',$data-&gt;elements[$id]-&gt;product_height); $elements = $data-&gt;elements; // Save the new data of the product $productClass-&gt;save($elements[$id]); } } // Get all the products but the ones in the csv file if($filter['type'] == 'out'){ JArrayHelper::toInteger($data-&gt;ids); $db-&gt;setQuery('SELECT product_id FROM '.hikashop_table('product').' WHERE product_id NOT IN ('.implode(',',$data-&gt;ids).')'); $ids = $db-&gt;loadResultArray(); $productClass = hikashop_get('class.product'); $elements = array(); foreach($ids as $id){ $elements[] = $productClass-&gt;get($id); } } } }

The following user(s) said Thank You: [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 2 months ago [\#126061](#126061) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#126061 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Thank you very much Xavier, that seems to have solved the problem.

First rate support, it is very reassuring to know that you guys will fix any issues so promptly.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 1 month ago -  13 years 1 month ago [\#128924](#128924) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#128924 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

I have run into another problem importing product data from a csv file.

I want to update the product images across the shop as the manufacturer has changed the package designs.

I have a csv file which has two columns 'product_code' and 'images', the images column contains the file names of the new product images all of which have all been copied to the hikashop "uploads" folder.

If I try an import via the Products &#124; Import i get this message that I have complained of before ...

> The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.

The advice previously (see the rest of this topic) was to use the Mass Actions facility which worked with what I was trying to do before but doesn't in this instance.

UPDATE: I have found that importing the csv via mass actions added the product info to the root product category, so it created new products with the product code and image supplied rather than updating the existing products.

Can the issue of importing csv data for variants be fixed please? In other words can the logic that causes the import to be skipped for variants be over ridden because it's not helping!

Many thanks,

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Last edit: 13 years 1 month ago by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile"). Reason: Added update about the result of mass import

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 month ago -  13 years 1 month ago [\#129066](#129066) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#129066 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Hi,

It seems that when we just have "product_code;images" and importing the csv via the product import feature it delete the existing product and create a new one in the main category.

I have added it to debug on our TODO list.

Thanks to try to add the column "product_name" it seems to be working with that column.

Last edit: 13 years 1 month ago by [Xavier](/forum/user/4105-xavier "View Xavier's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 1 month ago -  13 years 1 month ago [\#129117](#129117) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#129117 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Unfortunately I can't use product name as variants take the name of the parent product (several variants with the same name), it's only the product_code that is unique.

Will you make it so that I can update variants as well please?

Thank you.

Ian

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Last edit: 13 years 1 month ago by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 month ago [\#129172](#129172) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#129172 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

And what about using the product_id too ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")**
- [![iedwards's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12400-iedwards "View iedwards's Profile") Topic Author
- [ Offline](/forum/user/12400-iedwards)

Less More

- Posts: 250
- Thank you received: 7
- [](http://www.estm.co.uk)
-

13 years 1 month ago [\#129191](#129191) by [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")  Replied by *[iedwards](/forum/user/12400-iedwards "View iedwards's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#129191 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

The product data comes from the manufacturer who supplies me with the product_code and images but he doesn't know the product_id which is internal to Hikashop.

---

[ Ian Edwards Film Sound Recording](https://estm.co.uk)
[ Alveley Mining Heritage](https://alveleyminingheritage.org)
[ Mary Edwards-Porter - Author](https://www.mary-edwards-porter.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

13 years 1 month ago [\#129652](#129652) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Updating variant product data](/forum/37-import-export-csv-xls/862306-updating-variant-product-data#129652 "All the physical products in my store are represented by variants. I want to use the import system to update variant details, in particular product&#95;width and product&#95;length but will also want to use this to update price.  I have prepared a csv file with product&#95;id and the fields that takes this form ...  product&#95;id,product&#95;width,product&#95;length 110,914.4,9144 111,1066.8,9144 93,1066.8,9144  But when I import I get this message ...  The product is of the type but it already exists in the database and is of the type variant. In order to avoid any problem the product insertion process has been skipped. Please correct its type before trying to reimport it.  There are a number of posts with problems regarding importing variants and the answer seems to be that the parent product has to be included in the csv file but I can't find anything that tells me how. Do I have to add a product&#95;parent&#95;id column to the csv file, or how else does it work?  Many thanks,  Ian")*

Then, instead, you can try to use the normal import of products and add the "product_type" column with the value "variant" for all the entries in your CSV and that will consider them as variants.
I would recommend to do a backup before trying that in case something goes wrong.

The following user(s) said Thank You: [iedwards](/forum/user/12400-iedwards "View iedwards's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjIzMDYtdXBkYXRpbmctdmFyaWFudC1wcm9kdWN0LWRhdGE/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.125 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
