Skip to content

Commit

Permalink
fix document item type import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CihanSenturk committed Jun 4, 2023
1 parent badeb55 commit 52b3faf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Traits/Import.php
Expand Up @@ -323,8 +323,10 @@ public function getContactIdFromName($row, $type)
return $contact->id;
}

public function getItemIdFromName($row, $type = 'product')
public function getItemIdFromName($row, $type = null)
{
$type = !empty($type) ? $type : (!empty($row['item_type']) ? $row['item_type'] : 'product');

$item_id = Item::type($type)->where('name', $row['item_name'])->pluck('id')->first();

if (!empty($item_id)) {
Expand Down

0 comments on commit 52b3faf

Please sign in to comment.