![]() |
Smarty code to check file exstention
Hi All, Hope the Xcart pro's can help me out here. Been battling on this one.
Is there a way i can check what the product image file extension is using smarty code? i want to replace the main product image with a swf file, but I want the smarty code to first check if the product image is an image or flash file. so something like this if {product extention is .swf} include product_thumnail_flash.tpl elseif {product extention is jpg} include product_thumnail.tpl /if hope this makes sense. Thanks |
Re: Smarty code to check file exstention
Assuming you are doing this in product.tpl, try:
{if $product.tmbn_url|substr:-3 eq "swf"} include ... {else} include ... {/if} If you are doing this in product_thumbnail.tpl use $tmbn_url instead of $product.tmbn_url |
Re: Smarty code to check file exstention
Hi Ralph, Thats perfect ;) , exactly what i was looking for. Thanks for your help.
|
All times are GMT -8. The time now is 05:38 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.