IF tag to test for SubProducts?

This is an archive of old posting to the User Forum

IF tag to test for SubProducts?

Postby Allen Murdock » Mon Mar 10, 2003 6:50 am

All -

I'm writing a custom product template (for my first ShopSite store) and I've
been trying to use an IF tag to test for the presence of subproducts on a
More Info page.

The store has several products that come in various colors and/or sizes.
I've set these products up to act as "master" products, with the different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and "Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me frustrated.

I hope I've described the situation clearly enough. I would definitely be
grateful for any help.

- Allen
Allen Murdock
 

Re: IF tag to test for SubProducts?

Postby loren_d_c » Mon Mar 10, 2003 10:06 am

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and I've
been trying to use an IF tag to test for the presence of subproducts on a
More Info page.

The store has several products that come in various colors and/or sizes.
I've set these products up to act as "master" products, with the different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and "Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me frustrated.

I hope I've described the situation clearly enough. I would definitely be
grateful for any help.

- Allen
loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: IF tag to test for SubProducts?

Postby Allen Murdock » Mon Mar 10, 2003 1:49 pm

Loren -

Thanks for your help. I knew [--IF SUBPRODUCTS--] didn't look right.

I've changed my IF statement as you suggested, and I'm still not able to get
this to work as I want it to. My subproducts are coming out fine, but the
code that's supposed to follow the ELSE tag doesn't appear.

Here's the relevant code:

[--IF PRODUCT.SubProducts--]
<table width="70%" align="center" cellpadding="5px" cellspacing="0"
border="1px">
[--LOOP SUBPRODUCTS--]
[--SUBPRODUCTS--]
[--END_LOOP SUBPRODUCTS--]
</table>
[--ELSE--]
<table width="100%" cellpadding="10px" cellspacing="0" border="0">
<tr>
<td width="22%">&nbsp;</td>
<td width="78%"><div align="center"><a
href="[--PRODUCT.AddToCartURL--]">[--PRODUCT.AddToCartButton--]</a>&nbsp;
<a ref="[--SHOPPING_CART_URL--]">[--PRODUCT.ViewCartButton--]</a></div>
</td>
</tr>
</table>
[--END_IF--]

Obviously I'm doing something wrong, but I can't see it. Can you help me?

BTW, Is it OK to post snippets of code like this?

- Allen

On 3/10/03 8:06 AM, in article b4id73$k6p$1@support.shopsite.com, "Loren"
<loren_d_c@yahoo.com> wrote:

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and I've
been trying to use an IF tag to test for the presence of subproducts on a
More Info page.

The store has several products that come in various colors and/or sizes.
I've set these products up to act as "master" products, with the different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and "Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me frustrated.

I hope I've described the situation clearly enough. I would definitely be
grateful for any help.

- Allen

Allen Murdock
 

Re: IF tag to test for SubProducts?

Postby Justin Sutton » Mon Mar 10, 2003 5:40 pm

Allen,
I hope I am not being redundant. We are also using the If tag with
subproducts and it is working very well. Here are the tags we use. The only
difference I noticed was the (s) in the end of the word subproduct in your
if tag. I hope this helps you out.

[-- IF PRODUCT.subproduct --]
[-- LOOP SUBPRODUCTS --]
[--SUBPRODUCTS--]

[-- END_LOOP SUBPRODUCTS--]

[--ELSE--]
[-- End_IF --]

Good Luck,
Justin



"Allen Murdock" <murdock@clamco.com> wrote in message
news:BA922C42.9292%murdock@clamco.com...
Loren -

Thanks for your help. I knew [--IF SUBPRODUCTS--] didn't look right.

I've changed my IF statement as you suggested, and I'm still not able to
get
this to work as I want it to. My subproducts are coming out fine, but the
code that's supposed to follow the ELSE tag doesn't appear.

Here's the relevant code:

[--IF PRODUCT.SubProducts--]
table width="70%" align="center" cellpadding="5px" cellspacing="0"
border="1px"
[--LOOP SUBPRODUCTS--]
[--SUBPRODUCTS--]
[--END_LOOP SUBPRODUCTS--]
/table
[--ELSE--]
table width="100%" cellpadding="10px" cellspacing="0" border="0"
tr
td width="22%">&nbsp;</td
td width="78%"><div align="center"><a
href="[--PRODUCT.AddToCartURL--]">[--PRODUCT.AddToCartButton--]</a>&nbsp;
a ref="[--SHOPPING_CART_URL--]">[--PRODUCT.ViewCartButton--]</a></div
/td
/tr
/table
[--END_IF--]

Obviously I'm doing something wrong, but I can't see it. Can you help me?

BTW, Is it OK to post snippets of code like this?

- Allen

On 3/10/03 8:06 AM, in article b4id73$k6p$1@support.shopsite.com, "Loren"
loren_d_c@yahoo.com> wrote:

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and
I've
been trying to use an IF tag to test for the presence of subproducts on
a
More Info page.

The store has several products that come in various colors and/or
sizes.
I've set these products up to act as "master" products, with the
different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and
"Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me
frustrated.

I hope I've described the situation clearly enough. I would definitely
be
grateful for any help.

- Allen


Justin Sutton
 

Re: IF tag to test for SubProducts?

Postby loren_d_c » Mon Mar 10, 2003 5:42 pm

Hmm, looks good to me. Are you sure that the products you are expecting to execute
the ELSE code don't have subproducts assigned?

-Loren



Allen Murdock wrote:

Loren -

Thanks for your help. I knew [--IF SUBPRODUCTS--] didn't look right.

I've changed my IF statement as you suggested, and I'm still not able to get
this to work as I want it to. My subproducts are coming out fine, but the
code that's supposed to follow the ELSE tag doesn't appear.

Here's the relevant code:

[--IF PRODUCT.SubProducts--]
table width="70%" align="center" cellpadding="5px" cellspacing="0"
border="1px"
[--LOOP SUBPRODUCTS--]
[--SUBPRODUCTS--]
[--END_LOOP SUBPRODUCTS--]
/table
[--ELSE--]
table width="100%" cellpadding="10px" cellspacing="0" border="0"
tr
td width="22%">&nbsp;</td
td width="78%"><div align="center"><a
href="[--PRODUCT.AddToCartURL--]">[--PRODUCT.AddToCartButton--]</a>&nbsp;
a ref="[--SHOPPING_CART_URL--]">[--PRODUCT.ViewCartButton--]</a></div
/td
/tr
/table
[--END_IF--]

Obviously I'm doing something wrong, but I can't see it. Can you help me?

BTW, Is it OK to post snippets of code like this?

- Allen

On 3/10/03 8:06 AM, in article b4id73$k6p$1@support.shopsite.com, "Loren"
loren_d_c@yahoo.com> wrote:

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and I've
been trying to use an IF tag to test for the presence of subproducts on a
More Info page.

The store has several products that come in various colors and/or sizes.
I've set these products up to act as "master" products, with the different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and "Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me frustrated.

I hope I've described the situation clearly enough. I would definitely be
grateful for any help.

- Allen

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

Re: IF tag to test for SubProducts?

Postby loren_d_c » Mon Mar 10, 2003 5:44 pm

Ah yes, according to the spec, the subproduct field is singular, see:

http://www.shopsite.com/help/6.2/en-US/ ... ields.html

-Loren



Justin Sutton wrote:

Allen,
I hope I am not being redundant. We are also using the If tag with
subproducts and it is working very well. Here are the tags we use. The only
difference I noticed was the (s) in the end of the word subproduct in your
if tag. I hope this helps you out.

[-- IF PRODUCT.subproduct --]
[-- LOOP SUBPRODUCTS --]
[--SUBPRODUCTS--]

[-- END_LOOP SUBPRODUCTS--]

[--ELSE--]
[-- End_IF --]

Good Luck,
Justin

"Allen Murdock" <murdock@clamco.com> wrote in message
news:BA922C42.9292%murdock@clamco.com...
Loren -

Thanks for your help. I knew [--IF SUBPRODUCTS--] didn't look right.

I've changed my IF statement as you suggested, and I'm still not able to
get
this to work as I want it to. My subproducts are coming out fine, but the
code that's supposed to follow the ELSE tag doesn't appear.

Here's the relevant code:

[--IF PRODUCT.SubProducts--]
table width="70%" align="center" cellpadding="5px" cellspacing="0"
border="1px"
[--LOOP SUBPRODUCTS--]
[--SUBPRODUCTS--]
[--END_LOOP SUBPRODUCTS--]
/table
[--ELSE--]
table width="100%" cellpadding="10px" cellspacing="0" border="0"
tr
td width="22%">&nbsp;</td
td width="78%"><div align="center"><a
href="[--PRODUCT.AddToCartURL--]">[--PRODUCT.AddToCartButton--]</a>&nbsp;
a ref="[--SHOPPING_CART_URL--]">[--PRODUCT.ViewCartButton--]</a></div
/td
/tr
/table
[--END_IF--]

Obviously I'm doing something wrong, but I can't see it. Can you help me?

BTW, Is it OK to post snippets of code like this?

- Allen

On 3/10/03 8:06 AM, in article b4id73$k6p$1@support.shopsite.com, "Loren"
loren_d_c@yahoo.com> wrote:

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and
I've
been trying to use an IF tag to test for the presence of subproducts on
a
More Info page.

The store has several products that come in various colors and/or
sizes.
I've set these products up to act as "master" products, with the
different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and
"Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me
frustrated.

I hope I've described the situation clearly enough. I would definitely
be
grateful for any help.

- Allen


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

Re: IF tag to test for SubProducts?

Postby Allen Murdock » Tue Mar 11, 2003 4:08 am

Of course!

It's so difficult going through life as a sap.

Thanks for catching that, Justin.

On 3/10/03 3:40 PM, in article b4j7qn$mae$1@support.shopsite.com, "Justin
Sutton" <ssutton2@midsouth.rr.com> wrote:

Allen,
I hope I am not being redundant. We are also using the If tag with
subproducts and it is working very well. Here are the tags we use. The only
difference I noticed was the (s) in the end of the word subproduct in your
if tag. I hope this helps you out.

[-- IF PRODUCT.subproduct --]
[-- LOOP SUBPRODUCTS --]
[--SUBPRODUCTS--]

[-- END_LOOP SUBPRODUCTS--]

[--ELSE--]
[-- End_IF --]

Good Luck,
Justin



"Allen Murdock" <murdock@clamco.com> wrote in message
news:BA922C42.9292%murdock@clamco.com...
Loren -

Thanks for your help. I knew [--IF SUBPRODUCTS--] didn't look right.

I've changed my IF statement as you suggested, and I'm still not able to
get
this to work as I want it to. My subproducts are coming out fine, but the
code that's supposed to follow the ELSE tag doesn't appear.

Here's the relevant code:

[--IF PRODUCT.SubProducts--]
table width="70%" align="center" cellpadding="5px" cellspacing="0"
border="1px"
[--LOOP SUBPRODUCTS--]
[--SUBPRODUCTS--]
[--END_LOOP SUBPRODUCTS--]
/table
[--ELSE--]
table width="100%" cellpadding="10px" cellspacing="0" border="0"
tr
td width="22%">&nbsp;</td
td width="78%"><div align="center"><a
href="[--PRODUCT.AddToCartURL--]">[--PRODUCT.AddToCartButton--]</a>&nbsp;
a ref="[--SHOPPING_CART_URL--]">[--PRODUCT.ViewCartButton--]</a></div
/td
/tr
/table
[--END_IF--]

Obviously I'm doing something wrong, but I can't see it. Can you help me?

BTW, Is it OK to post snippets of code like this?

- Allen

On 3/10/03 8:06 AM, in article b4id73$k6p$1@support.shopsite.com, "Loren"
loren_d_c@yahoo.com> wrote:

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and
I've
been trying to use an IF tag to test for the presence of subproducts on
a
More Info page.

The store has several products that come in various colors and/or
sizes.
I've set these products up to act as "master" products, with the
different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and
"Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me
frustrated.

I hope I've described the situation clearly enough. I would definitely
be
grateful for any help.

- Allen




Allen Murdock
 

Re: IF tag to test for SubProducts?

Postby Allen Murdock » Tue Mar 11, 2003 4:10 am

It's always the little things, isn't it?

Thanks for your assistance. I do appreciate it.

- Allen

On 3/10/03 3:44 PM, in article 3E6D2359.AEF0A63A@yahoo.com, "Loren"
<loren_d_c@yahoo.com> wrote:

Ah yes, according to the spec, the subproduct field is singular, see:

http://www.shopsite.com/help/6.2/en-US/ ... ields.html

-Loren



Justin Sutton wrote:

Allen,
I hope I am not being redundant. We are also using the If tag with
subproducts and it is working very well. Here are the tags we use. The only
difference I noticed was the (s) in the end of the word subproduct in your
if tag. I hope this helps you out.

[-- IF PRODUCT.subproduct --]
[-- LOOP SUBPRODUCTS --]
[--SUBPRODUCTS--]

[-- END_LOOP SUBPRODUCTS--]

[--ELSE--]
[-- End_IF --]

Good Luck,
Justin

"Allen Murdock" <murdock@clamco.com> wrote in message
news:BA922C42.9292%murdock@clamco.com...
Loren -

Thanks for your help. I knew [--IF SUBPRODUCTS--] didn't look right.

I've changed my IF statement as you suggested, and I'm still not able to
get
this to work as I want it to. My subproducts are coming out fine, but the
code that's supposed to follow the ELSE tag doesn't appear.

Here's the relevant code:

[--IF PRODUCT.SubProducts--]
table width="70%" align="center" cellpadding="5px" cellspacing="0"
border="1px"
[--LOOP SUBPRODUCTS--]
[--SUBPRODUCTS--]
[--END_LOOP SUBPRODUCTS--]
/table
[--ELSE--]
table width="100%" cellpadding="10px" cellspacing="0" border="0"
tr
td width="22%">&nbsp;</td
td width="78%"><div align="center"><a
href="[--PRODUCT.AddToCartURL--]">[--PRODUCT.AddToCartButton--]</a>&nbsp;
a ref="[--SHOPPING_CART_URL--]">[--PRODUCT.ViewCartButton--]</a></div
/td
/tr
/table
[--END_IF--]

Obviously I'm doing something wrong, but I can't see it. Can you help me?

BTW, Is it OK to post snippets of code like this?

- Allen

On 3/10/03 8:06 AM, in article b4id73$k6p$1@support.shopsite.com, "Loren"
loren_d_c@yahoo.com> wrote:

You are testing a property of the product. Try [-- IF
PRODUCT.Subproducts --]

-Loren



Allen Murdock wrote:
All -

I'm writing a custom product template (for my first ShopSite store) and
I've
been trying to use an IF tag to test for the presence of subproducts on
a
More Info page.

The store has several products that come in various colors and/or
sizes.
I've set these products up to act as "master" products, with the
different
size/color variants as a subproducts.

Each subproduct has its own SKU and often a different price from other
subproducts in the group.

What I'm trying to accomplish is to have the master product's price and
"Add
to Cart" button appear on the More Info page only if there are no
subproducts, and to eliminate them if there are.

My attempts to use the tag [--IF SUBPRODUCTS--] have left me
frustrated.

I hope I've described the situation clearly enough. I would definitely
be
grateful for any help.

- Allen



Allen Murdock
 


Return to User Forum Archive

Who is online

Users browsing this forum: No registered users and 59 guests