| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Coding With Product's Extra Fields | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Coding With Product's Extra Fields
In 4.x how do you use the product's extra_fields in code? Before we used paramxx but this now seems not to work. An small code example would help.
|
|||||||
#2
|
|||||||
|
|||||||
I am having this problem too.
I understand they moved the extra fields into it's own tables so how do we get this going? Also, where the heck do you add more extra fields in 4.x ?
__________________
Emerson █ Total Server Solutions LLC- Quality X-Cart Hosting █ Recommended X-Cart Hosting Provider - US and UK servers █ Does your host backup your site? We do EVERY HOUR!!! █ Shared Hosting | Managed Cloud | Dedicated Servers |
|||||||
#3
|
|||||||
|
|||||||
Ok, I found were they are.
I am using a Pro version and in 4.x the extrafields option only show for the provider now.
__________________
Emerson █ Total Server Solutions LLC- Quality X-Cart Hosting █ Recommended X-Cart Hosting Provider - US and UK servers █ Does your host backup your site? We do EVERY HOUR!!! █ Shared Hosting | Managed Cloud | Dedicated Servers |
|||||||
#4
|
|||||||
|
|||||||
You can reference the extra fields in the product.tpl template like this:
$extra_fields[x].field_value Where x is the field index - 0 is the first. However my problem is I need the extra fields on the products.tpl also and I cannot figure out how to get to them. There a set of files in modules/extra_fields/ that are used for something but I can't figure out how. Isn't there anyone out there who knows how this works? |
|||||||
#5
|
|||||||||
|
|||||||||
{$extra_fields[X].field_value} where X = the field ID. Field ID's start at 0.
{$extra_fields[0].field_value} {$extra_fields[1].field_value} {$extra_fields[2].field_value} {$extra_fields[3].field_value} {$extra_fields[4].field_value} ... This will display the field value. To display the field name: {$extra_fields[X].field} where X = the field ID. Field ID's start at 0. {$extra_fields[0].field} {$extra_fields[1].field} {$extra_fields[2].field} {$extra_fields[3].field} {$extra_fields[4].field} ... |
|||||||||
#6
|
|||||||
|
|||||||
Quote:
Awesome, thanks a lot
__________________
Emerson █ Total Server Solutions LLC- Quality X-Cart Hosting █ Recommended X-Cart Hosting Provider - US and UK servers █ Does your host backup your site? We do EVERY HOUR!!! █ Shared Hosting | Managed Cloud | Dedicated Servers |
|||||||
#7
|
|||||||
|
|||||||
How would you go about calling the extra fields in the products.tpl. I was trying some stuff, but I am assuming you need to edit some php files. Has anyone had any success with adding extra fields to the products.tpl?
Thanks in advance, Mike |
|||||||
#8
|
|||||||
|
|||||||
I got it to work, you may have coded something wrong.
Here is an exmaple of what I did. I have many parts that drop ship, so instead of showing stock for these I show the paramater in an extra field, such as "Ships within 2-3 days" or "Custom order, 4-6 week build time". Make an extra field titled "Availability" and check the Show box to show this field on products. For products with nothing in that field it is not shown by default. Then to turn off the regular stock level display for items that do have something in that field, search for the following code in /customer/main/product.tpl Code:
Simply surround that code with an if statement as shown: Code:
|
|||||||
#9
|
|||||||
|
|||||||
Has anyone been successful with adding extra fields to the products.tpl? So far I have not found a solution.
Any comments are welcome Thanks in advance! -Mike |
|||||||
#10
|
|||||||
|
|||||||
You have the define the section:
Code:
You'll just need to adjust/add/remove the Code:
__________________
Emerson █ Total Server Solutions LLC- Quality X-Cart Hosting █ Recommended X-Cart Hosting Provider - US and UK servers █ Does your host backup your site? We do EVERY HOUR!!! █ Shared Hosting | Managed Cloud | Dedicated Servers |
|||||||
|
|||
X-Cart forums © 2001-2020
|