Data Feed

Hello,

I have tried Data feed module to create a feed for a product listing directory.

I need to use Enclosure (") and Separator (, or ;).

I have an issue with enclosure on first word of every row.

Attached are some photos of what i have and what i need.

Anyone can help me?

Version CS-Cart 4.7.3 .

ENCL3.png

ENCL2.png

encl1.png

encl.png

Hello.

Please show exported file in raw. E.g. from console. Not from excel.

Robert.

Yes, try to open file in any file editor. Enclosure should be there

No need to add quotes to the field names. If you have the enclosure set then all column (including header row) will have enclosure.

Opening in other file editor is ok for first word of every row, but for header row still remain the only option to put enclosure on field names.

I tried without enclosure on field names, but not work for header.

Another format that i need is:

category | producator | model | cod produs | nume produs | descriere | URL produs | URL imagine | pret | moneda | cost transport | disponibilitate | GTIN (UPC/EAN/ISBN)

How i can use a Pipe "|" as delimitier, i have only Tab, Semicolon and Comma as option ?

Thanks to all.

Then you have something else stripping the enclosure off of the header row. Standard cs-cart will add to header and data rows.

To change the delimiters you can edit design/backend/templates/views/exim/components/csv_delimiters.tpl

Then you have something else stripping the enclosure off of the header row. Standard cs-cart will add to header and data rows.

To change the delimiters you can edit design/backend/templates/views/exim/components/csv_delimiters.tpl

I'm using a standard cs-cart fresh install instance. I'm ok with header, is not hard to add some enclosures to fields.

Also i have tried to add new delimiter, but is not show on delimiters list.

I have cleared cache from panel and from "var" folder but not working.

I have changed design/backend/templates/views/exim/components/csv_delimiters.tpl and /app/functions/fn.exim.php files.

Need to do this from my changes addon?

I don't know how to work with that.

Why did you change distributed files and what changes did you make? Sounds like you have a mess. Include these needs and info about what you’ve changed in your quote request and we’ll try to help you out.

Why did you change distributed files and what changes did you make? Sounds like you have a mess. Include these needs and info about what you've changed in your quote request and we'll try to help you out.

On /app/functions/fn.exim.php i have added:

function fn_exim_get_csv($pattern, $file, $options)
{
$max_line_size = 65536; // 64 Кб
$result = array();
$options = array_merge(array(
'delimiter' => 'C',
'lang_code' => CART_LANGUAGE,
'validate_schema' => true,
'count' => null,
'import_schema' => null,
), $options);
if ($options['delimiter'] == 'C') {
$delimiter = ',';
} elseif ($options['delimiter'] == 'T') {
$delimiter = "\t";
} elseif ($options['delimiter'] == 'P') {
$delimiter = "|";
} else {
$delimiter = ';';
}
function fn_exim_put_csv(&$data, &$options, $enclosure)
{
static $output_started = false;
$eol = "\n";
if ($options['delimiter'] == 'C') {
$delimiter = ',';
} elseif ($options['delimiter'] == 'T') {
$delimiter = "\t";
} elseif ($options['delimiter'] == 'P') {
$delimiter = "|";
} else {
$delimiter = ';';
}

And

design/backend/templates/views/exim/components/csv_delimiters.tpl

{__("semicolon")}
{__("comma")}
{__("tab")}
{__("pipe")}
I have added the code marked with red color.

Okay, all looks good. Classic cs-cart coding of using all those if statements and embedding configuration logic into the code. Should simply be something like:

$delimiter = !empty($options['delimiter']) ? $options['delimiter'] : ',';

And preferred to have a define'DEFAULT_DELIMITER', ',');

Okay, all looks good. Classic cs-cart coding of using all those if statements and embedding configuration logic into the code. Should simply be something like:

$delimiter = !empty($options['delimiter']) ? $options['delimiter'] : ',';

And preferred to have a define'DEFAULT_DELIMITER', ',');

Where i need to change?

Where i need to change?

Your code is correct and should work. If you still face problems, PM me temporary access, we will check

Your code is correct and should work. If you still face problems, PM me temporary access, we will check

Hi,

You need acces to admin panel or FTP?

Thanks !

Hi,

You need acces to admin panel or FTP?

Thanks !

FTP is required to check changed files

FTP is required to check changed files

You have credentials in PM.

Thanks !

Issue was cause by responsive admin module. The correct file which should be changed

design/backend/templates/addons/responsive_admin/overrides/views/exim/components/csv_delimiters.tpl