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 to create an if statement using product IDs... (https://forum.x-cart.com/showthread.php?t=17524)

jkirkpatrick 10-26-2005 10:03 AM

Need to create an if statement using product IDs...
 
Hello,

I'd like to add some specific information to the page footer for a few products. In order to do this I need to know what the if statement is. I already know that for categories I would use:

Code:

{if $cat eq "301"}
Do something
{/if}


What would it be for individual products?

Thanks,
Jennifer

balinor 10-26-2005 10:08 AM

http://forum.x-cart.com/viewtopic.php?t=12234

jkirkpatrick 10-26-2005 01:18 PM

Great, thanks.

One more question. When I use the category identifier as I mentioned above, it only works for products who have that as the main category. However, I have lots of products that are also assigned to several other categories (for example a baby blanket may have a main category of "baby blankets" but also be included in "baby shower gifts" and "personalized baby gifts").

Is there any way to say I want to do something to ALL products in a secondary category?

Thanks,
Jennifer

leed 10-27-2005 08:15 AM

need to create if etc ...
 
Hiya

Try something like this

Code:

{if $product.categoryid == 4 or  $product.categoryid1 == 5 or $product.categoryid2==5 or $product.categoryid3 == 5}
  display something
{/if}


if you're referring to the $products array - use $products[product].categoryxx

Lee [/b]

jkirkpatrick 10-27-2005 10:18 AM

Thanks Lee but that didn't work. It still only displays the text if the product has been assigned to the main category.

Jennifer

leed 10-27-2005 02:37 PM

if etc
 
Jen

Post the code that you're trying to use here and I'll take a look

Lee

shan 10-27-2005 04:35 PM

use something like

Code:

{if
$smarty.get.productid eq 1 OR
$smarty.get.productid eq 2 OR
$smarty.get.productid eq 3 OR
$smarty.get.productid eq 4
}

blah blah blah

{/if}


jkirkpatrick 10-28-2005 10:41 AM

How would I specify the category ID though? I need to be able to do this:

{if category1 = 345 or category2 = 345 or category3 = 345}
Do something
{/if}

But I don't know how to refer to category1, category2, category3, etc.

Thanks,
Jennifer

jkirkpatrick 10-28-2005 10:50 AM

Along this same line I'm also having problems specifying ONLY a category page.

I want to change the titles for the category pages so I used:

Code:

<TITLE>
{if $cat eq "248"}
Baby Clothes - Baby Shoes
{/if}
</TITLE>

But, that makes the page title for ALL products in category 248 "Baby Clothes - Baby Shoes". I only want the category page to have that title and the product pages to keep their product names as the page title.

Any ideas how to fix this problem?

Thanks,
Jennifer



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

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