EC-CUBE / EC-CUBE/ec-cube

商品CSV出力時の区切り文字を変更

Open
#4,469 4 comments 2 reactions 0 assignees View on GitHub
Status: discussion
Dominant language
PHP
Stars
788
Forks
719
Avg merge
3d 20h
Merged PRs (30d)
45

Description

## 概要(Overview)
デフォルトはカンマ区切り
商品CSVを出力した後、EXCELで開くとカテゴリIDの区切り位置がずれてしまいます。

商品出力したCSVを編集した内容を商品登録でそのままインポートする機能を実装した際に発見しました。
今回は区切り文字を「|」にすることで対応してます。

## 期待する内容(Expect) or 要望 (Requirement)
- 出力したCSVを編集して、そのままインポートできるようにしたい。

## 再現手順(Procedure)
カテゴリIDが4桁以上になった時に発生しました。
カテゴリIDが1122,3344,123の時以下のようになる。
112,233,441,23

### 環境 (environment)
+ EC-CUBE: 4.0.3
+ PHP: 7.3
+ DB:
- MySQL 8.0

## 補足
同じissueに書いてしまって申し訳ないですが、改善したほうが良いかなと気になったことが1点。

CsvImportController.phpでexplodeの区切り文字を指定する際はimplodeと合わせて
`$this->eccubeConfig['eccube_csv_export_multidata_separator']`に統一したほうがいいのではないかと気になりました。

Contributor guide

Open the contributing guide

Research direction

Start by tracing the product CSV export and import flow, including CsvImportController.php and the eccube_csv_export_multidata_separator configuration key mentioned in the issue. Verify how category IDs are serialized and parsed, then test that an exported, edited product CSV can be imported without delimiter shifts and that both paths use the same separator.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.