-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 618d57b
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* @copyright: Copyright © 2018 Firebear Studio. All rights reserved. | ||
* @author : Firebear Studio <[email protected]> | ||
*/ | ||
|
||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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\\" : "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* @copyright: Copyright © 2018 Firebear Studio. All rights reserved. | ||
* @author : Firebear Studio <[email protected]> | ||
*/ | ||
--> | ||
|
||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<type name="Firebear\ImportExport\Model\Import\Product"> | ||
<plugin name="firebear_importexport_custom_product" type="Firebear\CustomImportExport\Plugin\Model\Import\Product" /> | ||
</type> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* @copyright: Copyright © 2018 Firebear Studio. All rights reserved. | ||
* @author : Firebear Studio <[email protected]> | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> | ||
<module name="Firebear_CustomImportExport" setup_version="1.0.0" /> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
\Magento\Framework\Component\ComponentRegistrar::register( | ||
\Magento\Framework\Component\ComponentRegistrar::MODULE, | ||
'Firebear_CustomImportExport', | ||
__DIR__ | ||
); |