	{{* if we do not have a valid cart we will redirect to shopping-cart.html page *}}
	{{assign var=CartCollection				value=133}}
	{{assign var=CartDetailsCollection		value=134}}
	{{assign var=SessionID   		value=''|sessionid}}
	{{getCollectionByCategory CollectionID=$CartCollection Collection_133_1=$SessionID aditionalFilter=' (Collection_133_5<>"on" or Collection_133_5 IS NULL) ' var=CartData OrderColumn='ID'}}
	{{assign var=CartDataItem value=$CartData[0]}}
	{{assign var=CartID value=$CartDataItem.Collection_133_ID}}
	
	{{getCollectionByCategory CollectionID=$CartDetailsCollection ColumnID=1 Value=$CartID var=CartDetails OrderColumn='ID'}}
	
	{{getCollectionByCategory CollectionID=$CartDetailsCollection ColumnID=1 Value=$CartID var=CartDetailsWithCollection OrderColumn='ID' aditionalFilter=' Collection_'|concat:$CartDetailsCollection|concat:'_9 > 0  ' }}
	{{assign var=FormsToDisplay value=0}}
	{{if $CartDetailsWithCollection|@count gt 0}}
			{{foreach from=$CartDetailsWithCollection item=v key=k}}
					{{if $FormsToDisplay eq 0}}
						{{getCollectionByCategory CollectionID=$v.Collection_134_9 ColumnID=1 Value=$v.Collection_134_ID var=CartAdDetails OrderColumn='ID'}}
						{{if $CartAdDetails|@count lt $v.Collection_134_3}}
							{{assign var=ShoppingCartItemID value=$v.Collection_134_ID}}
							{{assign var=FormsToDisplay value=$v.Collection_134_9}}
							{{math equation="y - x" x=$CartAdDetails|@count y=$v.Collection_134_3 assign=times}}
						{{/if}}
					{{/if}}	
			{{/foreach}}
	{{/if}}
	{{if $FormsToDisplay gt 0}}
		{{redirect page='/checkout/additional-information.html'}}
	{{/if}}
	
	{{if $CartDetails|@count eq 0 or $CartData|@count eq 0}}
		{{redirect page='/shopping-cart.html'}}	
	{{/if}}
<div id="middle2">




{{if $CartData|@count gt 0 and $CartDetails|@count gt 0}}
		<div id="shopping_cart_details">
		{{getcontent id=55}}
		</div>
{{/if}}
	
		<h1>Your Personal Information</h1>
		<div id="cartform">
		{{* We need to see if personal info has been completed once *}}
		{{* If yes we need to edit not add again *}}
		
		{{getCollectionByCategory CollectionID=138 Collection_138_1=$CartID var=PInfo OrderColumn='ID'}}
		{{if $PInfo|@count eq 0}}
			{{if $smarty.session.UserID gt 0}}
				{{getCollectionByCategory CollectionID=145 Collection_145_1=$smarty.session.UserID var=PInfo OrderColumn='ID'}}
				{{if $PInfo|@count gt 0}}
					{{assign var=PinfoData value=$PInfo[0]}}
				{{/if}}
			{{/if}}
			{{ViewCollection mode='Add' CollectionID=138}}
		{{else}}
			{{assign var=PinfoData value=$PInfo[0]}}
			{{assign var=PinfoID value=$PinfoData.Collection_138_ID}}
			{{ViewCollection mode='Edit' rowid=$PinfoID CollectionID=138}}
		{{/if}}	
		</div>	
</div>
