diff --git a/Plugin/Model/Import/Product.php b/Plugin/Model/Import/Product.php new file mode 100644 index 0000000..f7f32f5 --- /dev/null +++ b/Plugin/Model/Import/Product.php @@ -0,0 +1,38 @@ + + */ + +namespace Firebear\CustomImportExport\Plugin\Model\Import; + + +class Product +{ + public function aroundCustomChangeData( + \Firebear\ImportExport\Model\Import\Product $model, + \Closure $proceed, + $data + ) { + $mediaAttributes = ['image', 'small_image', 'thumbnail']; + foreach($mediaAttributes as $attribute) { + if (isset($data[$attribute])) { + $data[$attribute . '_label'] = preg_replace('/\W+/','',$data[$attribute]); + } + + } + //get Parameters + error_log(json_encode($model->getParameters())); + + return $proceed($data); + } + + public function aroundCustomBunchesData( + \Firebear\ImportExport\Model\Import\Product $model, + \Closure $proceed, + $data + ) { + error_log(json_encode($data)); + return $proceed($data); + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..997f895 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +Module for customization of Magento 2 - Improved Import / Export extension by FireBear Studio + +You can create plugins for functions from module Import and Export. + +At the moment you can create plugins from Import: + +1. customChangeData($data): changing data whiling saving + +2. customBunchesData($data): changing data whiling saving bunches + +This module will be replenished new features. \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f21d9a4 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name" : "firebear/customimportexport", + "description" : "Customization of Module", + "require" : { + "php" : "~5.5.0|~5.6.0|~7.0.0|~7.1" + }, + "type" : "magento2-module", + "version" : "1.0.0", + "license" : "OSL-3.0", + "autoload" : { + "files" : [ + "registration.php" + ], + "psr-4" : { + "Firebear\\CustomImportExport\\" : "" + } + } +} \ No newline at end of file diff --git a/etc/di.xml b/etc/di.xml new file mode 100644 index 0000000..eddc9c8 --- /dev/null +++ b/etc/di.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/etc/module.xml b/etc/module.xml new file mode 100644 index 0000000..01aa3d5 --- /dev/null +++ b/etc/module.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/registration.php b/registration.php new file mode 100644 index 0000000..37efa67 --- /dev/null +++ b/registration.php @@ -0,0 +1,7 @@ +