Skip to content

Commit

Permalink
add files
Browse files Browse the repository at this point in the history
  • Loading branch information
graffov87 committed Mar 26, 2018
0 parents commit 618d57b
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Plugin/Model/Import/Product.php
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);
}
}
11 changes: 11 additions & 0 deletions README.md
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.
18 changes: 18 additions & 0 deletions composer.json
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\\" : ""
}
}
}
13 changes: 13 additions & 0 deletions etc/di.xml
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>
10 changes: 10 additions & 0 deletions etc/module.xml
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>
7 changes: 7 additions & 0 deletions registration.php
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__
);

0 comments on commit 618d57b

Please sign in to comment.