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
OfflineShipping
_files
tablerates.php
Go to the documentation of this file.
1
<?php
7
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
8
$resource
=
$objectManager
->get(\
Magento
\Framework\
App
\ResourceConnection::class);
9
$connection
=
$resource
->getConnection();
10
$resourceModel
=
$objectManager
->create(\
Magento
\OfflineShipping\Model\
ResourceModel
\Carrier\Tablerate::class);
11
$entityTable
=
$resourceModel
->getTable(
'shipping_tablerate'
);
12
$data
=
13
[
14
'website_id'
=> 1,
15
'dest_country_id'
=>
'US'
,
16
'dest_region_id'
=> 0,
17
'dest_zip'
=>
'*'
,
18
'condition_name'
=>
'package_qty'
,
19
'condition_value'
=> 1,
20
'price'
=> 10,
21
'cost'
=> 10
22
];
23
$connection
->query(
24
"INSERT INTO {$entityTable} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`,"
25
.
"`condition_value`, `price`, `cost`) VALUES (:website_id, :dest_country_id, :dest_region_id, :dest_zip,"
26
.
" :condition_name, :condition_value, :price, :cost);"
,
27
$data
28
);
Magento\Framework\App
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$connection
$connection
Definition:
tablerates.php:9
$data
$data
Definition:
tablerates.php:12
$objectManager
$objectManager
Definition:
tablerates.php:7
$resourceModel
$resourceModel
Definition:
tablerates.php:10
$resource
$resource
Definition:
tablerates.php:8
Magento
$entityTable
$entityTable
Definition:
tablerates.php:11
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125