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
Tax
_files
order_with_tax.php
Go to the documentation of this file.
1
<?php
7
require
__DIR__
.
'/../../../Magento/Sales/_files/order.php'
;
8
9
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
11
$order
=
$objectManager
->create(\
Magento
\Sales\Model\Order::class);
12
$order
->loadByIncrementId(
'100000001'
)->setBaseToGlobalRate(2)->save();
13
15
$tax
=
$objectManager
->create(\
Magento
\Tax\Model\Sales\Order\Tax::class);
16
$tax
->setData(
17
[
18
'order_id'
=>
$order
->getId(),
19
'code'
=>
'tax_code'
,
20
'title'
=>
'Tax Title'
,
21
'hidden'
=> 0,
22
'percent'
=> 10,
23
'priority'
=> 1,
24
'position'
=> 1,
25
'amount'
=> 10,
26
'base_amount'
=> 10,
27
'process'
=> 1,
28
'base_real_amount'
=> 10,
29
]
30
);
31
$tax
->save();
$objectManager
$objectManager
Definition:
order_with_tax.php:9
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$tax
$tax
Definition:
order_with_tax.php:15
$order
$order
Definition:
order_with_tax.php:11
Magento
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125