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-payment
Model
Checks
CanUseForCountry
CountryProvider.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Payment\Model\Checks\CanUseForCountry
;
7
8
use
Magento\Quote\Model\Quote
;
9
use
Magento\Directory\Helper\Data
as DirectoryHelper;
10
19
class
CountryProvider
20
{
24
protected
$directoryHelper
;
25
29
public
function
__construct
(DirectoryHelper
$directoryHelper
)
30
{
31
$this->directoryHelper =
$directoryHelper
;
32
}
33
40
public
function
getCountry
(
Quote
$quote
)
41
{
42
$address
=
$quote
->getBillingAddress() ? :
$quote
->getShippingAddress();
43
return
(!empty(
$address
) && !empty(
$address
->getCountry()))
44
?
$address
->getCountry()
45
: $this->directoryHelper->getDefaultCountry();
46
}
47
}
Magento\Directory\Helper\Data
Definition:
Data.php:17
Magento\Payment\Model\Checks\CanUseForCountry
Definition:
CountryProvider.php:6
Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider\getCountry
getCountry(Quote $quote)
Definition:
CountryProvider.php:40
$quote
$quote
Definition:
paypal_quote.php:17
$address
$address
Definition:
customer.php:38
Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider
Definition:
CountryProvider.php:19
Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider\__construct
__construct(DirectoryHelper $directoryHelper)
Definition:
CountryProvider.php:29
Magento\Quote\Model\Quote
Definition:
AddressTest.php:6
Magento\Framework\DB\Platform\Quote
Definition:
Quote.php:13
Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider\$directoryHelper
$directoryHelper
Definition:
CountryProvider.php:24