Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add More Fields


Recommended Posts

This Contrib works great! - but is there a way to make the data field bigger?

 

I would very much like it to be the same size as the product description data field.

 

But i cant figure out were the data input fields size is defined.

If you mean the size of the input field in categories.php, you could find the code that adds the box ( tep_draw_input_field) and add a width attribute to it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • Replies 190
  • Created
  • Last Reply

Top Posters In This Topic

If you mean the size of the input field in categories.php, you could find the code that adds the box ( tep_draw_input_field) and add a width attribute to it.

 

Yes that was what i meant!

 

Width and height! - i would very much like to be able to see more than one line at a time.

 

				 <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15') . ' ' . tep_draw_pull_down_menu($field['field_name'].'[' . (int)$field['language_id'] . ']', $optionArray, $selected) . '  ' . $languages[$field['language_id']-1]['name']; ?></td>
			   <?php } else if ($field['table_name'] == TABLE_PRODUCTS_DESCRIPTION) { ?>
				 <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15') . ' ' . tep_draw_input_field($field['field_name'] . '[' . (int)$field['language_id'] . ']', $field['field_value']) . '  ' . $languages[$field['language_id']-1]['name']; ?></td>
			   <?php } else { ?>
				 <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15') . ' ' . tep_draw_input_field($field['field_name'], $field['field_value']); ?></td>

 

this is the code that defines the input fiel correct?

 

How would one add a width (aand height) attribute to it? (i am not that good at coding)

 

Help is very much apriciated!

Link to comment
Share on other sites

It would be something like changing this part

tep_draw_input_field($field['field_name'], $field['field_value']);

to this

tep_draw_input_field($field['field_name'], $field['field_value'], 'style="width:100px"');

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It would be something like changing this part

tep_draw_input_field($field['field_name'], $field['field_value']);

to this

tep_draw_input_field($field['field_name'], $field['field_value'], 'style="width:100px"');

Yes! - again thank you so much, that worked.

 

However, i would like it to have more lines. like the Text_input field in Product description.

 

if i 'style="width:400px;height:200px"' it doenst make more lines, it only gives me alot of white over and under the one input line.

Link to comment
Share on other sites

Yes! - again thank you so much, that worked.

 

However, i would like it to have more lines. like the Text_input field in Product description.

 

if i 'style="width:400px;height:200px"' it doenst make more lines, it only gives me alot of white over and under the one input line.

It sounds like you want a textarea box. There's nothing in the code to select that. You could change the code in categories.php to use that function but it would apply to them all and require additional setting changes so it may not turn out as you want. I will add this as an option to the next version though.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello Jack,

 

I thought the contribution was working properly until I tried to:

 

(1) When trying to delete a field, I get this error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%%+PLATFORM%%-' at line 1
alter table products_description drop %%+PLATFORM%%-

 

(2) When trying to add a product manually, I get this error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%%+FORMAT%%-, %%+PLATFORM%%-, products_id, language_id) values ('Young Jeezy TM:' at line 1

insert into products_description (products_name, products_description, products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, %%+FORMAT%%-, %%+PLATFORM%%-, products_id, language_id) values ('Young Jeezy TM:103', 'lalala', '', 'Young Jeezy TM:103', 'Young Jeezy TM:103', 'Young Jeezy TM:103', '', '', '32', '1')

 

Also, I can't create a new category.

 

Thanks

Link to comment
Share on other sites

Hello Jack,

 

I thought the contribution was working properly until I tried to:

 

(1) When trying to delete a field, I get this error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%%+PLATFORM%%-' at line 1
alter table products_description drop %%+PLATFORM%%-

 

Also, I can't create a new category.

 

Thanks

The %%+PLATFORM%%- is just used in the product description if you want to display the field on the product page. It shouldn't be used as a name of a field.

 

I didn't add a way to add a category since it is a simple thing to do in admin->Catalog. Plus, it would involve a lot of coding to duplicate it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

Thanks for the reply.

 

The %%+PLATFORM%%- is just used in the product description if you want to display the field on the product page. It shouldn't be used as a name of a field.

Wow, that was my misunderstanding! Thanks for clearing that up.

 

 

I didn't add a way to add a category since it is a simple thing to do in admin->Catalog. Plus, it would involve a lot of coding to duplicate it.

 

That's where I'm having the difficulty. I'm guessing it's a problem in the admin/categories.php file. Thanks for your help

Link to comment
Share on other sites

Hi Jack,

 

I'm get the error below. It's when I go into "Categories/Products" then hit the ">" button!!

 

I'm using 2.3...

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from products p, products_description pd where p.products_id = pd.products_id an' at line 1

 

select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, from products p, products_description pd where p.products_id = pd.products_id and p.products_id = '75'

 

 

 

Any help would be appreciated.

 

Thank you!!

 

Hi,

 

I found solution. This is when you try to preview product in admin.

 

in admin/categories.php

 

find

 

$fieldStr = '';
     $addedFieldsArray = GetAddedProductFields($_GET['pID'], $_GET['cPath']);
     if (count($addedFieldsArray) > 0) {
         foreach ($addedFieldsArray as $fields) {
             if ($fields['table_name'] == TABLE_PRODUCTS) {
                 $fieldStr .= 'p.'.$fields['field_name'];
             }
         }
     }

replace to

 

$fieldStr = '';
  $addedFieldsArray = GetAddedProductFields($_GET['pID'], $_GET['cPath']);
  if (count($addedFieldsArray) > 0) {

	  foreach ($addedFieldsArray as $fields) {
		  if ($fields['table_name'] == TABLE_PRODUCTS) {
			  $fieldStr .= 'p.'.$fields['field_name'] . ', ';
		  }
		  if ($fields['table_name'] == TABLE_PRODUCTS_DESCRIPTION) {
			  $fieldStr .= 'pd.'.$fields['field_name']. ', ';
		  }
	  }
  }

 

find

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, " . $fieldStr . " from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

 

replace to

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, " . $fieldStr . " p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

Edited by bassmaga
Link to comment
Share on other sites

I have a basic question on step #2 of the install (1.3) for V2.3

 

What is the catalog_new_files_only? for new install only?

 

Also, I saw in the forum the some people questioned line 470 and 756, your comment

was to skip them, that comment scares me. Should I follow all the install

steps or not??

Edited by booksfromhome
Link to comment
Share on other sites

Has anyone install the 1.3 version to a 2.3.1 shop? Cause this files are for 2.2 and makes a mess in admin panel...

Yes, it works fine. You have to use the 2.3 install directory if you have a 2.3 shop.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I have a basic question on step #2 of the install (1.3) for V2.3

 

What is the catalog_new_files_only? for new install only?

The instructions state, "Upload all of the files in the catalog_New_Files_only directory." Do you not understand what that sentence is saying? I'm not sure how else to explain the step.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

under the later than 2.3 folder is a catalog folder and a catalog_New_Files_only folder

 

under the catalog folder is a admin folder and a product info file

under the catalog_New_Files_only folder is a admin folder and a include folder

One if for new filed from this contribution. The other is for existing files in case you want to compare them or use them on a new shop.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

here we go again..

 

I am looking over the install of (1.3) for V2.3.1

 

I can not locate "around 470" "around 756" and "around 823"

 

I have a copy of oscommerce 2.3.1 from VODAHOST and the only other add on I have googlefeed 2.9

The line numbers are approximate and may not match your file for a number of reasons. There are completed files in the package that you can compare against though.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks for this Contribution.

 

 

I have the contribution installed, and can see the "added fields" from the products edit page.

 

However I do not see it displayed in the actual webpage,

 

I also tried adding a field called ##+TEST1##- just playing around but now it says

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

alter table products_description drop ##TEST1##-

 

[TEP STOP]

 

when i try to delete

 

and it says

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

select ##TEST1##- as field_value from products_description where products_id = 7 and language_id = 1

 

[TEP STOP]

 

it or go edit my products. I'm still very new at this :( Any help would be appreciated!

Edited by wooha
Link to comment
Share on other sites

Thanks for this Contribution.

 

 

I have the contribution installed, and can see the "added fields" from the products edit page.

 

However I do not see it displayed in the actual webpage,

 

I also tried adding a field called ##+TEST1##- just playing around but now it says

When you add a field, there is a field name and a display name. For the field name, it needs to be letters and numbers, no spaces or special characters. The display name can be anything (probably) but it would make more sense to name it similar, or the same as, to the field name. So, in your example, the field name could be test1 and the displayname could be Test 1. In the products edit page when you add it to the description, you use the display name in all capitals, which means it would be ##+TEST 1##-

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

does this addon also adds more fields to the field products_name?

I'm sorry but I don't understand your question. But taking it as stated, you can't add a field to field, even if you edited the database directly.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I hate to keep bugging you about this but its important to me.

 

If I search for line 470 "elseif (temp_not_null)" in your completed files (admin/categories.php) there are no lines that have have "elseif (temp_not_null)"

 

what am I missing

Maybe you are using the wrong version for your oscommerce version. Or maybe you are using instructions which contain a mistake, as covered in this thread. Ot maybe that file has been edited and no longer resembles a standard file.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...