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_special_price.php
Go to the documentation of this file.
1
<?php
8
$product
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(\
Magento
\Catalog\Model\Product::class);
9
$product
->setTypeId(
'simple'
)
10
->setAttributeSetId(4)
11
->setId(31)
12
->setWebsiteIds([1])
13
->setName(
'Simple Product'
)
14
->setSku(
'simple'
)
15
->setPrice(10)
16
->setMetaTitle(
'meta title'
)
17
->setMetaKeyword(
'meta keyword'
)
18
->setMetaDescription(
'meta description'
)
19
->setVisibility(\
Magento
\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
20
->setStatus(\
Magento
\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
21
->setStockData([
'use_config_manage_stock'
=> 0])
22
->setSpecialPrice(
'5.99'
)
23
->save();
$product
$product
Definition:
product_special_price.php:8
Magento
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125