Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Extra Fields


KiLLaH

Recommended Posts

I tried to install Extra Fields. Everything seems fine but when I tried to add a field and press the "add field" button this comes up:

 

1054 - Unknown column 'languages_id' in 'field list'

insert into products_extra_fields (products_extra_fields_name, languages_id, products_extra_fields_order) values ('dfsdfsdf', '0', '')

[TEP STOP]

 

Seems lite a langugare error? I have Swedish and English languge, thats it.

 

THEN when I wan't to look at a produkt in the store this comes up:

 

1146 - Table 'ibanezshop_se.products_to_products_extra_fields' doesn't exist

SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM products_extra_fields pef LEFT JOIN products_to_products_extra_fields ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=332 and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='4') ORDER BY products_extra_fields_order

[TEP STOP]

 

I tried this contrib on a fresh store but got the same table so I'm guessing I must be doing something wrong...I would really like for this to work, I would solve a handfull of problems for me so PLEASE, help me out!

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 225
  • Created
  • Last Reply

Top Posters In This Topic

did you upload the sql file ?

If yes, you will need to open the file in insert the script as raw sql scripting using phpmyadmin.

 

This will still only fix the second part of your problem.

 

There is a universdal problem witht the contribution in advanced_search_result.php

Link to comment
Share on other sites

  • 1 month later...

I am not sure what my problem here is.. using the latest version extra_fields_v2_0i

The problem is when I view the product I can not see the extra fields..

 

 

I did a very careful install on an almost clean copy of osC.

Already installed: Bundled products

Page Editor

Unsold carts report

add multiple products per page (hummmmmm wonder if.....)

 

I did the SQL query and the DB's got updated properly

The link to control the extra fields is in the admin

I sucessfully added a field

I altered 2 items to add comment into the field

when updating the item in the admin I can see the field and the info attached to it

the lights next to the 2 extra fields are GREEN (on)

 

I went into phpMyAdmin and can see the tables and the proper info there..

Table: products_extra_fields

products_extra_fields_id products_extra_fields_name products_extra_fields_order products_extra_fields_status languages_id

1 HAZMAT 1 1 0

2 test field

 

Table: products_to_products_extra_fields

products_id products_extra_fields_id products_extra_fields_value

33 1 Flamable Item

33 2 second extra field

 

Any ideas????

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

I finally have this contributions working. Only when I duplicate a product in the admin, the extra fields from the original article aren't copied in the duplicated article.

 

Does anyone now how to do this?

Link to comment
Share on other sites

Please, can someone help me here.. I have reworked this contribution several times now and everything is fine exceot I can not see the extra fields in the cart.. I see them in the admin, they are added to the DB properly but do not show up in the cart

 

I am not sure what my problem here is.. using the latest version extra_fields_v2_0i

The problem is when I view the product I can not see the extra fields..

I did a very careful install on an almost clean copy of osC.

Already installed: Bundled products

Page Editor

Unsold carts report

add multiple products per page (hummmmmm wonder if.....)

 

I did the SQL query and the DB's got updated properly

The link to control the extra fields is in the admin

I sucessfully added a field

I altered 2 items to add comment into the field

when updating the item in the admin I can see the field and the info attached to it

the lights next to the 2 extra fields are GREEN (on)

 

I went into phpMyAdmin and can see the tables and the proper info there..

Any ideas????

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

Well I found something to help me here.. evidently this contrib is not compatible when you have the SE Friendly URLS set as TRUE.. so I have gotten the extra fields to show up now.... has anyone out there gotten around this?? Though I'm not sure if it will make any long term difference because the 2 product URLS are identical with it set to true or false

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

I also have problems with product extra fields... The installation went fine, I got no errors, I added a test field, modified it's value for a keyboard, in the preview everything is fine. If I purchase the keyboard, in the confirmation email I see the field (I've done that optional step, to have extra fields written in emails), but I still can't see the information in the product information page... I used sts, but I temporarily uninstalled it (I had to do an upgrade anyway) because I thought there was a problem with some placeholders or smth, but even without STS, I can't see the extra fields... I've seen that at least 3 or 4 people wrote here about the same problem, but I haven't seen a solution... :(

 

If someone knows what the problem is, I'm sure a lot of user would apreaciate the solution, including me :)

 

Thanks in advanced for anyone who can provide a fix for this great contribution...

 

Best of luck

Link to comment
Share on other sites

Question for folks who have this MOD runing fine: when you copy an item, dis you also noticed that the extra fields values are not duplicated to the new product? or did I miss something?

 

Thanks for you feedback

Link to comment
Share on other sites

I noticed that the search is not working after I installed the product extra fields contribution. I get the following error in advanced_search_result.php:

1066 - Not unique table/alias: 'pd'

select count(distinct p.products_id) as total from (products p left join products_to_products_extra_fields p2pef on p.products_id=p2pef.products_id) left join manufacturers m on m.manufacturers_id=p.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%test%' or p.products_model like '%test%' or m.manufacturers_name like '%test%' or p2pef.products_extra_fields_value like '%test%' or pd.products_description like '%test%') )

My line goes something like:

$from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

instead of the old line

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

 

I know it's somewhere arround line 215, where the $from_str is build, but I can't figure out where I screw up... :(. If you have the search running fine, could you please show me the lines from the file ?

 

And the product extra fields still don't show up in the product_info page... No clues to that either ? I removed STS and HTC (for other purposes) and tested without them, and I still don't see the extra fields... :(

 

Thanks.

Edited by umc
Link to comment
Share on other sites

I've got mod installed and seems to be working fine. I've also got the Master/Slave mod set up.

 

My question is how do I keep a field from showing up in a table if it is empty?

 

An example can be seen at http://cbhotsy.com/code_devsoft/catalog/pr...&products_id=35

 

You'll see that I've got a column labeled Fuel. However, for this product I don't want it to show. But in other products I do want it to show up.

 

Thanks

Link to comment
Share on other sites

I must have been blind for not seing frost77's post earlier about the wrong querry... Now the search works fine... but I still can't see the extra fields in the product_info page... Nobody found an answer ? I can't disable SE Friendly URLS as wkdwich said, because I use Advanced SEO URLs and it won't work if I disable SE Friendly URLS. Since lot's of people are having the same problem I don't think there's something wrong with my store... (I hope ^_^).

 

Any tips or bits advice will be most welcome...

 

Best of luck.

Link to comment
Share on other sites

Question for folks who have this MOD runing fine: when you copy an item, dis you also noticed that the extra fields values are not duplicated to the new product? or did I miss something?

 

Thanks for you feedback

 

I would like to know how to get this to work as well :D

Link to comment
Share on other sites

Question for folks who have this MOD runing fine: when you copy an item, dis you also noticed that the extra fields values are not duplicated to the new product? or did I miss something?

 

Thanks for you feedback

 

Well I don't have it running perfect but I have changed it to add the extra fields when you dupe a product.

 

In admin/categories.php find**:

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
		$product_query = tep_db_query("select products_quantity, products_model, products_image, products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
		$product = tep_db_fetch_array($product_query);

 

**Your $product_query may be different - I have extra images installed. You will be adding the following code beneath this $product = tep... line so first find the elseif then the $product = below the database query.

 

Add below:

// BOF: Extra fields to database on duplicate
		$xf_query = tep_db_query("select  products_id, products_extra_fields_id, products_extra_fields_value  from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = '" . (int)$products_id . "'");

		$xfield = tep_db_fetch_array($xf_query);
// EOF: Extra fields to database on duplicate

 

Next find:

$dup_products_id = tep_db_insert_id();

 

Add below:

		   tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$dup_products_id . "', '" . tep_db_input($xfield['products_extra_fields_id']) . "', '" . tep_db_input($xfield['products_extra_fields_value']) . "')");
// EOF: Extra fields to database on duplicate

 

Now you should be able to duplicate a product with extra fields included. Works on my test site. What doesn't work has to do with searches. If I search alphabetical keywords the results are accurate for the text in extra fields but if I search using numbers and/or symbols such as 10 x 14 I get no results even though I have an extra field with that value. Would appreciate anyone's help with that!

 

Thanks,

Maureen

Link to comment
Share on other sites

Update on the search problem -- it is not what is typed as a keyword it is where the product item is located. If it is in top category it is not found; if I put it into a category it works. But... that seems to be the way my entire search is working not necessarily effects of this contribution.

Link to comment
Share on other sites

One other thing I noticed and was wondering if someone could help me out. When I do a search for an item in the extra fields it is fine.. but if i search for a model number it shows the same items 3 times??

Link to comment
Share on other sites

The code of Maureen was't working for me. It only copied one extra field, instead of the four I have.

 

I changed the code a little bit to:

 

// BOF: Extra fields to database on duplicate

$xf_query = tep_db_query("select products_id, products_extra_fields_id, products_extra_fields_value from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = '" . (int)$products_id . "'");

while($xfield = tep_db_fetch_array($xf_query)) {

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) values ('" . (int)$dup_products_id . "', '" . tep_db_input($xfield['products_extra_fields_id']) . "', '" . tep_db_input($xfield['products_extra_fields_value']) . "')");

}

// EOF: Extra fields to database on duplicate

 

 

and added it all together after:

$dup_products_id = tep_db_insert_id();

 

Now all my extra fields are copied when I dupe them.

Link to comment
Share on other sites

hello,

 

i'm using my localhost ( using wamp )

HTTP Server: Apache/2.0.55 (Win32) PHP/5.1.2

PHP Version: 5.1.2 (Zend: 2.1.0)

Database: MySQL 5.0.18-nt

 

i just installed the extra_fields_v2_0i, and i found that the code <? echo .. must replace to <?php echo .. in admin/product_extra_fields.php. i'm a newbie- i found that problem, but dont know the reason why (some body explain to me ? )

 

the next problem that i can't solve when i add new field e.g : years :

it didn't showed in that page (admin/product_extra_fields.php) , but it was saved at database and show at product_info.php

everything work normally except it didn't show any field name at admin/product_extra_fields.php.

so it is not possible for me to update / delete the old field name that i have added.

 

i wish somebody can help me to solve this problem

Link to comment
Share on other sites

hello,

the next problem that i can't solve when i add new field e.g : years :

it didn't showed in that page (admin/product_extra_fields.php) , but it was saved at database and show at product_info.php

everything work normally except it didn't show any field name at admin/product_extra_fields.php.

so it is not possible for me to update / delete the old field name that i have added.

 

i wish somebody can help me to solve this problem

 

do you have the search engine friendly URLs turned on on the control panel?? this will be the cuase of the field not showing up in the cart even though it has written everywhere

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

do you have the search engine friendly URLs turned on on the control panel?? this will be the cuase of the field not showing up in the cart even though it has written everywhere

 

 

thx, for reply

but i dont turn on the SE friendly URLs in my control panel, it's still false.

 

i'm confuse, may it be the problem about my apache,mysql, php setting ?

 

also if i click at the green icon ( normally at red icon ). it will show :

 

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

 

update products_extra_fields set products_extra_fields_status = '1' where products_extra_fields_id=

 

[TEP STOP]

Link to comment
Share on other sites

Hi!

 

I just installed the PEF contrib on a fresh install of OSCMS2, Imported the SQL file and copied all the PEF files, but when I try to add a new Product Field this comes up:

 

 

1054 - Unknown column 'languages_id' in 'field list'

 

insert into products_extra_fields (products_extra_fields_name, languages_id, products_extra_fields_order) values ('dfsdfsdf', '0', '')

 

[TEP STOP]

 

 

Seems like there is some part of the SQL file that's missing and since I can't program I really don't know how to fix it. Is there anything else I need to do to make it work?

 

Please help me out! I really need this contrib to work...

Link to comment
Share on other sites

Hi,

I installed this contrib and it works fine. But there?s one thing I?m missing.

Is it possible to display the extra fileds when listing all articles of an categorie? I guess there must be a modification of the index.php, isn?t it?

 

can anybody help me with it?

 

JoxWayne

Link to comment
Share on other sites

Hi!

 

I just installed the PEF contrib on a fresh install of OSCMS2, Imported the SQL file and copied all the PEF files, but when I try to add a new Product Field this comes up:

1054 - Unknown column 'languages_id' in 'field list'

 

insert into products_extra_fields (products_extra_fields_name, languages_id, products_extra_fields_order) values ('dfsdfsdf', '0', '')

 

[TEP STOP]

Seems like there is some part of the SQL file that's missing and since I can't program I really don't know how to fix it. Is there anything else I need to do to make it work?

 

Please help me out! I really need this contrib to work...

 

double check that you have successfuly created the 2 follwing tables in your database by going to your phpMyAdmin:

 

the structure of your "products_extra_fields" table contains the fields:

 

products_extra_fields_id

products_extra_fields_name

languages_id

products_extra_fields_order

products_extra_fields_status

 

the structure of your "products_to_products_extra_fields" table contains the fields:

 

products_id

products_extra_fields_id

products_extra_fields_value

 

You must have done sonething wrong when injection teh SQL query when installing

 

hope this helps

Edited by pixclinic
Link to comment
Share on other sites

Ok... there have been people having the same problem as I did... Here are their posts:

 

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=787317

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=771277

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=846297

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=709172

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=737856

 

and my post: http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=853480

 

This are only some of the problems... Who knows how many others have this same problem... :( So it can't be something we're all screwing up... No one has any ideea where it goes wrong ? :'(

Link to comment
Share on other sites

Does anyone know how to get the extra fields as a drop-down on the search page? Say I have a extra field named size and on the search page I wanted a drop-down to be

 

select size

|- small

|- medium

|- large

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