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

Adding Icons to products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-11-2004, 06:19 PM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default Adding Icons to products

Hey - Happy Friday to everyone

I have just been asked by a client if it is possible to add small icons to individual products.

He has 3 product types so far, CD, DVD, Book and would like an icon to represent each, which would probably sit under the thumbnail just to make it easy to recognise. Some products are available in all three medias.

Is this acheivable?

Can an existing part of x-cart be modified to show this?

Would it need a custom script?

Cheers

Tye
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #2  
Old 11-11-2004, 06:37 PM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

This should put you on the right track

Make a folder in your shop called /shop/productimages/

dump

dvd.gif
book.gif

etc in there

Add an extra product field to x-cart then in the box put "dvd.gif" and in the templates where you want the image to appear use

if your on 3.5.X the extra field will be stored in {$param01} through to {$param09}

so for example to show the image use:

<img src=/shop/productimages/{$param00}>


For x-cart 4.X you need to use it's extra field format which i can't recall off the top of my head.
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #3  
Old 11-11-2004, 07:13 PM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

Thanks groovico

I'll have a go at this next week

I suspected it was something to do with extra fields - but I have never used them before.

Here goes nothing

Cheers
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #4  
Old 05-09-2005, 10:02 PM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

nm... bumping this back up after several years

I have added my extra field which is "param01" - named 'New'

I have then typed into my products.tpl:

Code:
<div align=center"><img src=/icons/{$param01}></div>

Yet what I get is a broken image - and in the source I get:

Code:
<div align=center"><img src=/icons/></div>

Should there be something else I should be adding?
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #5  
Old 05-10-2005, 03:40 AM
  shan's Avatar 
shan shan is offline
 

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

Default

put the images in skin1/images/extra and then use

<div align=center">[img]{$ImagesDir}/extra/{$param01}[/img]</div>
__________________
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-10-2005, 05:43 AM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

Noope - that didn't work...

Here how I am using the code in the 'product.tpl'
Code:
<tr> <td valign=top align=left rowspan=2 width=100> {include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url}<div align=center">[img]{$ImagesDir}/extra/{$param01}[/img]</div> </td> <td valign=top> <span class=> {if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if} </span>

Upon further examination - it looks like this isn't going to work - I think I should be editing the 'product.tpl' for the modules/extrafields directory.

My aim has actually changed from my original post - I now want to place a 'new' icon underneath the thumbnail on the 'customer/main/product.tpl'

I am not sure it this can be done with extra fields... please tell me I'm wrong
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #7  
Old 05-11-2005, 03:16 AM
  shan's Avatar 
shan shan is offline
 

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

Default

my bad

Code:
<div align=center">[img]{$ImagesDir}/extra/{$product.param01}[/img]</div>
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #8  
Old 05-11-2005, 04:39 AM
  CC's Avatar 
CC CC is offline
 

eXpert
  
Join Date: Jun 2004
Posts: 349
 

Default

Would it be difficult to code this as a selection field?
So you could update the image the same as you would when you add a new image?

As in click the button to Add an Image and then upload in the same manner...
__________________
XC 4.2 inc (unofficial) patch release.
Reply With Quote
  #9  
Old 06-20-2006, 02:14 AM
 
dazybabes dazybabes is offline
 

Advanced Member
  
Join Date: Mar 2005
Posts: 70
 

Default

Has anyone come across a version of this mod that I could use for version 4.0.3??

My mummy always said "if unsure always ask for directions"
__________________
X-Cart Version 4.0.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:54 AM.

   

 
X-Cart forums © 2001-2020