Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
Catalog
_files
second_product_simple.php
Go to the documentation of this file.
1
<?php
8
$product2
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
9
->create(\
Magento
\Catalog\Model\Product::class);
10
$product2
11
->setTypeId(
'simple'
)
12
->setId(6)
13
->setAttributeSetId(4)
14
->setWebsiteIds([1])
15
->setName(
'Simple Product2'
)
16
->setSku(
'simple2'
)
17
->setPrice(10)
18
->setMetaTitle(
'meta title2'
)
19
->setMetaKeyword(
'meta keyword2'
)
20
->setMetaDescription(
'meta description2'
)
21
->setVisibility(\
Magento
\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
22
->setStatus(\
Magento
\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
23
->setStockData([
'use_config_manage_stock'
=> 0])
24
->save();
Magento
$product2
$product2
Definition:
second_product_simple.php:8
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125