CSV import - comma in category name

  • Posts: 193
  • Thank you received: 76
9 years 9 months ago #190752

-- 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

$this->_separate($product->categories)

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

2. Categories with numeric names are ignored on import , but I'm not sure if it's bug or expected behavior.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 9 months ago #190770

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 :)
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 or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 3
9 years 8 months ago #194106

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

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

  • Posts: 193
  • Thank you received: 76
9 years 8 months ago #194214

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 :)
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.



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

Attachments:

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 8 months ago #194344

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

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

  • Posts: 344
  • Thank you received: 3
8 years 3 weeks ago #254442

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: 8 years 3 weeks ago by river.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 weeks ago #254444

Hi,

Please read the CSV specifications or the light version in Wikipedia.
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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum