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/Magecomp/Savecartpro/Helper/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/app/code/Magecomp/Savecartpro/Helper/Data.php
<?php
namespace Magecomp\Savecartpro\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;
use Magento\Checkout\Model\Session;

class Data extends AbstractHelper
{
    /**
     * @var ScopeConfigInterface
     */
    protected $scopeConfig;
	protected $cartsession;
    public function __construct(Context $context, 
		Session $session)
    {
		$this->cartsession = $session;
        parent::__construct($context);
    }

	public function IsActive()
	{
		return $this->scopeConfig->getValue('savecart/general/enable', ScopeInterface::SCOPE_STORE);	
	}
	
	public function IsCartWithSimpleItems()
	{
		$visitems = $this->cartsession->getQuote()->getAllVisibleItems();
		foreach($visitems as $item)
		{
			if($item->getProductType() != 'simple')
			{
				return 0;
			}
		}
		return 1;
	}

	public function getEmailTemplate() {
        return $this->scopeConfig->getValue('savecartpro/general/templateemail', ScopeInterface::SCOPE_STORE);
    }

    public function getEmailSender()
    {
        return $this->scopeConfig->getValue('savecartpro/general/sender_email_identity', ScopeInterface::SCOPE_STORE);
    }

    public function generateRandomString()
    {
        try{
            $randomString  = substr(str_shuffle("0123456789"), 0, 3);
            return $randomString;
        }
        catch(\Exception $e) {
        }
    }
}

Spamworldpro Mini