X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Need some help with a new template I've created (https://forum.x-cart.com/showthread.php?t=43186)

longhorn180 10-23-2008 07:07 AM

Need some help with a new template I've created
 
I created a template called pimage.tpl that will call a product image based on the product's isbn (extra field) and here is the code for the template.
Code:

{section name=field loop=$extra_fields}
{if $extra_fields[field].service_name eq "ISBN"}
 <img src="files/pimages/{$extra_fields[field].field_value}.jpg">
{/if}
{/section}

I would like to use an if then function on the product page that would check the image folder in this template for an image and if it returned empty then the thumbnail.tpl would be called. I know I need to assign a variable to this template for the if then function to work but I'm not sure of the proper way to do this. Does anyone know how I might accomplish this?

longhorn180 10-24-2008 12:47 PM

Re: Need some help with a new template I've created
 
I think I have changed what I want to do. I want to place an if then function to check and see if an uploaded thumbnail exists right before this code in product.tpl
Code:

{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}
If the image does not exist then I want to call this template
Code:

{include file="pimage.tpl"}
But I'm not sure how to do it. I know there is a simple way to do this but I can't seem to figure it out.


All times are GMT -8. The time now is 01:43 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.