controller/frontend/src/Controller/Frontend/Basket/Base.php
protected function createSubscriptions( \Aimeos\MShop\Order\Item\Base\Iface $basket )
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'subscription' );

		foreach( $basket->getProducts() as $orderProduct )
		{
			if( ( $interval = $orderProduct->getAttribute( 'interval', 'config' ) ) !== null )
			{
				$item = $manager->createItem()->setInterval( $interval )
					->setOrderProductId( $orderProduct->getId() )
					->setOrderBaseId( $basket->getId() );

				if( ( $end = $orderProduct->getAttribute( 'intervalend', 'custom' ) ) !== null
					|| ( $end = $orderProduct->getAttribute( 'intervalend', 'config' ) ) !== null
					|| ( $end = $orderProduct->getAttribute( 'intervalend', 'hidden' ) ) !== null
				) {
					$item = $item->setDateEnd( $end );
				}

				$manager->saveItem( $item, false );
			}
		}
	}
protected function createSubscriptions( \Aimeos\MShop\Order\Item\Base\Iface $basket )
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'subscription' );

		foreach( $basket->getProducts() as $orderProduct )
		{
			if( ( $interval = $orderProduct->getAttribute( 'interval', 'config' ) ) !== null )
			{
				$item = $manager->createItem()->setInterval( $interval )
					->setOrderProductId( $orderProduct->getId() )
					->setOrderBaseId( $basket->getId() );

				if( ( $end = $orderProduct->getAttribute( 'intervalend', 'custom' ) ) !== null
					|| ( $end = $orderProduct->getAttribute( 'intervalend', 'config' ) ) !== null
					|| ( $end = $orderProduct->getAttribute( 'intervalend', 'hidden' ) ) !== null
				) {
					$item = $item->setDateEnd( $end );
				}

				$manager->saveItem( $item, false );
			}
		}
	}
protected function createSubscriptions ( \ Aimeos \ MShop \ Order \ Item \ Base \ Iface $ basket ) { $ manager = \ Aimeos \ MShop :: create ( $ this -> getContext ( ) , 'subscription' ) ; foreach ( $ basket -> getProducts ( ) as $ orderProduct ) { if ( ( $ interval = $ orderProduct -> getAttribute ( 'interval' , 'config' ) ) !== null ) { $ item = $ manager -> createItem ( ) -> setInterval ( $ interval ) -> setOrderProductId ( $ orderProduct -> getId ( ) ) -> setOrderBaseId ( $ basket -> getId ( ) ) ; if ( ( $ end = $ orderProduct -> getAttribute ( 'intervalend' , 'custom' ) ) !== null || ( $ end = $ orderProduct -> getAttribute ( 'intervalend' , 'config' ) ) !== null || ( $ end = $ orderProduct -> getAttribute ( 'intervalend' , 'hidden' ) ) !== null ) { $ item = $ item -> setDateEnd ( $ end ) ; } $ manager -> saveItem ( $ item , false ) ; } } }
Creates the subscription entries for the ordered products with interval attributes

@param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object
Creates the subscription entries for the ordered products with interval attributes