<?php
if( $a == 'attributes_list' ){
	if( isset( $_GET['id_prod'] ) && is_numeric( $_GET['id_prod'] ) && isset( $_GET['id_attr'] ) && is_numeric( $_GET['id_attr'] ) ){
		$aData = $oProduct->throwProductAttributesInfo( $_GET['id_prod'], $_GET['id_attr'], $_GET['attr_val'] );
		$aJSON = Array( );
		if( is_array( $aData ) ) foreach( $aData as $aInfo ){
			$aJSON[] = Array( 'value' => $aInfo['iAttributeValue'], 'text' => $aInfo['sValue'], 'data' => ( is_array( $aInfo['aVariant'] ) ? Array( 'quantity' => $aInfo['aVariant']['iStock'], 'price' => displayPrice( normalizePrice( $aInfo['aVariant']['fPrice'] ) ), 'price_old' => displayPrice( normalizePrice( $aInfo['aVariant']['fPriceOld'] ) ), 'price_catalog' => displayPrice( normalizePrice( $aInfo['aVariant']['fCatalogPrice'] ) ), 'vat' => $aInfo['aVariant']['fVat'], 'availability' => $aInfo['aVariant']['sAvailability'], 'image' => $aInfo['aVariant']['sImage'] ) : null ) );
		}
		echo ( json_encode( $aJSON ) );
		exit;
	}
}
?>