[ic] Next Product, Previous Product.

Davor Ocelic docelic at spinlocksolutions.com
Thu Oct 2 22:59:48 UTC 2008


> Something like this would work (untested):
> 
> [query
>  sql="(select sku from products where id < $THIS order by id desc
> limit 1) union all (select sku from products where id > $THIS order
> by id limit 1)" list=1
> ]
> 
> [list]
>   [sql-alternate 2]
>     Previous product, [sql-code]
>   [else]
>     Next product, [sql-code]
>   [/sql-alternate]
> [/list]
> 
> [/query]

In the above, $THIS would be the current SKU, of course, 
and [else] needs to be closed with [/else][/sql-alternate].

-doc



More information about the interchange-users mailing list