オープンカートにCSVインポートプラグインを使用しています。デフォルトでは、列フィールドのいずれかが欠落している製品は完全にスキップされます。とにかく、ファイルを読み取って、すべての空のフィールドを「null」または0に置き換えて、コードに送り返すことができますか?
以下のチェックをスキップすると、読み取り/配置形式でオフセットが発生します。
$fh = fopen($file, 'r');
if(!$fh) die('File no good!');
// Get headings
$headings = fgetcsv($fh, 0, $delim);
$num_cols = count($headings);
$num_rows = 0;
//Read the file as csv
while (($row = fgetcsv($fh, 0, $delim)) !== FALSE) {
//missed product if num columns in this row not the same as num headings
if (count($row) != $num_cols) {
$this->total_items_missed++;
continue;
}
for ($i=0; $i<count($headings); $i++) {
$raw_prod[$headings[$i]] = $row[$i];
}