| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Display HTML in Extra fields | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Display HTML in Extra fields
I would love to say I wrote this but alas I didn't.
It cost me a whole bunch of support points to get this coded by X-cart and seeing as..... a) I see this mod/fix asked for quite a bit by newbs like myself b) This should be a standard feature of X-Cart - not a required mod and c) I have received lots of invaluable help from peeps here like Balinor, Zaja et al..... I thought I would share this with the group -------------- This MOD is for those that want to display extra fields containing HTML anywhere on your site (almost).. One of the ways I used this mod was to enable small clickable images that linked to audio previews. 1. Create the following file and name it modifier.extrafield.php then upload it to the include/templater/plugins directory : Quote:
2. Modify skin1/customer/main/products.tpl by adding the following wherever you want it to display : Note : You must replace the following parts of this code with your own field variables.... NEWFIELD - replace this with the name of the field you wish to display - ie 'Size' # - replace this with the field number of the field you wish to display - ie '2' Quote:
3. Modify skin1/customer/main/products_t.tpl exactly the same way as described in step 2. 4. Open admin/product_modify.php & provider/product_modify.php and look for the following : Quote:
Replace with : Quote:
Do the same for both files. 5. To make it a bit easier to enter and edit all your lovely HTML code on the Admin backend do the following... Open modules/Extra/product_modify.tpl and find : Quote:
Replace with : Note. Make sure you change the following part of this code with your own field name. NEWFIELD - Change this to the name of YOUR field. ie 'Size' Quote:
And thats it This works a charm and is a doddle to install. Enjoy, G
__________________
X-Cart version : 4.0.18 Mod : Customer Also Bought Mod : Custom catergory Templates Mod : Custon Product Templates |
|||||||
#2
|
|||||||
|
|||||||
Nice...finally, one complete set of instructions. Thanks for posting it Grant!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
The least I can do to say thanks for all the help I've had here
__________________
X-Cart version : 4.0.18 Mod : Customer Also Bought Mod : Custom catergory Templates Mod : Custon Product Templates |
|||||||
#4
|
|||||||
|
|||||||
I can't get this mode to work...
I keep getting the following error:
Quote:
I'm probably not doing something right in the display code. (I just arbitrarily used the number 2 as the field I wanted displayed.) Code:
Thanks, Chris Version 4.0.18
__________________
4.0x - 4.5x |
|||||||
#5
|
|||||||
|
|||||||
Re: I can't get this mode to work...
Quote:
Is 2 the correct field number for the shirtcolors field? Every field you create has it's own number starting with 1 being the first field that you created. Go into your admin backend and open Products > Extra fields. The field right at the top will be number 1 and then they go down in numerical order. Really to make things easier there should be a field number display next to each field name - this is probably quite a simple mod if one of the experts fancies having a go at knocking it up
__________________
X-Cart version : 4.0.18 Mod : Customer Also Bought Mod : Custom catergory Templates Mod : Custon Product Templates |
|||||||
#6
|
|||||||
|
|||||||
In the following block of text delete space before "html" in both cases.
It was causing an error. Quote:
__________________
X-Cart version 4.0.19 |
|||||||
#7
|
|||||||
|
|||||||
html code gets truncated to about 150 chars, how can I get rid of it?
__________________
X-Cart version 4.0.19 |
|||||||
#8
|
|||||||
|
|||||||
ok, found it
it's in the DB it the extra_filed_values changed type of the value from CHAR255 to TEXT
__________________
X-Cart version 4.0.19 |
|||||||
#9
|
|||||||
|
|||||||
this is going to make a lot of people happy.
sure makes me
__________________
X-Cart 4.0.18 DBest |
|||||||
#10
|
|||||||
|
|||||||
Re: HTML in Extra fields - Not working for .gif icons - Pls. Help!
This is a very helpful mod. I was looking for a way to add icons to the products page.
I have only been half way successful. I am able to show HTML text in the field, but I can't get images to show. I keep getting the red X of misery. I have checked, and there are no htaccess files in the image directories, so that can't be the problem. I also have the files set to 777. I have even tried different locations for the .gif image, including the location for my product pics (which do work) but it just won't play. Here is one variation of the several I've tried putting in the extra field: <IMG src="{ImagesDir}/"icon.gif"> I also went to the DB and changed it from CHAR255 to TEXT. No difference. Help! Thanks.
__________________
xcart v4.0.18 [linux] Loyalty Points, DSEFU, Easy Checkout, Featured Product Manager, Remember Me, Relevant Search, Vertical Flyouts, Multiple Category Templates. Loads of other tweaks and mods learned in forums. |
|||||||
|
|||
X-Cart forums © 2001-2020
|