|
| __construct (\Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, PriceCurrencyInterface $priceCurrency, PaymentFailuresInterface $paymentFailures=null) |
|
| getCheckout () |
|
| getQuote () |
|
| formatPrice ($price) |
|
| convertPrice ($price, $format=true) |
|
| canOnepageCheckout () |
|
| getPriceInclTax ($item) |
|
| getSubtotalInclTax ($item) |
|
| getBasePriceInclTax ($item) |
|
| getBaseSubtotalInclTax ($item) |
|
| sendPaymentFailedEmail (\Magento\Quote\Model\Quote $checkout, string $message, string $checkoutType='onepage') |
|
| isAllowedGuestCheckout (\Magento\Quote\Model\Quote $quote, $store=null) |
|
| isContextCheckout () |
|
| isCustomerMustBeLogged () |
|
| isDisplayBillingOnPaymentMethodAvailable () |
|
| __construct (Context $context) |
|
| isModuleOutputEnabled ($moduleName=null) |
|
Checkout default helper
- Author
- Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 20 of file Data.php.
◆ __construct()
- Parameters
-
\Magento\Framework\App\Helper\Context | $context | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Checkout\Model\Session | $checkoutSession | |
\Magento\Framework\Stdlib\DateTime\TimezoneInterface | $localeDate | |
\Magento\Framework\Mail\Template\TransportBuilder | $transportBuilder | |
\Magento\Framework\Translate\Inline\StateInterface | $inlineTranslation | |
PriceCurrencyInterface | $priceCurrency | |
PaymentFailuresInterface | null | $paymentFailures | @codeCoverageIgnore |
Definition at line 72 of file Data.php.
83 $this->_checkoutSession = $checkoutSession;
84 $this->_localeDate = $localeDate;
85 $this->_transportBuilder = $transportBuilder;
89 ->get(PaymentFailuresInterface::class);
90 parent::__construct($context);
◆ _getEmails()
_getEmails |
( |
|
$configPath, |
|
|
|
$storeId |
|
) |
| |
|
protected |
- Parameters
-
string | $configPath | |
null | string | bool | int | Store | $storeId | |
- Returns
- array|false
Definition at line 231 of file Data.php.
233 $data = $this->scopeConfig->getValue(
239 return explode(
',',
$data);
◆ canOnepageCheckout()
Get onepage checkout availability
- Returns
- bool
Definition at line 146 of file Data.php.
148 return (
bool)$this->scopeConfig->getValue(
149 'checkout/options/onepage_checkout_enabled',
◆ convertPrice()
convertPrice |
( |
|
$price, |
|
|
|
$format = true |
|
) |
| |
- Parameters
-
- Returns
- float
Definition at line 134 of file Data.php.
137 ? $this->priceCurrency->convertAndFormat(
$price)
138 : $this->priceCurrency->convert(
$price);
◆ formatPrice()
- Parameters
-
- Returns
- string
Definition at line 119 of file Data.php.
121 return $this->priceCurrency->format(
◆ getBasePriceInclTax()
getBasePriceInclTax |
( |
|
$item | ) |
|
- Parameters
-
- Returns
- float
Definition at line 190 of file Data.php.
192 $qty =
$item->getQty() ?
$item->getQty() : (
$item->getQtyOrdered() ?
$item->getQtyOrdered() : 1);
195 return $this->priceCurrency->round(
$price);
◆ getBaseSubtotalInclTax()
getBaseSubtotalInclTax |
( |
|
$item | ) |
|
- Parameters
-
- Returns
- float
Definition at line 202 of file Data.php.
204 $tax =
$item->getBaseTaxAmount() +
$item->getBaseDiscountTaxCompensation();
◆ getCheckout()
Retrieve checkout session model
- Returns
- \Magento\Checkout\Model\Session @codeCoverageIgnore
Definition at line 99 of file Data.php.
◆ getPriceInclTax()
Get sales item (quote item, order item etc) price including tax based on row total and tax amount
- Parameters
-
\Magento\Framework\DataObject | $item | |
- Returns
- float
Definition at line 160 of file Data.php.
162 if (
$item->getPriceInclTax()) {
163 return $item->getPriceInclTax();
165 $qty =
$item->getQty() ?
$item->getQty() : (
$item->getQtyOrdered() ?
$item->getQtyOrdered() : 1);
168 return $this->priceCurrency->round(
$price);
◆ getQuote()
Retrieve checkout quote model object
- Returns
- \Magento\Quote\Model\Quote @codeCoverageIgnore
Definition at line 110 of file Data.php.
◆ getSubtotalInclTax()
getSubtotalInclTax |
( |
|
$item | ) |
|
Get sales item (quote item, order item etc) row total price including tax
- Parameters
-
\Magento\Framework\DataObject | $item | |
- Returns
- float
Definition at line 177 of file Data.php.
179 if (
$item->getRowTotalInclTax()) {
180 return $item->getRowTotalInclTax();
182 $tax =
$item->getTaxAmount() +
$item->getDiscountTaxCompensation();
◆ isAllowedGuestCheckout()
Check is allowed Guest Checkout Use config settings and observer
- Parameters
-
\Magento\Quote\Model\Quote | $quote | |
int | Store | $store | |
- Returns
- bool
Definition at line 252 of file Data.php.
257 $guestCheckout = $this->scopeConfig->isSetFlag(
258 self::XML_PATH_GUEST_CHECKOUT,
263 if ($guestCheckout ==
true) {
264 $result = new \Magento\Framework\DataObject();
265 $result->setIsAllowed($guestCheckout);
266 $this->_eventManager->dispatch(
267 'checkout_allow_guest',
271 $guestCheckout =
$result->getIsAllowed();
274 return $guestCheckout;
◆ isContextCheckout()
Check if context is checkout
- Returns
- bool @codeCoverageIgnore
Definition at line 283 of file Data.php.
285 return $this->_request->getParam(
'context') ==
'checkout';
◆ isCustomerMustBeLogged()
isCustomerMustBeLogged |
( |
| ) |
|
Check if user must be logged during checkout process
- Returns
- boolean @codeCoverageIgnore
Definition at line 294 of file Data.php.
296 return $this->scopeConfig->isSetFlag(
297 self::XML_PATH_CUSTOMER_MUST_BE_LOGGED,
◆ isDisplayBillingOnPaymentMethodAvailable()
isDisplayBillingOnPaymentMethodAvailable |
( |
| ) |
|
Checks if display billing address on payment method is available, otherwise billing address should be display on payment page
- Returns
- bool
Definition at line 307 of file Data.php.
309 return (
bool) !$this->scopeConfig->getValue(
310 'checkout/options/display_billing_address_on',
◆ sendPaymentFailedEmail()
Send email id payment was failed
- Parameters
-
\Magento\Quote\Model\Quote | $checkout | |
string | $message | |
string | $checkoutType | |
- Returns
- $this
Definition at line 216 of file Data.php.
221 $this->paymentFailures->handle((
int)$checkout->getId(),
$message, $checkoutType);
◆ $_checkoutSession
◆ $_localeDate
◆ $_storeManager
◆ $_transportBuilder
◆ $inlineTranslation
◆ $priceCurrency
◆ XML_PATH_CUSTOMER_MUST_BE_LOGGED
const XML_PATH_CUSTOMER_MUST_BE_LOGGED = 'checkout/options/customer_must_be_logged' |
◆ XML_PATH_GUEST_CHECKOUT
const XML_PATH_GUEST_CHECKOUT = 'checkout/options/guest_checkout' |
The documentation for this class was generated from the following file:
- vendor/magento/module-checkout/Helper/Data.php