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
AdvancedPricingImportExport
_files
product_with_second_website.php
Go to the documentation of this file.
1
<?php
6
require dirname(dirname(
__DIR__
)) .
'/Store/_files/website.php'
;
7
require
'create_products.php'
;
8
10
$attributeRepository
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
11
->get(
Magento
\Catalog\Api\ProductAttributeRepositoryInterface::class);
12
$groupPriceAttribute
=
$attributeRepository
->get(
'tier_price'
)
13
->setScope(
Magento
\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_WEBSITE);
14
$attributeRepository
->save(
$groupPriceAttribute
);
15
16
$productModel
->setWebsiteIds(array_merge(
$productModel
->getWebsiteIds(), [(int)
$website
->getId()]));
17
$productModel
->setTierPrice(
18
[
19
[
20
'website_id'
=>
$website
->getId(),
21
'cust_group'
=>
\Magento\Customer\Model\Group::CUST_GROUP_ALL
,
22
'price_qty'
=> 3,
23
'price'
=> 5
24
]
25
]
26
);
27
$productModel
->save();
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$website
$website
Definition:
payment_configuration_rollback.php:38
$attributeRepository
$attributeRepository
Definition:
product_with_second_website.php:10
$groupPriceAttribute
$groupPriceAttribute
Definition:
product_with_second_website.php:12
Magento
Magento\Customer\Model\Group\CUST_GROUP_ALL
const CUST_GROUP_ALL
Definition:
Group.php:22
$productModel
$productModel
Definition:
create_products.php:7
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125