protected function _checkWithCurrency( MShop_Order_Item_Base_Interface $order,
		MShop_Order_Item_Base_Product_Interface $value )
	{
		$config = $this->_getItem()->getConfig();
		$currencyId = $value->getPrice()->getCurrencyId();

		if( isset( $config['single-value-max'][$currencyId] )
			&& $value->getPrice()->getValue() * $value->getQuantity() > (float) $config['single-value-max'][$currencyId]
		) {
			$msg = sprintf( 'The maximum product value is %1$s', $config['single-value-max'][$currencyId] );
			throw new MShop_Plugin_Provider_Exception( $msg );
		}


		if( isset( $config['total-value-max'][$currencyId] ) )
		{
			$price = clone $value->getPrice();
			$price->setValue( $price->getValue() * $value->getQuantity() );

			foreach( $order->getProducts() as $product ) {
				$price->addItem( $product->getPrice(), $product->getQuantity() );
			}

			if( (float) $price->getValue() > (float) $config['total-value-max'][$currencyId] )
			{
				$msg = sprintf( 'The maximum value of all products is %1$s', $config['total-value-max'][$currencyId] );
				throw new MShop_Plugin_Provider_Exception( $msg );
			}
		}
	}
protected function _checkWithCurrency( MShop_Order_Item_Base_Interface $order,
		MShop_Order_Item_Base_Product_Interface $value )
	{
		$config = $this->_getItem()->getConfig();
		$currencyId = $value->getPrice()->getCurrencyId();

		if( isset( $config['single-value-max'][$currencyId] )
			&& $value->getPrice()->getValue() * $value->getQuantity() > (float) $config['single-value-max'][$currencyId]
		) {
			$msg = sprintf( 'The maximum product value is %1$s', $config['single-value-max'][$currencyId] );
			throw new MShop_Plugin_Provider_Exception( $msg );
		}


		if( isset( $config['total-value-max'][$currencyId] ) )
		{
			$price = clone $value->getPrice();
			$price->setValue( $price->getValue() * $value->getQuantity() );

			foreach( $order->getProducts() as $product ) {
				$price->addItem( $product->getPrice(), $product->getQuantity() );
			}

			if( (float) $price->getValue() > (float) $config['total-value-max'][$currencyId] )
			{
				$msg = sprintf( 'The maximum value of all products is %1$s', $config['total-value-max'][$currencyId] );
				throw new MShop_Plugin_Provider_Exception( $msg );
			}
		}
	}
protected function _checkWithCurrency ( MShop_Order_Item_Base_Interface $ order , MShop_Order_Item_Base_Product_Interface $ value ) { $ config = $ this -> _getItem ( ) -> getConfig ( ) ; $ currencyId = $ value -> getPrice ( ) -> getCurrencyId ( ) ; if ( isset ( $ config [ 'single-value-max' ] [ $ currencyId ] ) && $ value -> getPrice ( ) -> getValue ( ) * $ value -> getQuantity ( ) > ( float ) $ config [ 'single-value-max' ] [ $ currencyId ] ) { $ msg = sprintf ( 'The maximum product value is %1$s' , $ config [ 'single-value-max' ] [ $ currencyId ] ) ; throw new MShop_Plugin_Provider_Exception ( $ msg ) ; } if ( isset ( $ config [ 'total-value-max' ] [ $ currencyId ] ) ) { $ price = clone $ value -> getPrice ( ) ; $ price -> setValue ( $ price -> getValue ( ) * $ value -> getQuantity ( ) ) ; foreach ( $ order -> getProducts ( ) as $ product ) { $ price -> addItem ( $ product -> getPrice ( ) , $ product -> getQuantity ( ) ) ; } if ( ( float ) $ price -> getValue ( ) > ( float ) $ config [ 'total-value-max' ] [ $ currencyId ] ) { $ msg = sprintf ( 'The maximum value of all products is %1$s' , $ config [ 'total-value-max' ] [ $ currencyId ] ) ; throw new MShop_Plugin_Provider_Exception ( $ msg ) ; } } }
Checks for the product limits when the configuration contains limits per currency.

@param MShop_Order_Item_Base_Interface $order Basket object
@param MShop_Order_Item_Base_Product_Interface $value Order product item
@throws MShop_Plugin_Provider_Exception If one limit is exceeded
Checks for the product limits when the configuration contains limits per currency .