![]() |
Adding Free Shipping Image
I know that this can be done with an if statement, but I don't know how to do it. I have been trying with no luck.
I would like to place a free shipping image either next to or under the price on the product page and featured products. I am trying to get this to work if free shipping had been selected when the product is set up. Thank you for your help. |
Re: Adding Free Shipping Image
|
Re: Adding Free Shipping Image
OK
On the product.tpl I put the line below and it works fine. {if $product.free_shipping eq "Y"}<img src="{$ImagesDir}/promo_free_shipping.gif">{/if}{* Added For Free Shipping Image *} On the products.tpl and products_t.tpl I tried both of the following with no luck. {if $product.free_shipping eq "Y"}<img src="{$ImagesDir}/promo_free_shipping.gif">{/if}{* Added For Free Shipping Image *} {if $products[product].free_shipping eq "Y"}<img src="{$ImagesDir}/promo_free_shipping.gif">{/if}{* Added For Free Shipping Image *} I would like the free shipping image to show up in the products page and the featured products page. Please help. |
Re: Adding Free Shipping Image
Help Please, I have been trying everything I can think of, but with no luck.
|
Re: Adding Free Shipping Image
what if you try to use $products[prod].free_shipping instead of $products[product].free_shipping in products.tpl?
|
Re: Adding Free Shipping Image
Sorry but that does not seem to work either,
|
Re: Adding Free Shipping Image
1 Attachment(s)
We'll I got it to work.
This will put the free shipping image on the featured products page, products page, and the detailed product page. In the product.tpl put this code where you want the image to be: {* Free Shipping Image start *} <br /> <br /> {if $product.free_shipping eq "Y"} <img src="{$ImagesDir}/promo_free_shipping.gif" alt="Free Shipping" />{/if} {* Free Shipping Image End *} In the products_t.tpl put the following code where you would like the image. {* Free Shipping Image Mod Begin *} <br /> {if $products[product].free_shipping eq 'Y'} <img src="{$ImagesDir}/free_shipping.gif" alt="Free Shipping" /{/if} {* Free Shipping Mod End *} Must be pasted in this format, will not work if on single line. |
Re: Adding Free Shipping Image
That's because your code is botched up :) It should read:
{if $products[product].free_shipping eq 'Y'}<img src="{$ImagesDir}/free_shipping.gif" alt="" />{/if} You have an open image tag and a closing span tag in your code, which is probably why it wasn't displaying correctly. |
Re: Adding Free Shipping Image
The code I used was from the post that you refered me to. I now have the mod working with the mod write listed above.
Should I use the / at the end of the image line to close it. What does the alt="" do. I have been reading like crazy, learning quite a bit. |
Re: Adding Free Shipping Image
No, the code in that thread was correct, you implemented it incorrectly. This is broken:
<img src="{$ImagesDir}/free_shipping.gif" /</span> To be W3C compliant, an image tag needs to be closed with the / at the end (as does any tag with no closing tag) and the alt tag is also required. ALT text is for people with disabilities, so it would also be wise to put 'Free shipping' in the alt tag. |
Re: Adding Free Shipping Image
Code changed as per Balinor recommendations.
Works perfect!!!!! |
Re: Adding Free Shipping Image
I am trying to learn all this.
Here is a copy and past of the code from the other thread. {if $product.free_shipping eq "Y"} <img src="{$ImagesDir}/Free_Ship1.jpg">{/if} As for the code I used, I changed the image name, but the code is from on sale, I looked at his code to see what I was doing wrong. He does not have the trailing slash or the alt= image tag. Should I put the alt=image in his code. Thank you for the help!! |
Re: Adding Free Shipping Image
Your image code was different, you were missing the closing > which broke the tag. The alt is not essential, but if you want a valid site both the alt and the / are necessary, yes.
|
Re: Adding Free Shipping Image
Anyone know the syntax to make this work in LiteCommerce?
|
Re: Adding Free Shipping Image
I have the image showing on the product page but in the listing it will not appear using
{if $products[product].free_shipping eq 'Y'}<img src="{$ImagesDir}/free_shipping.gif" alt="Free Shipping" />{/if} this is in 4.2.2 - any ideas..could the image be too big perhaps? |
All times are GMT -8. The time now is 02:50 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.