Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/colissimo/module-shipping/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/colissimo/module-shipping/Model/ColissimoConfigProvider.php
<?php
/**
 * Colissimo Shipping Module
 *
 * @author    Magentix
 * @copyright Copyright © 2018 Magentix. All rights reserved.
 * @license   https://www.magentix.fr/en/licence.html Magentix Software Licence
 * @link      https://colissimo.magentix.fr/
 */
namespace Colissimo\Shipping\Model;

use Colissimo\Shipping\Model\Carrier\Colissimo;
use Colissimo\Shipping\Helper\Data as ShippingHelper;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Checkout\Model\Session;
use Magento\Quote\Api\Data\AddressExtensionFactory;
use Magento\Store\Model\ScopeInterface;

/**
 * Class ColissimoConfigProvider
 */
class ColissimoConfigProvider implements ConfigProviderInterface
{

    /**
     * @var ScopeConfigInterface
     */
    protected $scopeConfig;

    /**
     * @var StoreManagerInterface $storeManager
     */
    protected $storeManager;

    /**
     * @var Session $checkoutSession
     */
    protected $checkoutSession;

    /**
     * @var Address $address
     */
    protected $address;

    /**
     * @var AddressExtensionFactory $addressExtensionFactory
     */
    protected $addressExtensionFactory;

    /**
     * @param Address $address
     * @param AddressExtensionFactory $addressExtensionFactory
     * @param Session $checkoutSession
     * @param ScopeConfigInterface $scopeConfig
     * @param StoreManagerInterface $storeManager
     */
    public function __construct(
        Address $address,
        AddressExtensionFactory $addressExtensionFactory,
        Session $checkoutSession,
        ScopeConfigInterface $scopeConfig,
        StoreManagerInterface $storeManager
    ) {
        $this->address          = $address;
        $this->checkoutSession  = $checkoutSession;
        $this->scopeConfig      = $scopeConfig;
        $this->storeManager     = $storeManager;
        $this->addressExtensionFactory = $addressExtensionFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function getConfig()
    {
        /** @var \Magento\Store\Model\Store $store */
        $store = $this->storeManager->getStore();

        $output = [
            'colissimoUrl'    => $store->getUrl('colissimo'),
            'colissimoPickup' => Colissimo::SHIPPING_CARRIER_PICKUP_METHOD,
            'colissimoMapType' => $this->scopeConfig->getValue(
                ShippingHelper::COLISSIMO_CONFIG_PREFIX . 'pickup/map_type',
                ScopeInterface::SCOPE_STORE
            ),
            'colissimoOpen'   => $this->scopeConfig->getValue(
                ShippingHelper::COLISSIMO_CONFIG_PREFIX . 'pickup/open',
                ScopeInterface::SCOPE_STORE
            ),
            'colissimoRemoveOnShippingSelection' => $this->scopeConfig->isSetFlag(
                ShippingHelper::COLISSIMO_CONFIG_PREFIX . 'pickup/remove_selection',
                ScopeInterface::SCOPE_STORE
            ),
        ];

        return $output;
    }
}

Spamworldpro Mini