b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / app / code / Swissup / Firecheckout / Plugin / Helper /
Filename/home/dev2.destoffenstraat.com/app/code/Swissup/Firecheckout/Plugin/Helper/CheckoutData.php
Size1.82 kb
Permissionrwxrwxrwx
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified06-Jun-2022 12:57
Last accessed23-Aug-2025 02:07
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php

namespace Swissup\Firecheckout\Plugin\Helper;

class CheckoutData
{
/**
* @var \Swissup\Firecheckout\Helper\Data
*/
protected $helper;

/**
* @var \Swissup\Firecheckout\Helper\Config\Payment
*/
protected $paymentConfig;

/**
* @param \Swissup\Firecheckout\Helper\Data $helper
* @param \Swissup\Firecheckout\Helper\Config\Payment $paymentConfig
*/
public function __construct(
\Swissup\Firecheckout\Helper\Data $helper,
\Swissup\Firecheckout\Helper\Config\Payment $paymentConfig
) {
$this->helper = $helper;
$this->paymentConfig = $paymentConfig;
}

/**
* Overriden to return true, when onepage checkout is disabled.
*
* This check is used to render header cart actions and subtotal
*
* @param \Magento\Checkout\Helper\Data $subject
* @param boolean $result
* @return boolean
*/
public function afterCanOnepageCheckout(
\Magento\Checkout\Helper\Data $subject,
$result
) {
if ($this->helper->isFirecheckoutEnabled()) {
return true;
}
return $result;
}

/**
* Programmatically move address to payment page if firecheckout config
* wants to show billing address in custom place.
*
* @param mixed $subject
* @param mixed $result
* @return mixed
*/
public function afterIsDisplayBillingOnPaymentMethodAvailable(
$subject,
$result
) {
if (!$this->helper->isOnFirecheckoutPage()) {
// address is already on the payment page
return $result;
}

$value = $this->paymentConfig->getDisplayBillingAddressOn();
$value = str_replace('default-', '', $value); // firecheckout supports default values as well

return (bool) !$value;
}
}