X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Adding Icons to products (https://forum.x-cart.com/showthread.php?t=10330)

Tye 11-11-2004 06:19 PM

Adding Icons to products
 
Hey - Happy Friday to everyone :D

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

groovico 11-11-2004 06:37 PM

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.

Tye 11-11-2004 07:13 PM

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 :D

Cheers

Tye 05-09-2005 10:02 PM

nm... bumping this back up after several years :o

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?

shan 05-10-2005 03:40 AM

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

<div align=center">[img]{$ImagesDir}/extra/{$param01}[/img]</div>

Tye 05-10-2005 05:43 AM

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 :)

shan 05-11-2005 03:16 AM

my bad :?

Code:

<div align=center">[img]{$ImagesDir}/extra/{$product.param01}[/img]</div>

CC 05-11-2005 04:39 AM

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...

dazybabes 06-20-2006 02:14 AM

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"


All times are GMT -8. The time now is 11:54 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.