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
module-usps
Model
Source
Generic.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Usps\Model\Source
;
7
8
use
Magento\Shipping\Model\Carrier\Source\GenericInterface
;
9
use
Magento\Usps\Model\Carrier
;
10
14
class
Generic
implements
GenericInterface
15
{
19
protected
$shippingUsps
;
20
26
protected
$code
=
''
;
27
31
public
function
__construct
(
Carrier
$shippingUsps
)
32
{
33
$this->shippingUsps =
$shippingUsps
;
34
}
35
41
public
function
toOptionArray
()
42
{
43
$options
= [];
44
$codes = $this->shippingUsps->getCode($this->code);
45
if
($codes) {
46
foreach
($codes as
$code
=>
$title
) {
47
$options
[] = [
'value'
=>
$code
,
'label'
=>
__
(
$title
)];
48
}
49
}
50
return
$options
;
51
}
52
}
$title
$title
Definition:
default.phtml:14
Magento\Usps\Model\Source\Generic\__construct
__construct(Carrier $shippingUsps)
Definition:
Generic.php:31
Magento\Usps\Model\Source\Generic\$shippingUsps
$shippingUsps
Definition:
Generic.php:19
Magento\Usps\Model\Source
Definition:
Container.php:6
__
__()
Definition:
__.php:13
Magento\Usps\Model\Source\Generic\$code
$code
Definition:
Generic.php:26
Magento\Usps\Model\Carrier
Definition:
Carrier.php:22
Magento\Shipping\Model\Carrier\Source\GenericInterface
Definition:
GenericInterface.php:13
Magento\Usps\Model\Source\Generic\toOptionArray
toOptionArray()
Definition:
Generic.php:41
$options
$options
Definition:
multiple_mixed_products.php:29
Magento\Usps\Model\Source\Generic
Definition:
Generic.php:14