<?php
namespace VendorCustomImportModelSourceImportBehavior;
use MagentoImportExportModelImport;
class Basic extends MagentoImportExportModelSourceImportBehaviorBasic
{
public function toArray()
{
return [
Import::BEHAVIOR_APPEND => __('Add/Update'),
Import::BEHAVIOR_DELETE => __('Delete')
];
}
public function getCode()
{
return 'promotion_price'; // add your entity name
}
}
3
Answers
So, found the answer
YourVendorNameYourModuleNameModelSourceImportBehavior
in the funtion _toArray() I commented out the Append Option
In your import.xml change the path from the magento path to your new Basic.php file.
<entity name="import_custom" label="Custom Import - Product Price Matrix" model="YourVendorNameYourModuleNameModelImportCustomImport" behaviorModel="YourVendorNameYourModuleNameModelSourceImportBehaviorBasic" />
Regards Brendan
Enter Below code custom behaviorModel class file of your custom module.
for example :
VendorNameYourModuleNameModelSourceImportBehaviorBasic.php
Please note you can take any string except “custom”;
Both
toArray
andgetCode
function needs to be modified in custom behavior file. Here is the complete solution.etc/import.xml
Vendor/CustomImport/Model/Source/Import/Behavior/Basic.php