Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding Free Shipping Image

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-11-2008, 04:13 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default 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.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #2  
Old 02-12-2008, 03:59 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Adding Free Shipping Image

http://forum.x-cart.com/showthread.php?t=26087&highlight=free+shipping+ico n
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-12-2008, 05:18 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default 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.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #4  
Old 02-13-2008, 03:34 AM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: Adding Free Shipping Image

Help Please, I have been trying everything I can think of, but with no luck.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #5  
Old 02-13-2008, 06:56 AM
  Andrew G. Klepcha's Avatar 
Andrew G. Klepcha Andrew G. Klepcha is offline
Banned
 

Advanced Member
  
Join Date: Jan 2008
Posts: 33
 

Default Re: Adding Free Shipping Image

what if you try to use $products[prod].free_shipping instead of $products[product].free_shipping in products.tpl?
Reply With Quote
  #6  
Old 02-13-2008, 03:01 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: Adding Free Shipping Image

Sorry but that does not seem to work either,
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #7  
Old 02-13-2008, 04:50 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: Adding Free Shipping Image

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.
Attached Thumbnails
Click image for larger version

Name:	free shipping works.jpg
Views:	196
Size:	8.5 KB
ID:	788  
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #8  
Old 02-13-2008, 04:52 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #9  
Old 02-13-2008, 05:15 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default 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.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #10  
Old 02-13-2008, 05:28 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:56 PM.

   

 
X-Cart forums © 2001-2020