diff --git a/app/Models/Product.php b/app/Models/Product.php index ca632d655a..455f75bc9f 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -47,6 +47,8 @@ class Product extends EntityModel 'product_key', 'notes', 'cost', + 'custom_value1', + 'custom_value2', ]; } @@ -59,6 +61,8 @@ class Product extends EntityModel 'product|item' => 'product_key', 'notes|description|details' => 'notes', 'cost|amount|price' => 'cost', + 'custom_value1' => 'custom_value1', + 'custom_value2' => 'custom_value2', ]; } diff --git a/app/Ninja/Import/CSV/ProductTransformer.php b/app/Ninja/Import/CSV/ProductTransformer.php index 22e146e2c9..cdfde4b8f8 100644 --- a/app/Ninja/Import/CSV/ProductTransformer.php +++ b/app/Ninja/Import/CSV/ProductTransformer.php @@ -27,6 +27,8 @@ class ProductTransformer extends BaseTransformer 'product_key' => $this->getString($data, 'product_key'), 'notes' => $this->getString($data, 'notes'), 'cost' => $this->getFloat($data, 'cost'), + 'custom_value1' => $this->getString($data, 'custom_value1'), + 'custom_value2' => $this->getString($data, 'custom_value2'), ]; }); } diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 6a5ca4ac31..7c927660b9 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -651,7 +651,7 @@ class ImportService $this->checkForFile($fileName); $file = file_get_contents($fileName); $data = array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file)); - dd($data); + if (count($data) > 0) { $headers = $data[0];