Help -- Infinite Loop

General ShopSite user discussion

Help -- Infinite Loop

Postby Matthew J. Drollinger » Thu Nov 10, 2005 11:09 am

I am trying to display only the first product of a page on one page. When
only one product is assigned to the page, it works, but when more than one
product is assigned, I appear to get an infinite loop of tab characters.

Here is the code where the products are looped:

[-- VAR.usedFeaturedProduct false --]
[-- LOOP PRODUCTS --]
[-- IF VAR.usedFeaturedProduct false --]
[-- PRODUCT ballfour_featureditem_template --]
[-- VAR.usedFeaturedProduct true --]
[-- END_IF --]
[-- END_LOOP PRODUCTS --]


As mentioned, I'm only trying to have the first product appear in this area
(and the others appear later on in the page). I was assuming that this code
would set the usedFeaturedProduct variable to a value outside of the IF
statement after the first loop and therefore no more products would be
output.

When I comment out this entire block, the page functions as expected...no
products show up. When I only use one product on this page, again, it
functions as expected; displaying that product. It's only when I have more
than one product where the infinite loop occurs.

Is there a better way to do this?

I basically need to have one area showing the first product, and later on I
need an area that shows up to four products (products 2-5).

Thank you,

Matt
Matthew J. Drollinger
 

Re: Help -- Infinite Loop

Postby loren_d_c » Thu Nov 10, 2005 11:36 am

I'm not sure if you can actually skip a [-- PRODUCT --] tag inside the
loop. Try putting something like this in the DEFINE PRODUCT section of
your ballfour_featureditem_template product template:

[-- IF VAR.usedFeaturedProduct false --]
[-- VAR.usedFeaturedProduct true --]
# do all your normal product stuff here
[-- ELSE --]
# do nothing
[-- END_IF --]

-Loren


Matthew J. Drollinger wrote:
I am trying to display only the first product of a page on one page. When
only one product is assigned to the page, it works, but when more than one
product is assigned, I appear to get an infinite loop of tab characters.

Here is the code where the products are looped:

[-- VAR.usedFeaturedProduct false --]
[-- LOOP PRODUCTS --]
[-- IF VAR.usedFeaturedProduct false --]
[-- PRODUCT ballfour_featureditem_template --]
[-- VAR.usedFeaturedProduct true --]
[-- END_IF --]
[-- END_LOOP PRODUCTS --]


As mentioned, I'm only trying to have the first product appear in this area
(and the others appear later on in the page). I was assuming that this code
would set the usedFeaturedProduct variable to a value outside of the IF
statement after the first loop and therefore no more products would be
output.

When I comment out this entire block, the page functions as expected...no
products show up. When I only use one product on this page, again, it
functions as expected; displaying that product. It's only when I have more
than one product where the infinite loop occurs.

Is there a better way to do this?

I basically need to have one area showing the first product, and later on I
need an area that shows up to four products (products 2-5).

Thank you,

Matt

loren_d_c
 
Posts: 2569
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Help -- Infinite Loop

Postby Matthew J. Drollinger » Thu Nov 10, 2005 4:28 pm

Hi Loren,

That worked! Thank you very much for your help. I'll probably use that
trick a lot more in the future.

Thanks,

Matt



"Loren" <loren_d_c@yahoo.com> wrote in message
news:dl00cr$48e$1@eval.shopsite.com...
I'm not sure if you can actually skip a [-- PRODUCT --] tag inside the
loop. Try putting something like this in the DEFINE PRODUCT section of
your ballfour_featureditem_template product template:

[-- IF VAR.usedFeaturedProduct false --]
[-- VAR.usedFeaturedProduct true --]
# do all your normal product stuff here
[-- ELSE --]
# do nothing
[-- END_IF --]

-Loren


Matthew J. Drollinger wrote:
I am trying to display only the first product of a page on one page.
When only one product is assigned to the page, it works, but when more
than one product is assigned, I appear to get an infinite loop of tab
characters.

Here is the code where the products are looped:

[-- VAR.usedFeaturedProduct false --]
[-- LOOP PRODUCTS --]
[-- IF VAR.usedFeaturedProduct false --]
[-- PRODUCT ballfour_featureditem_template --]
[-- VAR.usedFeaturedProduct true --]
[-- END_IF --]
[-- END_LOOP PRODUCTS --]


As mentioned, I'm only trying to have the first product appear in this
area (and the others appear later on in the page). I was assuming that
this code would set the usedFeaturedProduct variable to a value outside
of the IF statement after the first loop and therefore no more products
would be output.

When I comment out this entire block, the page functions as expected...no
products show up. When I only use one product on this page, again, it
functions as expected; displaying that product. It's only when I have
more than one product where the infinite loop occurs.

Is there a better way to do this?

I basically need to have one area showing the first product, and later on
I need an area that shows up to four products (products 2-5).

Thank you,

Matt
Matthew J. Drollinger
 


Return to User Forum

Who is online

Users browsing this forum: No registered users and 161 guests