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/Ecombricks/InventoryQuote/Plugin/Model/Quote/Item/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/Ecombricks/InventoryQuote/Plugin/Model/Quote/Item/Updater.php
<?php
/**
 * Copyright © eComBricks. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Ecombricks\InventoryQuote\Plugin\Model\Quote\Item;

/**
 * Quote item updater model plugin
 */
class Updater
{
    
    /**
     * Around update
     * 
     * @param \Magento\Quote\Model\Quote\Item\Updater $subject
     * @param \Closure $proceed
     * @param \Magento\Quote\Model\Quote\Item $item
     * @param array $info
     * @throws \Zend\Code\Exception\InvalidArgumentException
     * @return \Magento\Quote\Model\Quote\Item\Updater
     */
    public function aroundUpdate(
        \Magento\Quote\Model\Quote\Item\Updater $subject,
        \Closure $proceed,
        \Magento\Quote\Model\Quote\Item $item,
        array $info
    )
    {
        $result = $proceed($item, $info);
        if (empty($info['source'])) {
            throw new \Zend\Code\Exception\InvalidArgumentException(__('The source is required to update quote item.'));
        }
        if (empty($info['action']) || !empty($info['configured'])) {
            $item->setSourceCode($info['source']);
            $item->getProduct()->setIsSuperMode(true);
            $item->getProduct()->unsSkipCheckRequiredOption();
            $item->checkData();
        }
        return $result;
    }
    
}

Spamworldpro Mini