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
product_associated.php
Go to the documentation of this file.
1
<?php
7
/* Create simple product */
9
$product
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(\
Magento
\Catalog\Model\Product::class);
10
$product
->setTypeId(
11
'simple'
12
)->setId(
13
1
14
)->setAttributeSetId(
15
4
16
)->setWebsiteIds(
17
[1]
18
)->setName(
19
'Simple Product'
20
)->setSku(
21
'simple'
22
)->setPrice(
23
10
24
)->setWeight(
25
1
26
)->setMetaTitle(
27
'meta title'
28
)->setMetaKeyword(
29
'meta keyword'
30
)->setMetaDescription(
31
'meta description'
32
)->setVisibility(
33
\
Magento
\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
34
)->setStatus(
35
\
Magento
\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
36
)->setStockData(
37
[
'use_config_manage_stock'
=> 1,
'qty'
=> 22,
'is_in_stock'
=> 1]
38
)->save();
$product
$product
Definition:
product_associated.php:9
Magento
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125