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)
-   -   How to Exclude from {section} loop (https://forum.x-cart.com/showthread.php?t=10059)

xcell67 10-28-2004 04:54 AM

How to Exclude from {section} loop
 
I tried searching for this but couldn't find it. Anyway I have an item called "Ebay Auction Payment" set at $0. The thing is, I don't want this item to show up on the recommends list when customers are browsing other products.

How do I exclude the ebay payment item from the recommends loop?

thanks


.Version 3.5.11

pmstudios 10-28-2004 06:54 AM

This should be more streamlined, but here's a quick fix to exclude that single product.

Apply to modules/Recommended_Products/recommends.tpl
Code:

{section name=num loop=$recommends}
{if $recommends[num].product ne "Ebay Auction Payment"}
<LI>
<SPAN class="ItemsList">{$recommends[num].product}</SPAN>
</LI>
{/if}
{/section}


A better way would be to create a new field, perhaps in the products table, that could be set to exclude products from the recommended list. Then in recommends.php, you could add a conditional check to determine whether or not a product should be included. Then you could manage the exclusions from the modify product/create new product pages.

xcell67 10-28-2004 03:09 PM

that worked great, thanks pm!

pmstudios 10-28-2004 03:47 PM

^_^ !


All times are GMT -8. The time now is 08:41 PM.

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