| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
random.php/random product listing modification needed... | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() i'm running the random products on our main page, 4 across, and i need to remove one category (and all subs) from being displayed in that random display. so, say for example the main category is "kids clothes" or cat id 123.
i tried a few things in the template but guess i'm way off on the way to do this one, so i'm asking here now. how can we either remove that from the query, or stop any of those products from being called into the loop of random preoducts in the template? thanks. here is random.php Code:
here is the template... Code:
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2 |
|||||||
#2
|
|||||||
|
|||||||
![]() bumping this since i can't get the syntax right on my own...
so, for this chunk in the PHP.... Code:
how can i exclude one cat, and all subcats. for example. the main category id is 274 wouldn't it be close to.... AND $sql_tbl[categories].categoryid ne "274" or something close that? what's another way to specify "not equal to" instead of the ne? thanks, j
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2 |
|||||||
#3
|
|||||||
|
|||||||
![]() *crickets.
anyone have any ideas?
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2 |
|||||||
#4
|
|||||||
|
|||||||
![]() use NOT in the mysql query
|
|||||||
#5
|
|||||||||
|
|||||||||
![]() On 4.1.8 the category information and the product information are seperated, and then connected with a join table called xcart_products_categories, so you have to add this table to the query and then tell the query not to show products in categoryid 274.
Try this: Code:
|
|||||||||
#6
|
|||||||
|
|||||||
![]() hey jon, tried that, and i get nothing. the items from that category are showing up still.
we're still running 4.1.7 so i'm not sure if that is the problem or not. any other ideas? thanks, j
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2 |
|||||||
#7
|
|||||||
|
|||||||
![]() *bump.
okay, i think it isn't working with the main parent category. i'm trying all the active subcats... so, would this be the right syntax to select mulitple subcats? sql_tbl[products_categories].categoryid != '255' || '252' || '258' thanks,
__________________
X-Cart version 4.1.7 - PHP 5.2. - MySQL server 5.0.41-community-nt - MySQL client 5.0.22 - Web server Apache/2.2.4 (Win32) - PHP/5.2.2 |
|||||||
|
|||
X-Cart forums © 2001-2020
|