Hello,
For the CSV Delimiter, is there a way to add a new value/option? Currently tab, semicolon and comma are available.
I would also want to add the pipe characher: “|” (without quotes).
Is there a way to do this?
Thank you.
For me this delimiter is also needed . It is possible to modify the addon's core functionality? Which file generates the CSV?
Its been awhile since this question was asked and looks like it was never answered. Has anyone found away to add a pipe to the product import function?
Currently using version 4.2.x
Thank you.
Untested.
/app/controllers/backend/exim.php
function fn_get_csv($pattern, $file, $options)
{
$max_line_size = 65536; // 64 Úñ
$result = array();
if ($options['delimiter'] == 'C') {
$delimiter = ',';
} elseif ($options['delimiter'] == 'P') {
$delimiter = "|";
} elseif ($options['delimiter'] == 'T') {
$delimiter = "\t";
} else {
$delimiter = ';';
}
and…
function fn_put_csv(&$data, &$options, $enclosure)
{
static $output_started = false;
$eol = "\n";
if ($options['delimiter'] == 'C') {
$delimiter = ',';
} elseif ($options['delimiter'] == 'P') {
$delimiter = "|";
} elseif ($options['delimiter'] == 'T') {
$delimiter = "\t";
} else {
$delimiter = ';';
}
/design/backend/templates/views/exim/components/csv_delimiters.tpl
```php
{__("comma")}
{__("tab")}
{__("pipe")}
```
Thank you for taking a look at this issue. I think you are on to something, but a piece of the puzzle may still be missing. I made the file modifications to the two files you recommended, but when I go to product import functions, the Pipe is still missing. I have cleared both the browser and cs-cart cache with no change.
Sorry Abaco. I don't have a 4.x install to check it. I just knew from previous versions where to look. Are you sure cache was cleared?
Edit: You will need to add the language variable for pipe.
Well apparently I did not do a good job clearing my cache. I did it again and got the _pipe to show up on the selections dropdown. I then added Pipe to the language variable, as suggested, and all appears to be looking correct and working.
The good news is that when I tried to import my csv products with a Pipe delimiter, it worked.
Thank you Tool for your help with this solution!
No problem.
Another tip: If you want a particular delimiter to be default, move it to the top of the list in the csv_delimiters.tpl