Zen Cart Logo
Forums / All Other Contributions/Addons / How to Add Custom Fields for Materials & Dimensions when adding products?

How to Add Custom Fields for Materials & Dimensions when adding products?

Views: 6,725

Results 1 to 20 of 96
24 Apr 2016, 7:34 PM
#1
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

How to Add Custom Fields for Materials & Dimensions when adding products?

Is there an add-on or how to add two custom fields for Materials & Dimensions when adding a new product in the admin area?

25 Apr 2016, 1:15 AM
#3
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

kobra:

If I am understanding your question then attributes are what you are seeking
https://www.zen-cart.com/content.php?99-how-do-i-add-attributes-to-my-products

No, I am not looking for attribute. When you go to your add a product page in the Admin area. At the bottom is where you enter your Weight. I want two extra fields for Materials & Dimensions.

25 Apr 2016, 2:46 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

At the bottom is where you enter your Weight. I want two extra fields for Materials & Dimensions.
And these will be used for what??

25 Apr 2016, 2:49 AM
#5
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

kobra:

And these will be used for what??

It's for Product Details

Each items has different dimensions & materials over 1,000 items.

25 Apr 2016, 3:24 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

You might start with this - it states that it add only one text field but you could alter it for two and it also states that it can be used with tabbed products which I believe your template is using

https://www.zen-cart.com/downloads.php?do=file&id=926

Also, you might review this as it allows for additional text based on "tags" entered in your product description

https://www.zen-cart.com/downloads.php?do=file&id=646

You might not need the first addon at all

25 Apr 2016, 4:17 AM
#7
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

kobra:

You might start with this - it states that it add only one text field but you could alter it for two and it also states that it can be used with tabbed products which I believe your template is using

https://www.zen-cart.com/downloads.php?do=file&id=926

Also, you might review this as it allows for additional text based on "tags" entered in your product description

https://www.zen-cart.com/downloads.php?do=file&id=646

You might not need the first addon at all

Well I looked horrible on both and that isn't what I want.

25 Apr 2016, 4:38 AM
#8
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

Ok, I tried both what you have discribed and it looked horrible. Take a look at image below. I don't want separate tabs.
in detail tab what I want is as follows:
Materials: Iron
Dimensions: 4" x 4" x 8"
Model: 10017357
25 Units in Stock
Attachment 16260

25 Apr 2016, 8:56 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

I followed the instructions and this is what I got
You can see it HERE

25 Apr 2016, 1:12 PM
#10
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

kobra:

I followed the instructions and this is what I got
You can see it HERE

I only add the Product Extra Field Mod and it didn't work. What am I missing? You can take a look here

25 Apr 2016, 6:15 PM
#11
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

I am using tabbed products pro for ZenCart v1.5.5

25 Apr 2016, 8:16 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

wmorris:

Ok, I tried both what you have discribed and it looked horrible. Take a look at image below. I don't want separate tabs.
in detail tab what I want is as follows:
Materials: Iron
Dimensions: 4" x 4" x 8"
Model: 10017357
25 Units in Stock
Attachment 16260
So, if understand correctly, were unable to apply either plugin to insert additional information into the single tab. From the picture don't see what is "horrible". If the information makes it to the page then the look of it can be modified using css... if the info doesn't make it there, well then that's a completely different issue. Read-only attributes could provide the same information for which you are looking, but not sure with the "tab" system where they will be presented.

26 Apr 2016, 12:12 AM
#13
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

Do I really have to use Tabbed Products Pro if I am using Products Extra Fields mod?

26 Apr 2016, 1:07 AM
#14
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

wmorris:

Do I really have to use Tabbed Products Pro if I am using Products Extra Fields mod?

I don't believe so, based on it's description.

Look at this, I think you might find it more useful and adaptable. You will have to do some editing to get the dimensions displayed on your product info page, echo the info wherever you want it to show.
[https://www.zen-cart.com/downloads.php?do=file&id=1495

](https://www.zen-cart.com/downloads.php?do=file&id=1495)

26 Apr 2016, 1:14 AM
#15
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

lankeeyankee:

I don't believe so, based on it's description.

Look at this, I think you might find it more useful and adaptable. You will have to do some editing to get the dimensions displayed on your product info page, echo the info wherever you want it to show.
[https://www.zen-cart.com/downloads.php?do=file&id=1495

](https://www.zen-cart.com/downloads.php?do=file&id=1495)

Well I installed the Product Extra Field. When I change a few things in the English folder/file then when I enter a Dimension and Material in the field that I need then looked on the product on the main site. Nothing! came up. What am I missing?

27 Apr 2016, 8:48 PM
#16
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

Like I mentioned, you'll have to edit your product info file and echo the info. It's just a start, the info is added to your db from the admin, you have to write the code to display (with a php echo statement) it on the page.

27 Apr 2016, 9:13 PM
#17
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

lankeeyankee:

Like I mentioned, you'll have to edit your product info file and echo the info. It's just a start, the info is added to your db from the admin, you have to write the code to display (with a php echo statement) it on the page.

lankeeyankee,

How can I echo it out on my product info page?

27 Apr 2016, 10:10 PM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

According to the files in the Product Extra Fields plugin, they've added the following lines in the middle of your tpl_product_info_display.php file (assuming you copied the file over to your template, or better yet, assuming you carefully merged its unique changes into your own template):
All of this code takes care of displaying what's in those custom fields:

<?php 
if (!TPP_GLOBAL_EXTRA_FIELDS_ON_TAB) {
	
	?>

<?php if (isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field) || isset($text_1) ||isset($text_2) || isset($text_3) || isset($text_4)) {
        echo  '<div class="files"><div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>';
		  }?>
<?php if($extra_field!='') { 
    echo '<li>'.$extra_field . '</li>';
} ?>
<?php if($text_1!='') { 
    echo '<li>'. PRODUCT_TEXT_1 .' '.$text_1 . '</li>';
} ?>
<?php if($text_2!='') { 
    echo '<li>'. PRODUCT_TEXT_2 .' '.$text_2 . '</li>';
} ?>
<?php if($text_3!='') { 
    echo '<li>'. PRODUCT_TEXT_3 .' '.$text_3 . '</li>';
} ?>
<?php if($text_4!='') { 
    echo '<li>'. PRODUCT_TEXT_4 .' '.$text_4 . '</li>';
} ?>
 
<?php if(isset($products_video_link)) { 
    echo '<li>'.$products_video_link . '</li>';
} ?> 
<?php if(isset($products_file_1_link)) { 
    echo '<li>'.$products_file_1_link . '</li>';
} ?>    
<?php if(isset($products_file_2_link)) {
    echo '<li>'.$products_file_2_link . '</li>';
} ?>    
<?php if(isset($products_file_3_link)) {
    echo '<li>'.$products_file_3_link. '</li>';
}  ?>
<?php if(isset($products_file_4_link)) {
    echo '<li>'.$products_file_4_link;
} 
if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '</ul></div>';
}
?>

 <?php 
}
 ?>
27 Apr 2016, 10:52 PM
#19
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,683
Plugin Contributions:
0

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

DrByte:

According to the files in the Product Extra Fields plugin, they've added the following lines in the middle of your tpl_product_info_display.php file (assuming you copied the file over to your template, or better yet, assuming you carefully merged its unique changes into your own template):
All of this code takes care of displaying what's in those custom fields:

<?php if (!TPP_GLOBAL_EXTRA_FIELDS_ON_TAB) { ?> <?php if (isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field) || isset($text_1) ||isset($text_2) || isset($text_3) || isset($text_4)) { echo '<div class="files"><div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>'; }?> <?php if($extra_field!='') { echo '<li>'.$extra_field . '</li>'; } ?> <?php if($text_1!='') { echo '<li>'. PRODUCT_TEXT_1 .' '.$text_1 . '</li>'; } ?> <?php if($text_2!='') { echo '<li>'. PRODUCT_TEXT_2 .' '.$text_2 . '</li>'; } ?> <?php if($text_3!='') { echo '<li>'. PRODUCT_TEXT_3 .' '.$text_3 . '</li>'; } ?> <?php if($text_4!='') { echo '<li>'. PRODUCT_TEXT_4 .' '.$text_4 . '</li>'; } ?> <?php if(isset($products_video_link)) { echo '<li>'.$products_video_link . '</li>'; } ?> <?php if(isset($products_file_1_link)) { echo '<li>'.$products_file_1_link . '</li>'; } ?> <?php if(isset($products_file_2_link)) { echo '<li>'.$products_file_2_link . '</li>'; } ?> <?php if(isset($products_file_3_link)) { echo '<li>'.$products_file_3_link. '</li>'; } ?> <?php if(isset($products_file_4_link)) { echo '<li>'.$products_file_4_link; } if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) { echo '</ul></div>'; } ?> <?php } ?>

Its all there but still not working.
28 Apr 2016, 2:47 AM
#20
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: How to Add Custom Fields for Materials & Dimensions when adding products?

Your not going to echo any added table columns without adding that "specific" column to the query in the product_info header_php.php file