Bizarre product behavior

General ShopSite user discussion

Bizarre product behavior

Postby Vince Salese » Wed Nov 30, 2005 11:17 pm

In our Christmas newsletter, we're offering our customers free shipping on selected products and told them to look for the Free Shipping image on individual products throughout the store. For this post, I'll call these Promo Products.

I coded our primary product template to check two Product Tags
the PRODUCT.NoShippingCharges should be checked and
the PRODUCT.Field5 should be equal to "free shipping"
(I can't just check the PRODUCT.NoShippingCharges tag because I have products that never have shipping calculated because they are too heavy.)

Here's the code in the Define Product section of the product template that sets a VAR to indicate this product is getting free shipping and the Free Shipping image should be displayed ....

# Does this product get free shipping?
[-- IF PRODUCT.NoShippingCharges --]
[-- IF PRODUCT.Field5 "free shipping" --]
[-- VAR.FreeShip yes --]
[-- ELSE --]
[-- VAR.FreeShip no --]
[-- END_IF --]
[-- END_IF --]

Then when the PRODUCT.Name gets displayed the following code displays an image indicating Free Shipping
# If free shipping display image
[-- IF VAR.FreeShip yes --]
<a onclick="javascript:newwindow=window.open ('http://www.ahoycaptain.com/shop/freeship2005.html','','height=600,width=500,left=20,top=0,screenX=10,screenY=10,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');newwindow.focus();return false;"
href="http://www.ahoycaptain.com/shop/freeship2005.html"><img border="0" src="http://www.ahoycaptain.com/shop/media/christmas/freeship.gif" align="texttop"></a>
[--END_IF --]

This is also done in the More Information Page Section where the product name is displayed.

At first I thought it worked like a charm, then the more I checked the more bizarre it got. Products that had not been set for free shipping started showing up with the Free Shipping image displayed by their Product Name and in the More Information page as though the two tags had been set. Yet when added to the shopping cart, shipping was calculated.

In one page showing 40+ products (http://www.ahoycaptain.com/shop/weemspl ... eters.html), only the next to last product, the Storm Glass was a Promo Product, yet every product on the page displayed the Free Shipping image. When I reset only the Storm Glass to once again calculate shipping, all products in that page stopped displaying the Free Shipping image as they should have. Other pages that had one or more Promo Products displayed the Promo products properly yet random non-promo products also displayed the image. The only page that displayed properly was the one where the ALL the products were Promo product http://www.ahoycaptain.com/shop/highsierra_ci.html
..
I don't get. All the products use the same template.

Could someone please give me a clue as to how one product in a page of 40+ products can affect the way all the products are displayed in that page.

If someone from ShopSite wants to demonstrate this in real time, I'd be glad to.

Thanks
Vince
908-464-5581
vince@ahoycaptain.com
Vince Salese
 

Re: Bizarre product behavior

Postby loren_d_c » Thu Dec 01, 2005 1:35 am

Nothing really weird about that behavior, based on your example template
code. Once you set a VAR it is global for the rest of the Publish. SO
once you have hit a product that sets VAR.FreeShip to "yes" (it should
really be in quotes, by the way) it will be that way until it gets
unset. So it could potentially still be set when you get to the point
where you are publishing a product that doesn't even make it past the
first IF because its PRODUCT.NoShippingCharges is not checked, so it
never gets a chance to get VAR.FreeShip set back to "no".

There are a couple of things you can do:

1) add an ELSE for you IF PRODUCT.NoShippingCharges that also sets the
VAR.FreeShip to "no"
2) after you use the VAR.FreeShip near your PRODUCT.Name, always reset
it to "no" so it is "no" by default when the next product gets started.

-Loren


Vince Salese wrote:
In our Christmas newsletter, we're offering our customers free shipping
on selected products and told them to look for the Free Shipping image
on individual products throughout the store. For this post, I'll call
these Promo Products.

I coded our primary product template to check two Product Tags
the PRODUCT.NoShippingCharges should be checked and
the PRODUCT.Field5 should be equal to "free shipping"
(I can't just check the PRODUCT.NoShippingCharges tag because I have
products that never have shipping calculated because they are too heavy.)

Here's the code in the Define Product section of the product template
that sets a VAR to indicate this product is getting free shipping and
the Free Shipping image should be displayed ....

# Does this product get free shipping?
[-- IF PRODUCT.NoShippingCharges --]
[-- IF PRODUCT.Field5 "free shipping" --]
[-- VAR.FreeShip yes --]
[-- ELSE --]
[-- VAR.FreeShip no --]
[-- END_IF --]
[-- END_IF --]

Then when the PRODUCT.Name gets displayed the following code displays an
image indicating Free Shipping
# If free shipping display image
[-- IF VAR.FreeShip yes --]
a onclick="javascript:newwindow=window.open
('http://www.ahoycaptain.com/shop/freeship2005.html','','height=600,width=500,left=20,top=0,screenX=10,screenY=10,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');newwindow.focus();return
false;"
href="http://www.ahoycaptain.com/shop/freeship2005.html"><img border="0"
src="http://www.ahoycaptain.com/shop/media/christmas/freeship.gif"
align="texttop"></a
[--END_IF --]

This is also done in the More Information Page Section where the product
name is displayed.

At first I thought it worked like a charm, then the more I checked the
more bizarre it got. Products that had not been set for free shipping
started showing up with the Free Shipping image displayed by their
Product Name and in the More Information page as though the two tags had
been set. Yet when added to the shopping cart, shipping was calculated.

In one page showing 40+ products
(http://www.ahoycaptain.com/shop/weemspl ... eters.html), only the
next to last product, the Storm Glass was a Promo Product, yet every
product on the page displayed the Free Shipping image. When I reset only
the Storm Glass to once again calculate shipping, all products in that
page stopped displaying the Free Shipping image as they should have.
Other pages that had one or more Promo Products displayed the Promo
products properly yet random non-promo products also displayed the
image. The only page that displayed properly was the one where the ALL
the products were Promo product
http://www.ahoycaptain.com/shop/highsierra_ci.html
.
I don't get. All the products use the same template.

Could someone please give me a clue as to how one product in a page of
40+ products can affect the way all the products are displayed in that
page.

If someone from ShopSite wants to demonstrate this in real time, I'd be
glad to.

Thanks
Vince
908-464-5581
vince@ahoycaptain.com
loren_d_c
 
Posts: 2569
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Bizarre product behavior

Postby Vince Salese » Thu Dec 01, 2005 5:06 pm

Thanks Loren,
I have it working now without using a VAR. I just explicitly interogate the
PRODUCT.NoShippingCharges tag and the PRODUCT.Field5 tag each time. No
errant VAR's lying around. It works just fine. Maybe not elegant code but it
is KISS.

HOWEVER, (and you thought I was done!) there's another little glitch. When
you add a product that DOES NOT qualify for free shipping to the shopping
cart and a product that DOES qualify, the two weights are still combined to
calculate shipping. This effectively reverses the free shipping offer (and
makes us look like we're trying to pull a fast one to boot). Not good. You
can test this for yourself right from our home page. There are qualifying
and non-qulifying products that you can add and remove to the shopping cart
and see the shipping calculation change.
Any suggestions on this one?

As always, thanks for your help
Thanks
Vince



"Loren" <loren_d_c@yahoo.com> wrote in message
news:dmm916$pr6$1@eval.shopsite.com...
Nothing really weird about that behavior, based on your example template
code. Once you set a VAR it is global for the rest of the Publish. SO
once you have hit a product that sets VAR.FreeShip to "yes" (it should
really be in quotes, by the way) it will be that way until it gets
unset. So it could potentially still be set when you get to the point
where you are publishing a product that doesn't even make it past the
first IF because its PRODUCT.NoShippingCharges is not checked, so it
never gets a chance to get VAR.FreeShip set back to "no".

There are a couple of things you can do:

1) add an ELSE for you IF PRODUCT.NoShippingCharges that also sets the
VAR.FreeShip to "no"
2) after you use the VAR.FreeShip near your PRODUCT.Name, always reset
it to "no" so it is "no" by default when the next product gets started.

-Loren


Vince Salese wrote:
In our Christmas newsletter, we're offering our customers free shipping
on selected products and told them to look for the Free Shipping image
on individual products throughout the store. For this post, I'll call
these Promo Products.

I coded our primary product template to check two Product Tags
the PRODUCT.NoShippingCharges should be checked and
the PRODUCT.Field5 should be equal to "free shipping"
(I can't just check the PRODUCT.NoShippingCharges tag because I have
products that never have shipping calculated because they are too
heavy.)

Here's the code in the Define Product section of the product template
that sets a VAR to indicate this product is getting free shipping and
the Free Shipping image should be displayed ....

# Does this product get free shipping?
[-- IF PRODUCT.NoShippingCharges --]
[-- IF PRODUCT.Field5 "free shipping" --]
[-- VAR.FreeShip yes --]
[-- ELSE --]
[-- VAR.FreeShip no --]
[-- END_IF --]
[-- END_IF --]

Then when the PRODUCT.Name gets displayed the following code displays an
image indicating Free Shipping
# If free shipping display image
[-- IF VAR.FreeShip yes --]
a onclick="javascript:newwindow=window.open

('http://www.ahoycaptain.com/shop/freeship2005.html','','height=600,width=50

0,left=20,top=0,screenX=10,screenY=10,directories=no,location=no,menubar=no,
resizable=yes,scrollbars=yes,status=no,toolbar=no');newwindow.focus();return
false;"
href="http://www.ahoycaptain.com/shop/freeship2005.html"><img border="0"
src="http://www.ahoycaptain.com/shop/media/christmas/freeship.gif"
align="texttop"></a
[--END_IF --]

This is also done in the More Information Page Section where the product
name is displayed.

At first I thought it worked like a charm, then the more I checked the
more bizarre it got. Products that had not been set for free shipping
started showing up with the Free Shipping image displayed by their
Product Name and in the More Information page as though the two tags had
been set. Yet when added to the shopping cart, shipping was calculated.

In one page showing 40+ products
(http://www.ahoycaptain.com/shop/weemspl ... eters.html), only the
next to last product, the Storm Glass was a Promo Product, yet every
product on the page displayed the Free Shipping image. When I reset only
the Storm Glass to once again calculate shipping, all products in that
page stopped displaying the Free Shipping image as they should have.
Other pages that had one or more Promo Products displayed the Promo
products properly yet random non-promo products also displayed the
image. The only page that displayed properly was the one where the ALL
the products were Promo product
http://www.ahoycaptain.com/shop/highsierra_ci.html
.
I don't get. All the products use the same template.

Could someone please give me a clue as to how one product in a page of
40+ products can affect the way all the products are displayed in that
page.

If someone from ShopSite wants to demonstrate this in real time, I'd be
glad to.

Thanks
Vince
908-464-5581
vince@ahoycaptain.com
Vince Salese
 

Re: Bizarre product behavior

Postby loren_d_c » Fri Dec 02, 2005 9:50 am

What shipping methods are you using? If you really have the No Shipping
Charges option on for a product at the time it was placed in the cart,
then it should be excluded from the shipping calculations, including
shipping by weight. If you put the product in the cart before turning
this option on, Empty you cart and try again.

-Loren


Vince Salese wrote:
Thanks Loren,
I have it working now without using a VAR. I just explicitly interogate the
PRODUCT.NoShippingCharges tag and the PRODUCT.Field5 tag each time. No
errant VAR's lying around. It works just fine. Maybe not elegant code but it
is KISS.

HOWEVER, (and you thought I was done!) there's another little glitch. When
you add a product that DOES NOT qualify for free shipping to the shopping
cart and a product that DOES qualify, the two weights are still combined to
calculate shipping. This effectively reverses the free shipping offer (and
makes us look like we're trying to pull a fast one to boot). Not good. You
can test this for yourself right from our home page. There are qualifying
and non-qulifying products that you can add and remove to the shopping cart
and see the shipping calculation change.
Any suggestions on this one?

As always, thanks for your help
Thanks
Vince



"Loren" <loren_d_c@yahoo.com> wrote in message
news:dmm916$pr6$1@eval.shopsite.com...

Nothing really weird about that behavior, based on your example template
code. Once you set a VAR it is global for the rest of the Publish. SO
once you have hit a product that sets VAR.FreeShip to "yes" (it should
really be in quotes, by the way) it will be that way until it gets
unset. So it could potentially still be set when you get to the point
where you are publishing a product that doesn't even make it past the
first IF because its PRODUCT.NoShippingCharges is not checked, so it
never gets a chance to get VAR.FreeShip set back to "no".

There are a couple of things you can do:

1) add an ELSE for you IF PRODUCT.NoShippingCharges that also sets the
VAR.FreeShip to "no"
2) after you use the VAR.FreeShip near your PRODUCT.Name, always reset
it to "no" so it is "no" by default when the next product gets started.

-Loren


Vince Salese wrote:

In our Christmas newsletter, we're offering our customers free shipping
on selected products and told them to look for the Free Shipping image
on individual products throughout the store. For this post, I'll call
these Promo Products.

I coded our primary product template to check two Product Tags
the PRODUCT.NoShippingCharges should be checked and
the PRODUCT.Field5 should be equal to "free shipping"
(I can't just check the PRODUCT.NoShippingCharges tag because I have
products that never have shipping calculated because they are too

heavy.)

Here's the code in the Define Product section of the product template
that sets a VAR to indicate this product is getting free shipping and
the Free Shipping image should be displayed ....

# Does this product get free shipping?
[-- IF PRODUCT.NoShippingCharges --]
[-- IF PRODUCT.Field5 "free shipping" --]
[-- VAR.FreeShip yes --]
[-- ELSE --]
[-- VAR.FreeShip no --]
[-- END_IF --]
[-- END_IF --]

Then when the PRODUCT.Name gets displayed the following code displays an
image indicating Free Shipping
# If free shipping display image
[-- IF VAR.FreeShip yes --]
a onclick="javascript:newwindow=window.open


('http://www.ahoycaptain.com/shop/freeship2005.html','','height=600,width=50
0,left=20,top=0,screenX=10,screenY=10,directories=no,location=no,menubar=no,
resizable=yes,scrollbars=yes,status=no,toolbar=no');newwindow.focus();return

false;"
href="http://www.ahoycaptain.com/shop/freeship2005.html"><img border="0"
src="http://www.ahoycaptain.com/shop/media/christmas/freeship.gif"
align="texttop"></a
[--END_IF --]

This is also done in the More Information Page Section where the product
name is displayed.

At first I thought it worked like a charm, then the more I checked the
more bizarre it got. Products that had not been set for free shipping
started showing up with the Free Shipping image displayed by their
Product Name and in the More Information page as though the two tags had
been set. Yet when added to the shopping cart, shipping was calculated.

In one page showing 40+ products
(http://www.ahoycaptain.com/shop/weemspl ... eters.html), only the
next to last product, the Storm Glass was a Promo Product, yet every
product on the page displayed the Free Shipping image. When I reset only
the Storm Glass to once again calculate shipping, all products in that
page stopped displaying the Free Shipping image as they should have.
Other pages that had one or more Promo Products displayed the Promo
products properly yet random non-promo products also displayed the
image. The only page that displayed properly was the one where the ALL
the products were Promo product
http://www.ahoycaptain.com/shop/highsierra_ci.html
.
I don't get. All the products use the same template.

Could someone please give me a clue as to how one product in a page of
40+ products can affect the way all the products are displayed in that
page.

If someone from ShopSite wants to demonstrate this in real time, I'd be
glad to.

Thanks
Vince
908-464-5581
vince@ahoycaptain.com


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


Return to User Forum

Who is online

Users browsing this forum: No registered users and 177 guests