9 ->create(\
Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory::class);
12 ->create(\
Magento\Catalog\Model\Product::class);
16 ->setAttributeSetId(4)
18 ->setName(
'Unisex green socks')
19 ->setSku(
'green_socks')
22 ->setShortDescription(
"Unisex green socks for some good peoples at one")
28 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
34 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
40 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
46 ->setDescription(
'Unisex <b>green socks</b> for some good peoples at one')
47 ->setMetaTitle(
'green socks metadata')
48 ->setMetaKeyword(
'green,socks,unisex')
49 ->setMetaDescription(
'green socks metadata description')
50 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
51 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
55 'use_config_manage_stock' => 1,
57 'is_qty_decimal' => 0,
62 'previous_group' =>
'text',
68 'price_type' =>
'fixed',
70 'max_characters' => 100,
75 $product->setCanSaveCustomOptions(
true)
82 ->create(\
Magento\Catalog\Model\Product::class);
86 ->setAttributeSetId(4)
88 ->setName(
'White shorts')
89 ->setSku(
'white_shorts')
92 ->setShortDescription(
"Small white shorts for your children")
98 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
104 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
110 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
116 ->setDescription(
'Small <b>white shorts</b> for your children')
117 ->setMetaTitle(
'white shorts for your children metadata')
118 ->setMetaKeyword(
'white,shorts,children')
119 ->setMetaDescription(
'white shorts for your children metadata description')
120 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
121 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
122 ->setCategoryIds([2])
125 'use_config_manage_stock' => 1,
127 'is_qty_decimal' => 0,
132 'previous_group' =>
'text',
138 'price_type' =>
'fixed',
140 'max_characters' => 100,
145 $product->setCanSaveCustomOptions(
true)
147 ->setHasOptions(
true)
152 ->create(\
Magento\Catalog\Model\Product::class);
156 ->setAttributeSetId(4)
158 ->setName(
'Red trousers')
159 ->setSku(
'red_trousers')
162 ->setShortDescription(
"Red pants for men")
168 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
174 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
180 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
186 ->setDescription(
'Red pants for <b>men</b>')
187 ->setMetaTitle(
'Red trousers meta title')
188 ->setMetaKeyword(
'red,trousers,meta,men')
189 ->setMetaDescription(
'Red trousers meta description')
190 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
191 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
192 ->setCategoryIds([2])
195 'use_config_manage_stock' => 1,
197 'is_qty_decimal' => 0,
202 'previous_group' =>
'text',
208 'price_type' =>
'fixed',
210 'max_characters' => 100,
215 $product->setCanSaveCustomOptions(
true)
217 ->setHasOptions(
true)
222 ->create(\
Magento\Catalog\Model\Product::class);
226 ->setAttributeSetId(4)
228 ->setName(
'Blue briefs')
229 ->setSku(
'blue_briefs')
232 ->setShortDescription(
"Blue briefs for Russian men")
238 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
244 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
250 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
256 ->setDescription(
'Blue briefs for <b>men</b>')
257 ->setMetaTitle(
'Blue briefs meta title')
258 ->setMetaKeyword(
'blue,briefs,meta,men')
259 ->setMetaDescription(
'Blue briefs meta description')
260 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
261 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
262 ->setCategoryIds([2])
265 'use_config_manage_stock' => 1,
267 'is_qty_decimal' => 0,
275 ->create(\
Magento\Catalog\Model\Product::class);
279 ->setAttributeSetId(4)
281 ->setName(
'Grey shorts')
282 ->setSku(
'grey_shorts')
285 ->setShortDescription(
"Grey or green shorts for all peoples at one")
291 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
297 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
303 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
309 ->setDescription(
'Grey or green shorts for peoples at <b>one</b>')
310 ->setMetaTitle(
'Grey shorts meta title')
311 ->setMetaKeyword(
'grey,shorts,meta,men')
312 ->setMetaDescription(
'Grey shorts meta description')
313 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
314 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
315 ->setCategoryIds([2])
318 'use_config_manage_stock' => 1,
320 'is_qty_decimal' => 0,
328 ->create(\
Magento\Catalog\Model\Product::class);
332 ->setAttributeSetId(4)
334 ->setName(
'Blue shorts')
335 ->setSku(
'blue_shorts')
338 ->setShortDescription(
"Blue or green shorts for all peoples at one")
344 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
350 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
356 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
362 ->setDescription(
'Blue or green shorts for peoples at <b>one</b>')
363 ->setMetaTitle(
'blue shorts meta title')
364 ->setMetaKeyword(
'blue,shorts,meta,men')
365 ->setMetaDescription(
'blue shorts meta description')
366 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
367 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
368 ->setCategoryIds([2])
371 'use_config_manage_stock' => 1,
373 'is_qty_decimal' => 0,
381 ->create(\
Magento\Catalog\Model\Product::class);
385 ->setAttributeSetId(4)
387 ->setName(
'Red shorts')
388 ->setSku(
'red_shorts')
391 ->setShortDescription(
"Red or green shorts for all peoples at one")
397 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
403 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
409 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
415 ->setDescription(
'Red or green shorts for peoples at <b>one</b>')
416 ->setMetaTitle(
'red shorts meta title')
417 ->setMetaKeyword(
'red,shorts,meta,men')
418 ->setMetaDescription(
'red shorts meta description')
419 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
420 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
421 ->setCategoryIds([2])
424 'use_config_manage_stock' => 1,
426 'is_qty_decimal' => 0,
434 ->create(\
Magento\Catalog\Model\Product::class);
438 ->setAttributeSetId(4)
440 ->setName(
'Yellow shorts')
441 ->setSku(
'yellow_shorts')
444 ->setShortDescription(
"Yellow or green shorts for all peoples at one")
450 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
456 'cust_group' => \
Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
462 'cust_group' => \
Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
468 ->setDescription(
'Yellow or green shorts for peoples at <b>one</b>')
469 ->setMetaTitle(
'yellow shorts meta title')
470 ->setMetaKeyword(
'yellow,shorts,meta,men')
471 ->setMetaDescription(
'yellow shorts meta description')
472 ->setVisibility(\
Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
473 ->setStatus(\
Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
474 ->setCategoryIds([2])
477 'use_config_manage_stock' => 1,
479 'is_qty_decimal' => 0,
static getObjectManager()