Skip to content

Commit 9cae946

Browse files
author
Klymenko, Volodymyr(vklymenko)
committed
Merge pull request magento#43 from magento-dragons/MAGETWO-42756
MAGETWO-42756 [Sample Data] Error during configurable product import
2 parents fb41d4b + b2ed451 commit 9cae946

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#Introduction
2+
3+
Magento sample data uses the responsive Luma theme to display a sample store, complete with products, categories, promotional price rules, CMS pages, banners, and so on. You can use the sample data to come up to speed quickly and see the power and flexibility of the Magento storefront.
4+
5+
Installing sample data is optional; you can install it before or after you install the Magento software.
6+
7+
#Deployment
8+
9+
##From Composer
10+
To deploy sample data from Composer, use:
11+
12+
1. In your composer.json, specify the following:
13+
- repository:
14+
```
15+
{
16+
"repositories": [
17+
{
18+
"type": "composer",
19+
"url": "http://packages.magento.com/"
20+
}
21+
],
22+
}
23+
```
24+
25+
- packages:
26+
```
27+
{
28+
"require": {
29+
"magento/sample-data": "{version}"
30+
}
31+
}
32+
```
33+
34+
where version is either an exact version or semantic version syntax.
35+
2. From your Magento root directory, run composer update.
36+
37+
##From repository
38+
To deploy sample data from repository, use:
39+
40+
1. Clone the sample data repository. For example, git clone [https://github.com/magento/magento2-sample-data.git](https://github.com/magento/magento2-sample-data.git)
41+
2. Link the sample data repository with your Magento CE repository as follows:
42+
```
43+
php -f <sample-data-root>/dev/tools/build-sample-data.php -- --ce-source="path/to/magento/ce/edition"
44+
```
45+
46+
#Installation
47+
48+
Once deployed, the sample data can be installed using the Magento Setup Wizard (web installation) or using CLI (console installation).
49+
50+
###Web Installation
51+
52+
When installing the Magento application using the Magento Setup Wizard, you can choose to install the sample data at Step 4. Customize Your Store by selecting the *Use Sample Data* check box.
53+
54+
###Console Installation
55+
56+
The steps required to install sample data are different depending on whether the Magento application itself is installed:
57+
58+
- If the Magento application is not installed, you can install it with sample data at once. Use the following code sample as an example:
59+
```
60+
php -f index.php install --base-url=http://localhost/magento2/ \
61+
--backend-frontname=admin \
62+
--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \
63+
--admin-firstname=Magento --admin-lastname=User --admin-email=[email protected] \
64+
--admin-user=admin --admin-password=iamtheadmin --language=en_US \
65+
--currency=USD --timezone=America/Chicago
66+
--use-sample-data
67+
```
68+
- If the Magento application is already installed, to install the sample data, enter the following commands in the order shown:
69+
```
70+
<path to Magento 2 bin dir>/magento setup:upgrade
71+
<path to Magento 2 bin dir>/magento sampledata:install <your Magento administrator user name>
72+
```
73+
74+
For example,
75+
```
76+
/var/www/magento2/bin magento setup:upgrade
77+
/var/www/magento2/bin magento sampledata:install admin
78+
```
79+
80+
#Removing Sample Data
81+
82+
There are no special scripts that assist in uninstalling of sample data.
83+
To remove sample data, you must delete the database and re-install Magento with a new empty database

app/code/Magento/SampleData/Module/ConfigurableProduct/Setup/Product.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
use Magento\SampleData\Model\SetupInterface;
99
use Magento\Framework\App\Filesystem\DirectoryList;
10+
use Magento\ImportExport\Model\Import;
11+
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
1012

1113
/**
1214
* Setup configurable product
@@ -78,7 +80,9 @@ public function run()
7880
[
7981
'entity' => 'catalog_product',
8082
'behavior' => 'append',
81-
'import_images_file_dir' => 'pub/media/catalog/product'
83+
'import_images_file_dir' => 'pub/media/catalog/product',
84+
Import::FIELD_NAME_VALIDATION_STRATEGY =>
85+
ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS
8286
]
8387
);
8488

0 commit comments

Comments
 (0)