Model/AbandonedCart/ProgramEnrolment/Interval.php
public function getAbandonedCartProgramEnrolmentWindow($storeId)
    {
        $fromTime = $this->dateTimeFactory->create(
            [
                'time' => 'now',
                'timezone' => new \DateTimezone('UTC')
            ]
        );

        $minutes = (int) $this->helper->getScopeConfig()->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_LOSTBASKET_ENROL_TO_PROGRAM_INTERVAL,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );

        $interval = $this->dateIntervalFactory->create(
            ['interval_spec' => sprintf('PT%sM', $minutes)]
        );

        $fromTime->sub($interval);
        $toTime = clone $fromTime;
        $fromTime->sub($this->dateIntervalFactory->create(['interval_spec' => 'PT5M']));

        return [
            'from' => $fromTime->format('Y-m-d H:i:s'),
            'to' => $toTime->format('Y-m-d H:i:s'),
            'date' => true,
        ];
    }
public function getAbandonedCartProgramEnrolmentWindow($storeId)
    {
        $fromTime = $this->dateTimeFactory->create(
            [
                'time' => 'now',
                'timezone' => new \DateTimezone('UTC')
            ]
        );

        $minutes = (int) $this->helper->getScopeConfig()->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_LOSTBASKET_ENROL_TO_PROGRAM_INTERVAL,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );

        $interval = $this->dateIntervalFactory->create(
            ['interval_spec' => sprintf('PT%sM', $minutes)]
        );

        $fromTime->sub($interval);
        $toTime = clone $fromTime;
        $fromTime->sub($this->dateIntervalFactory->create(['interval_spec' => 'PT5M']));

        return [
            'from' => $fromTime->format('Y-m-d H:i:s'),
            'to' => $toTime->format('Y-m-d H:i:s'),
            'date' => true,
        ];
    }
public function getAbandonedCartProgramEnrolmentWindow ( $ storeId ) { $ fromTime = $ this -> dateTimeFactory -> create ( [ 'time' => 'now' , 'timezone' => new \ DateTimezone ( 'UTC' ) ] ) ; $ minutes = ( int ) $ this -> helper -> getScopeConfig ( ) -> getValue ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_LOSTBASKET_ENROL_TO_PROGRAM_INTERVAL , \ Magento \ Store \ Model \ ScopeInterface :: SCOPE_STORE , $ storeId ) ; $ interval = $ this -> dateIntervalFactory -> create ( [ 'interval_spec' => sprintf ( 'PT%sM' , $ minutes ) ] ) ; $ fromTime -> sub ( $ interval ) ; $ toTime = clone $ fromTime ; $ fromTime -> sub ( $ this -> dateIntervalFactory -> create ( [ 'interval_spec' => 'PT5M' ] ) ) ; return [ 'from' => $ fromTime -> format ( 'Y-m-d H:i:s' ) , 'to' => $ toTime -> format ( 'Y-m-d H:i:s' ) , 'date' => true , ] ; }
Set time window for abandoned cart program enrolments

@param int $storeId

@return array
@throws \Exception
Set time window for abandoned cart program enrolments