Jump to content



Photo
- - - - -

Add More Fields


  • Please log in to reply
180 replies to this topic

#41   brosebro

brosebro
  • Members
  • 1 posts
  • Real Name:bob rosebrock

Posted 28 October 2011 - 21:02

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

Edited by brosebro, 28 October 2011 - 21:03.


#42   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 28 October 2011 - 23:37

That's not code changed by this contribution so you either made a mistake when installing it or that error is from something else. There is a completed file in the archive that you can compare against.

#43   vkd1980

vkd1980
  • Members
  • 62 posts
  • Real Name:Vinod
  • Gender:Male
  • Location:Kochi, Kerala, India

Posted 30 October 2011 - 14:01

Hai Jack,

How can i Display the added fields & Values, separately in Shop Side like Product description

#44   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 30 October 2011 - 14:32

Hai Jack,

How can i Display the added fields & Values, separately in Shop Side like Product description

See the installation instruciton file.

#45   tomisa

tomisa
  • Members
  • 6 posts
  • Real Name:tom de beyer

Posted 31 October 2011 - 14:46

hi jack,

i have installed this wonderful contribution (thanks a lot!!!) and i am very happy with it...i just wondered if there is an 'easy' way to add the new fields to the advanced search of the shop...?

best regards, tom

#46   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 31 October 2011 - 17:53

hi jack,

i have installed this wonderful contribution (thanks a lot!!!) and i am very happy with it...i just wondered if there is an 'easy' way to add the new fields to the advanced search of the shop...?

best regards, tom

No, there's nothing in the code to do that currently. If you have the new field added into the products description and your search code is setup to look at the description, then the new field would be searched automatically. But if you want to be able to search specific fields you add, then that would have to be coded. I'll see about adding that to the next version.

#47   erik1432

erik1432
  • Members
  • 4 posts
  • Real Name:Erik

Posted 31 October 2011 - 22:04

Dear Jack,

I got the contribution working now for couple of days.
Seems to work verry good! Thank you for that.

I found only one problem when deleting extra fields.
When i deleted two fields the easypopulate.php file seems to be not correct.

-----------------------------------------------------------------------------------------------------------------------
$custom_fields[TABLE_PRODUCTS] = array(,,'Verzendkosten' => 'Verzendkosten','Levertijd' => 'Levertijd','gtin' => 'gtin'); // this line is used if you have no custom fields to import/export
$custom_fields[TABLE_PRODUCTS_DESCRIPTION] = array(); // this line is used if you have no custom fields to import/export
-------------------------------------------------------------------------------------------------------------------------

When i deleted the two ,, before 'verzendkosten' everything is working again.
I don't know a lot about php but i thought maybe this will help out others.

Thanks again.

#48   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 31 October 2011 - 23:09

Dear Jack,

I got the contribution working now for couple of days.
Seems to work verry good! Thank you for that.

I found only one problem when deleting extra fields.
When i deleted two fields the easypopulate.php file seems to be not correct.

-----------------------------------------------------------------------------------------------------------------------
$custom_fields[TABLE_PRODUCTS] = array(,,'Verzendkosten' => 'Verzendkosten','Levertijd' => 'Levertijd','gtin' => 'gtin'); // this line is used if you have no custom fields to import/export
$custom_fields[TABLE_PRODUCTS_DESCRIPTION] = array(); // this line is used if you have no custom fields to import/export
-------------------------------------------------------------------------------------------------------------------------

When i deleted the two ,, before 'verzendkosten' everything is working again.
I don't know a lot about php but i thought maybe this will help out others.

Thanks for reporting that. I had some problems getting the deletion to work but I thought I had it fixed since I couldn't reproduce it. I'll have another go at it.

#49   discxpress

discxpress
  • Members
  • 368 posts
  • Real Name:Lecarl Butler
  • Gender:Male

Posted 19 December 2011 - 18:05

Jack,

I noticed that some were having difficuty installing this contrib with Header Tags code. I found it easier to use the admin/categories.php in this package and then 'weave in' the Header Tags edits. Although there were a couple more minor edits that had to bemade but it was alot less pain than the other way.

I hope this help someone.

#50   jack_frost

jack_frost
  • Members
  • 227 posts
  • Real Name:Jesper
  • Gender:Male
  • Location:Denmark

Posted 02 January 2012 - 18:51

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.

Thank you

- Jesper

#51   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 02 January 2012 - 19:49

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.

#52   jack_frost

jack_frost
  • Members
  • 227 posts
  • Real Name:Jesper
  • Gender:Male
  • Location:Denmark

Posted 02 January 2012 - 20:33

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!

#53   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 03 January 2012 - 00:26

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"');



#54   jack_frost

jack_frost
  • Members
  • 227 posts
  • Real Name:Jesper
  • Gender:Male
  • Location:Denmark

Posted 03 January 2012 - 15:41

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.

#55   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 03 January 2012 - 17:31

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.

#56   discxpress

discxpress
  • Members
  • 368 posts
  • Real Name:Lecarl Butler
  • Gender:Male

Posted 05 January 2012 - 07:00

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

#57   Sylvester99

Sylvester99
  • Members
  • 31 posts
  • Real Name:Dwane
  • Gender:Male

Posted 05 January 2012 - 13:38

Hi all,

Has anyone got a screen shot or link of this contrib in action? I would like to see it before I go ahead and install it.

Cheers.

Dwane.

#58   Jack_mcs

Jack_mcs
  • Members
  • 26,560 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 05 January 2012 - 14:37

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.

#59   discxpress

discxpress
  • Members
  • 368 posts
  • Real Name:Lecarl Butler
  • Gender:Male

Posted 06 January 2012 - 00:18

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

#60   bassmaga

bassmaga
  • Members
  • 29 posts
  • Real Name:Kamil
  • Gender:Male
  • Location:Poland

Posted 08 January 2012 - 16:29

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, 08 January 2012 - 16:30.