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/app/code/Cnc/Chronorelais/Plugin/Block/Adminhtml/Sales/Shipment/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/app/code/Cnc/Chronorelais/Plugin/Block/Adminhtml/Sales/Shipment/Ajax.php
<?php
declare(strict_types=1);

namespace Cnc\Chronorelais\Plugin\Block\Adminhtml\Sales\Shipment;

use Chronopost\Chronorelais\Block\Adminhtml\Sales\Shipment\Ajax as Subject;
use Chronopost\Chronorelais\Helper\Data as HelperData;

class Ajax
{
    /**
     * @var HelperData
     */
    private $chronopostHelper;

    /**
     * @param HelperData $chronopostHelper
     */
    public function __construct(HelperData $chronopostHelper)
    {
        $this->chronopostHelper = $chronopostHelper;
    }

    /**
     * Prevent additional dimensions fields display for non Chronopost Shipping.
     *
     * @param Subject $subject
     * @param callable $proceed
     * @return string
     */
    public function aroundToHtml(Subject $subject, callable $proceed): string
    {
        $shippingMethod = explode('_', $subject->getOrder()->getData('shipping_method'));
        $shippingMethodCode = $shippingMethod[1] ?? $shippingMethod[0];

        if (!$this->chronopostHelper->isChronoMethod($shippingMethodCode)) {
            return '';
        }

        return $proceed();
    }
}

Spamworldpro Mini