| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Loop any Section | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Greetings,
I am trying to figure out how to get a section to display without there having to be a value for cat. E.g. if I have this in a template (home.tpl): Code:
and I go to http://mystore.com/x-cart/customer/home.php?cat=123 Its going to loop $products.productcode & $products.productid for everything in Category #123. Is there a way I can have it loop any section I want instead of the example above? Like: Code:
Code:
and it will loop categories 142, 156. Possible? |
|||||||||
#2
|
|||||||
|
|||||||
![]() Not within the templates you cant.
The values of the arrays that holds the products is already populated before it gets to the template. You can get it to do this in the php scripts themselves and assign each categories products to a new smarty array such as $products142 or $products 156 etc and then loop through these. Be warned though that this would be a lot of products. Another alternative is amending the products.php page or creating a copy of it so that it takes all products into the $products array, then put some logic into the section loop for the display. ie {if $products[product].categoryid eq "142"} display it {/if} If you have a lot of products this will eat your server though. ![]()
__________________
ex x-cart guru ![]() |
|||||||
#3
|
|||||||||
|
|||||||||
![]() Okay, I will mess around with that at work today.
Thanks! |
|||||||||
#4
|
|||||||||
|
|||||||||
![]() I am still not having any luck with this at all.
What I am trying to do is modify my products listing to display the products. And then I can specify another category to list right under it. that other category right under the main would be the Accessories for the main product. See what im trying to do? |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|