| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Smarty code to check file exstention | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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
__________________
4.1.10 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#3
|
|||||||
|
|||||||
![]() Hi Ralph, Thats perfect
![]()
__________________
4.1.10 |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|