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

#   CSV import - comma in category name

##

- **[korzo](/forum/user/34428-korzo "View korzo's Profile")**
- [![korzo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34428.png)](/forum/user/34428-korzo "View korzo's Profile") Topic Author
- [ Offline](/forum/user/34428-korzo)

Less More

- Posts: 193
- Thank you received: 76
-
-

11 years 9 months ago [\#190752](#190752) by [korzo](/forum/user/34428-korzo "View korzo's Profile")  *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#190752 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")* was created by *[korzo](/forum/user/34428-korzo "View korzo's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

1.When there is comma in category name in column "categories", 2 categories are created.

In administrator\components\com_hikashop\helpers\import.php on line 777 there is call to _separate() method Code:

$this-&gt;_separate($product-&gt;categories)

This method splits content of categories column on any separator from ';',',','&#124;',"\t" instead only on ";".

2.[ Categories with numeric names are ignored on import](http://www.hikashop.com/forum/import-export-csv-xls/874965-importing-categories.html#190749), but I'm not sure if it's bug or expected behavior.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzQ5OTMtY3N2LWltcG9ydC1jb21tYS1pbi1jYXRlZ29yeS1uYW1lP3RtcGw9bWFya2Rvd24=) 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: 86564
- Thank you received: 14311
-
-

11 years 9 months ago [\#190770](#190770) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#190770 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")*

Hi,

Both are normal behaviors.

1. Why would we only do it on semi colons ? People using semi colons in their category names will argue that the splitting should only be done on commas ![:)](/media/kunena/emoticons/3.png ":)")
The solution in that case is to create the category on your website via the interface and use the id of the category instead of its name in your CSV when you need to reference it.

2. When you enter a number, HikaShop considers that you give it the id of a category which already exists on your website.
If you want a category with a number as its name on your website, please create it via the interface and reference its id in your CSV.

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

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

Less More

- Posts: 79
- Thank you received: 3
-
-

11 years 8 months ago [\#194106](#194106) by [pljuarez](/forum/user/34788-pljuarez "View pljuarez's Profile")  Replied by *[pljuarez](/forum/user/34788-pljuarez "View pljuarez's Profile")* on topic *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#194106 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")*

I had same problem some weeks ago and I soved using escape character (\,) instead only comma.
Regards

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

- **[korzo](/forum/user/34428-korzo "View korzo's Profile")**
- [![korzo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34428.png)](/forum/user/34428-korzo "View korzo's Profile") Topic Author
- [ Offline](/forum/user/34428-korzo)

Less More

- Posts: 193
- Thank you received: 76
-
-

11 years 8 months ago [\#194214](#194214) by [korzo](/forum/user/34428-korzo "View korzo's Profile")  Replied by *[korzo](/forum/user/34428-korzo "View korzo's Profile")* on topic *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#194214 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")*

> nicolas wrote: Hi,
>
> Both are normal behaviors.
>
> 1\. Why would we only do it on semi colons ? People using semi colons in their category names will argue that the splitting should only be done on commas ![:)](/media/kunena/emoticons/3.png ":)")
> The solution in that case is to create the category on your website via the interface and use the id of the category instead of its name in your CSV when you need to reference it.
>
> 2\. When you enter a number, HikaShop considers that you give it the id of a category which already exists on your website.
> If you want a category with a number as its name on your website, please create it via the interface and reference its id in your CSV.

Comma is used in category names quite often, at least in my country/language and I considered semicolon as preferred separator because of it's use in export.
Creating categories via web interface is not a solution in case you can't control the format of csv file or if you have hundreds of categories.

As this is probably the edge case and workaround exists, it's not worth to waste time on it.

There is another issue with comma in category names in category explorer.

[ ![Hikashop&#95;demo&#95;-&#95;Administration&#95;-&#95;Categories.jpg](/forum/attachment/22980) ](/forum/attachment/22980 "...Categories.jpg")

In administrator\components\com_hikashop\views\explorer\view.html.php on line 63
JText::_("SHORT,LONG") will return "SHORT".

- [ ![Hikashop&#95;demo&#95;-&#95;Administration&#95;-&#95;Categories.jpg](/forum/attachment/22980) ](/forum/attachment/22980 "...Categories.jpg") [ ](/forum/attachment/22980?download=1 "...Categories.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzQ5OTMtY3N2LWltcG9ydC1jb21tYS1pbi1jYXRlZ29yeS1uYW1lP3RtcGw9bWFya2Rvd24=) 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: 86564
- Thank you received: 14311
-
-

11 years 8 months ago [\#194344](#194344) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#194344 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")*

Thank you for the feedback on that.
We'll fix that glitch with the explorer in the next version.

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

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

10 years 1 week ago -  10 years 1 week ago [\#254442](#254442) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#254442 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")*

So I had sample problem with import of categories.

I did like pljuarez said :

> I had same problem some weeks ago and I soved using escape character (\\,) instead only comma.

and wrote it like this for creating this as one "singel" category

categories
sweaters\, t-shirts\, shorts

works perfect

Last edit: 10 years 1 week ago by [river](/forum/user/9591-river "View river's Profile").

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

10 years 1 week ago [\#254444](#254444) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[CSV import - comma in category name](/forum/3-bug-report/874993-csv-import-comma-in-category-name#254444 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  1.When there is comma in category name in column &quot;categories&quot;, 2 categories are created.  In administrator&#92;components&#92;com&#95;hikashop&#92;helpers&#92;import.php on line 777 there is call to &#95;separate() method  This method splits content of categories column on any separator from ';',',','|',&quot;&#92;t&quot; instead only on &quot;;&quot;.  2., but I'm not sure if it's bug or expected behavior.")*

Hi,

Please read the CSV specifications or the light version in Wikipedia.
[ en.wikipedia.org/wiki/Comma-separated\_values](https://en.wikipedia.org/wiki/Comma-separated_values)

> \* Any field may be quoted (that is, enclosed within double-quote characters). Some fields must be quoted, as specified in following rules.
> \* Fields with embedded commas or double-quote characters must be quoted.

If you do not provide a valid CSV ; the import won't work.
But HikaShop import and export is following the CSV spec.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzQ5OTMtY3N2LWltcG9ydC1jb21tYS1pbi1jYXRlZ29yeS1uYW1lP3RtcGw9bWFya2Rvd24=) 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.074 seconds

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