controller/jobs/src/Controller/Jobs/Customer/Email/Watch/Standard.php
protected function getProductList( array $products, array $listItems )
	{
		$result = [];
		$priceManager = \Aimeos\MShop::create( $this->getContext(), 'price' );

		foreach( $listItems as $id => $listItem )
		{
			try
			{
				$refId = $listItem->getRefId();
				$config = $listItem->getConfig();

				if( isset( $products[$refId] ) )
				{
					$prices = $products[$refId]->getRefItems( 'price', 'default', 'default' );
					$currencyId = ( isset( $config['currency'] ) ? $config['currency'] : null );

					$price = $priceManager->getLowestPrice( $prices, 1, $currencyId );

					if( isset( $config['stock'] ) && $config['stock'] == 1 ||
						isset( $config['price'] ) && $config['price'] == 1 &&
						isset( $config['pricevalue'] ) && $config['pricevalue'] > $price->getValue()
					) {
						$result[$id]['item'] = $products[$refId];
						$result[$id]['currencyId'] = $currencyId;
						$result[$id]['price'] = $price;
					}
				}
			}
			catch( \Exception $e ) { ; } // no price available
		}

		return $result;
	}
protected function getProductList( array $products, array $listItems )
	{
		$result = [];
		$priceManager = \Aimeos\MShop::create( $this->getContext(), 'price' );

		foreach( $listItems as $id => $listItem )
		{
			try
			{
				$refId = $listItem->getRefId();
				$config = $listItem->getConfig();

				if( isset( $products[$refId] ) )
				{
					$prices = $products[$refId]->getRefItems( 'price', 'default', 'default' );
					$currencyId = ( isset( $config['currency'] ) ? $config['currency'] : null );

					$price = $priceManager->getLowestPrice( $prices, 1, $currencyId );

					if( isset( $config['stock'] ) && $config['stock'] == 1 ||
						isset( $config['price'] ) && $config['price'] == 1 &&
						isset( $config['pricevalue'] ) && $config['pricevalue'] > $price->getValue()
					) {
						$result[$id]['item'] = $products[$refId];
						$result[$id]['currencyId'] = $currencyId;
						$result[$id]['price'] = $price;
					}
				}
			}
			catch( \Exception $e ) { ; } // no price available
		}

		return $result;
	}
protected function getProductList ( array $ products , array $ listItems ) { $ result = [ ] ; $ priceManager = \ Aimeos \ MShop :: create ( $ this -> getContext ( ) , 'price' ) ; foreach ( $ listItems as $ id => $ listItem ) { try { $ refId = $ listItem -> getRefId ( ) ; $ config = $ listItem -> getConfig ( ) ; if ( isset ( $ products [ $ refId ] ) ) { $ prices = $ products [ $ refId ] -> getRefItems ( 'price' , 'default' , 'default' ) ; $ currencyId = ( isset ( $ config [ 'currency' ] ) ? $ config [ 'currency' ] : null ) ; $ price = $ priceManager -> getLowestPrice ( $ prices , 1 , $ currencyId ) ; if ( isset ( $ config [ 'stock' ] ) && $ config [ 'stock' ] == 1 || isset ( $ config [ 'price' ] ) && $ config [ 'price' ] == 1 && isset ( $ config [ 'pricevalue' ] ) && $ config [ 'pricevalue' ] > $ price -> getValue ( ) ) { $ result [ $ id ] [ 'item' ] = $ products [ $ refId ] ; $ result [ $ id ] [ 'currencyId' ] = $ currencyId ; $ result [ $ id ] [ 'price' ] = $ price ; } } } catch ( \ Exception $ e ) { ; } // no price available } return $ result ; }
Returns a filtered list of products for which a notification should be sent

@param \Aimeos\MShop\Product\Item\Iface[] $products List of product items
@param \Aimeos\MShop\Common\Item\Lists\Iface[] $listItems List of customer list items
@return array Multi-dimensional associative list of list IDs as key and product / price item maps as values
Returns a filtered list of products for which a notification should be sent