Import csv data

How can I import data from an Excel or CSV file when the field does not exist in the model or database table? But still, i need to keep the custom field in import csv file because i am using that field for my internal calculations and rectifying records. so that field is not to be imported into the table . Here, my custom field is sku . I have shared my code in the attachment.
1 Reply
Sourabh
SourabhOP4mo ago
I have resolved it by unset $this->data['sku'];
<?php
public function resolveRecord(): ?ProductVariant
{
// Code here

unset($this->data['sku']);

return $productVariant;

}?>
<?php
public function resolveRecord(): ?ProductVariant
{
// Code here

unset($this->data['sku']);

return $productVariant;

}?>
Want results from more Discord servers?
Add your server