Issues with custom import of orders

I am following the tutorial Create a custom import entity . However, instead of importing learning courses as shown in the tutorial, I’m attempting to import orders.

To adapt the tutorial for orders, I made the following changes:

- const TABLE = 'learning_courses'; + const TABLE = 'sales_order'; and “` – protected $validColumnNames = [ ‘entity_id’, ‘name’, ‘duration’ ];

  • protected $validColumnNames = [ ‘entity_id’, ‘state’, ‘status’, ‘coupon_code’,…]; “`

After making these changes, I encountered an issue where the $bunch variable still holds the old CSV data, even when using a CSV file adapted to the sales_order attributes: $bunch = $this->_dataSourceModel->getNextBunch()

i tried adding $this->_dataSourceModel->cleanProcessedBunches(); before the while loop, this change successfully updates the data for the first iteration, but subsequently, the back office freezes.

I would appreciate any insights or suggestions on how to resolve this issue.

submitted by /u/reddituser6o
[link] [comments]