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

3 for 2 icon display

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-26-2004, 02:44 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default 3 for 2 icon display

This is what happens when you leave cart development for a few weeks, I've completely lost track with X-Cart! Anyway, I set up an extra field called "3for2" and I was hoping to use that as a trigger to get it to display a 3 for 2 graphic against the product in the various views. I was thinking something like this in the templates:

Code:
{if $product.3for2 eq "Y"} [img]{$ImagesDir}/3for2.gif[/img] {/if}

Also, if this is the way to go about it, will this work if I set the 3for2 field NOT to display as I only need it as a trigger for the graphic? And can I get it to display in the thumbnail (category) view as well as the detail?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #2  
Old 05-26-2004, 02:26 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

the field will be called something like {product.param00} though not {$product.3for2}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 05-26-2004, 11:23 PM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Thanks Shan,

Is the only way to find out the actual name of the field to use PHPMyadmin?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #4  
Old 05-27-2004, 12:41 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Still can't get it to work. I'm experimenting with the product_thumbnail.tpl. Firstly, because I'm still finding my feet I just put the word "test" in to see where it shows on the screen (alongside the product image) and then I substituted test for :

Code:
{if $product.param00 eq "Y"}[img]{$ImagesDir}/3for2.gif[/img]{/if}

So the template now looks like:
Code:
{* $Id: product_thumbnail.tpl,v 1.10 2003/08/11 10:45:10 svowl Exp $ *} {if $config.Appearance.show_thumbnails eq "Y"}[img]{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?productid={$productid}{if $file_upload_data.file_path}&tmp=y{/if}{/if}[/img]{if $product.param00 eq "Y"}[img]{$ImagesDir}/3for2.gif[/img]{/if}{/if}
Still doesn't work. I've even tried outputting text based on the if statement but still no cigar. Am I doing something obviously wrong?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #5  
Old 05-27-2004, 01:26 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

you have to put your code in products.tpl for it to appear in the products list and product.tpl for it to appear on product details

the code you ould use in products.tpl would be along the lines of

Code:
{if $products[product].param00 ne ""} [img]{$ImagesDir}/3for2.gif[/img] {/if}

and for product.tpl

Code:
{if $product.param00 ne ""} [img]{$ImagesDir}/3for2.gif[/img] {/if}

the code basically says ...

if param00 does not equal nothing / empty do something

replace param00 with the correct extra field that you are using. Use phpmyadmin to check or make a guess

add this code below the call for the thumbnail
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #6  
Old 05-27-2004, 02:11 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Thanks Shan,

OK, I'm a tad confused now. Changes I made to product_thumbnail appeared fine. In trying to do what Shan suggests, any changes I try and make to main/products.tpl or product.tpl don't show up. In fact I deleted the entire contents of product.tpl, saved it, cleared the template cache and could still browse product details fine. Am I missing something here?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #7  
Old 05-27-2004, 02:18 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

DOH! Sorry, scrub that last message, I was adjusting the wrong product/s.tpl -it's customer/main......I'll try again..!

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #8  
Old 05-27-2004, 02:59 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Shan, that worked! Thanks for the help!

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #9  
Old 05-27-2004, 05:09 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

This maybe of some use to someone.

I'm trying to be clever with the use of these fields and the images. I'm fine with the 3for2 graphic but I want my freebie images included on the product details page. Because I have a range of freebie images I've set up a new field called Freebies (officially param01) and in that field I just name the jpeg minus the ".jpg" suffix. I then can use something like:

Freebie/param001: FreeStand
Name of jpg in default image directory: FreeStand.jpg

Inserted at appropriate point in customers/main/product.tpl:

Code:
{if $product.param01 ne ""} [img]{$ImagesDir}/{$product.param01}.jpg[/img]{/if}

which outputs:

Code:
http://www.myshop.com/x-cart/skin1/images/FreeStand.jpg

It was useful for me anyhow!

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:57 AM.

   

 
X-Cart forums © 2001-2020