{{assign var=CartDetailID 		value=$smarty.get.id}}
{{assign var=PageToRedirect   	value=$smarty.get.goto}}

{{assign var=SessionID   		value=''|sessionid}}
{{assign var=Time	 	  		value=$smarty.now}}
{{assign var=CartCollection		value=133}}
{{assign var=ProdCollection		value=129}}
{{assign var=PriceCollection	value=131}}
{{assign var=CartDetailsCollection		value=134}}

{{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}}

{{assign var=CartClosed value=$CartDataItem.Collection_133_28}}
{{if $CartClosed neq 'on'}}

{{CollectionDeleteRow CollectionID=$CartDetailsCollection RowID=$CartDetailID}}

{{/if}}
	
	{{if $PageToRedirect neq ''}}
		{{if $smarty.get.goto eq ''}}
			{{redirect page=$PageToRedirect}}
		{{else}}
		{{assign var=redirectingpage value=$PageToRedirect}}
		{{assign var=redirectingpage value=$redirectingpage|concat:'?page='|concat:$smarty.get.page}}
			{{redirect page=$redirectingpage}}
		{{/if}}
	{{else}}
		{{redirect page='/products/'}}
	{{/if}}