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)
-   -   quick help with {if} comparison (https://forum.x-cart.com/showthread.php?t=3812)

Mad 07-30-2003 12:07 PM

quick help with {if} comparison
 
I want to make a {if} statement that checks if the product listed is the last (depending how many I have set to be displayed per page in the options).
So something like:

{if the product is not the last in the page}
<hr size=1 noshade width=100% align=left>
{/if}

Else then nothing, so that there isn't a horizontal line under the last item on the page, makes it all look a lot cleaner.

Any and all help is appreciated!

kpayne 07-30-2003 02:36 PM

You'd need to know the loop index variable (see the 'name=' part of .

For example, if the index was "product" then you would use the following code:

{if %product.last% ne "true"}
... code ...
{/if}

I'm getting the info from this page: http://smarty.php.net/manual/en/section.property.last.php

I hope this helps!

Mad 07-30-2003 08:39 PM

That did it, thank you so much! Exactly how I wanted it.

I better start reading up on Smarty a little more.


All times are GMT -8. The time now is 03:06 AM.

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