Products on sale whether they are or not

General ShopSite user discussion

Products on sale whether they are or not

Postby Sir Yendor » Sat Jul 07, 2007 6:34 pm

If I put any item in the store on sale, ALL products in the store have the regular price displayed with a strike through and the words "On Sale" appear. Only the product with the sale price has "Check here to display this product's on sale price" checked in the "Edit Product Layout" area.

Below is the code I'm using on the product template. What am I doing wrong?

Thanks


[-- PRODUCT.MoreInformationText --]</font>[-- VAR.SaleOn &quot;no&quot;
--] [-- IF PRODUCT.SaleOn--] [-- IF PRODUCT.SaleAmount --] [--
VAR.SaleOn &quot;yes&quot; --] [-- Else --] [-- VAR.SaleOn &quot;no&quot;
--] [-- END_IF --] [-- END_IF --] [-- IF PRODUCT.DisplayPrice
--] [-- IF VAR.SaleOn &quot;yes&quot; --]<strike>[-- PRODUCT.Price --]</strike>&nbsp;[-- PRODUCT.PriceSize Begin --][-- PRODUCT.PriceStyle
Begin --][-- PRODUCT.SaleAmount --][-- PRODUCT.PriceStyle End
--][-- PRODUCT.PriceSize End --] [-- STORE.OnSaleText --] [--
ELSE --] [-- PRODUCT.PriceSize Begin --][-- PRODUCT.PriceStyle
Begin --][-- PRODUCT.Price --][-- PRODUCT.PriceStyle End --][--
PRODUCT.PriceSize End --]
[-- END_IF --]
[-- END_IF --]
Sir Yendor
 
Posts: 47
Joined: Tue Sep 26, 2006 5:52 pm
Location: Portland

Postby Jim » Sat Jul 07, 2007 7:37 pm

Looking at the code it looks like it should work. The only thing I see that
might cause an issue is that the quote marks which should just be the "
are written as &quot;. Try changing all instances of &quot; in the template
to just the quote mark as I did in the code below. Note that it is easier to
see what is happening in the code if you break it out into a more readable
format. That will make it easier to see if you have proper begin and end tags for ShopSite template tags and html tags.

Code: Select all
[-- PRODUCT.MoreInformationText --]</font>
 [-- VAR.SaleOn "no" --]
 [-- IF PRODUCT.SaleOn--]
     [-- IF PRODUCT.SaleAmount --]
          [--VAR.SaleOn "yes" --]
     [-- Else --]
          [-- VAR.SaleOn "no" --]
     [-- END_IF --]
 [-- END_IF --]
 [-- IF PRODUCT.DisplayPrice --]
      [-- IF VAR.SaleOn "yes" --]
           <strike>[-- PRODUCT.Price --]</strike>&nbsp;
              [-- PRODUCT.PriceSize Begin --]
                [-- PRODUCT.PriceStyle Begin --]
                   [-- PRODUCT.SaleAmount --]
                [-- PRODUCT.PriceStyle End--]
             [-- PRODUCT.PriceSize End --]
             [-- STORE.OnSaleText --]
      [--ELSE --]
          [-- PRODUCT.PriceSize Begin --]
             [-- PRODUCT.PriceStyle Begin --]
                 [-- PRODUCT.Price --]
             [-- PRODUCT.PriceStyle End --]
          [-- PRODUCT.PriceSize End --]
      [-- END_IF --]
[-- END_IF --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Sir Yendor » Sat Jul 07, 2007 11:06 pm

Jim,

I've noticed that the problem only affects products on the same page. If one product on a page has a sale price, the problem will exists for every product on that particular page. If another page has no items on sale, everything appears properly. Once I put any item on that page on sale, every item is affected.

This is the code I'm now using under this tag

[-- PRODUCT.ProductDescription --]: and the problem still exists.

<!-- if product is on sale and there is a sale price, set VAR-->
<strong><font size="2" face="Arial">
[-- VAR.SaleOn "no" --]
[-- IF PRODUCT.SaleOn--]
[-- IF PRODUCT.SaleAmount --]
[--VAR.SaleOn "yes" --]
[-- Else --]
[-- VAR.SaleOn "no" --]
[-- END_IF --]
[-- END_IF --]
[-- IF PRODUCT.DisplayPrice --]
[-- IF VAR.SaleOn "yes" --]
<strike>[-- PRODUCT.Price --]</strike>&nbsp;
[-- PRODUCT.PriceSize Begin --]
[-- PRODUCT.PriceStyle Begin --]
[-- PRODUCT.SaleAmount --]
[-- PRODUCT.PriceStyle End--]
[-- PRODUCT.PriceSize End --]
[-- STORE.OnSaleText --]
[--ELSE --]
[-- PRODUCT.PriceSize Begin --]
[-- PRODUCT.PriceStyle Begin --]
[-- PRODUCT.Price --]
[-- PRODUCT.PriceStyle End --]
[-- PRODUCT.PriceSize End --]
[-- END_IF --]
[-- END_IF --]</strong></font></td>
<!-- END if product is on sale and there is a sale price, set VAR-->


any further thoughts?

Thanks
Sir Yendor
 
Posts: 47
Joined: Tue Sep 26, 2006 5:52 pm
Location: Portland

Postby Jim » Sun Jul 08, 2007 6:44 am

Do you happen to have the product template overridden on the page template to use a different tempate? In the [-- Loop Products --] section you might be using [-- product <template> --] to over ride the template for Items used on that page.

Are the products subproducts for a single product and not individual products. It that is the case you need to check the Define subproducts code. If they are on a Moreinformation page check the Define More_information section of the product template.

When debugging problems like this I like to print out the VAR and other values that I am compareing to it to see what there actual values are at certain places in the code.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Sir Yendor » Sun Jul 08, 2007 11:41 am

Jim,

Thanks for the help. I've got that issue resolved, but now I've discovered an oddity.

I have a few products on one page each using the same product template. The weird part is that there are different fonts being used to display the price of different products. If these products are all on the same page and all using the same product template, shouldn't the fonts be the same?

Thanks
Sir Yendor
 
Posts: 47
Joined: Tue Sep 26, 2006 5:52 pm
Location: Portland


Return to User Forum

Who is online

Users browsing this forum: No registered users and 43 guests