Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Extra Fields


KiLLaH

Recommended Posts

I have a simple problem at displaying more than one extra field at the product page using STS.

 

I pasted this code:

// START: Extra Fields Contribution v2.0b
$extra_fields_query = tep_db_query("SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=".$HTTP_GET_VARS['products_id']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."') ORDER BY products_extra_fields_order");
$counter = tep_db_num_rows($extra_fields_query);
if($counter > 0){
while($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if(!$extra_fields['status'])  // show only enabled extra field
	continue;
	$template['product_extra_field_name'] = '<b>'.$extra_fields['name'].': </b>';
	$template['product_extra_field_value'] = $extra_fields['value'].'<br>'; 
}
} else {
$template['product_extra_field_name'] = '';
$template['product_extra_field_value'] = ''; 
}	
// END: Extra Fields Contribution

into sts_product_info.php file and it does display the extra fields but it shows only the last field and not all. I checked to see if I enabled all the fields and all are, so it's not a problem from there...

 

For example: Say I have a DVD, that I need to display extra fields with the following order:

 

1. Year

2. Duration of the movie

3. Director

4. Actors

5. Subtitles

 

The page only shows the last field which is Subtitles, even though all other fields are filled properly. Anyone has a workaround?

 

Thanks in advance

There's a diference between living & BEING ALIVE!

Link to comment
Share on other sites

  • Replies 225
  • Created
  • Last Reply

Top Posters In This Topic

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?

 

Is here anybody who can give me an advice how to set the extra field into my catalog-overview?

 

Jox

Link to comment
Share on other sites

  • 4 weeks later...
First, EXCELLENT CONTRIBUTION! Thank You! I have one minor issue. OSC automatically adds the backslash character for any word with an apostrophe, yet the backslash is showing up in my products_extra fields on the product_info pg. ex. what\'s instead of what's Any help would be appreciated.

Thanks

Tom

 

posted this back in Dec 05 and never received a reply. Anybody have any ideas? Very annoying as some of my 'extra_fields' have long descriptions in them and I am always running into this problem.

Thanks

Link to comment
Share on other sites

I have a problem with search after install Product Extra Fields v 2.0j. It said:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /usr/home/rungun/domains/thaione.com/public_html/catalog/includes/header.php:170) in /usr/home/rungun/domains/thaione.com/public_html/catalog/includes/boxes/categories.php on line 13

 

Please help,

thanks

Link to comment
Share on other sites

I have a problem with search after install Product Extra Fields v 2.0j. It said:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /usr/home/rungun/domains/thaione.com/public_html/catalog/includes/header.php:170) in /usr/home/rungun/domains/thaione.com/public_html/catalog/includes/boxes/categories.php on line 13

 

Please help,

thanks

 

it's kind of unusual that your header.php is trying to call tep_show_category()

did you work on this file, trying to add some MODs?

Link to comment
Share on other sites

it's kind of unusual that your header.php is trying to call tep_show_category()

did you work on this file, trying to add some MODs?

i run the site with a template monster, and this my first mod. orry I don?t know about PHP I am a simple mortal....please HELP ME!! Thanks for your time and patience.

Link to comment
Share on other sites

To anybody who is still having problems getting the extra fields to show up in the catalogue (the products_info_ page.. After many hours of searching and checking, this worked for me.

 

In catalog\product_info.php

 

FIND around line 120:

 

<p><?php echo stripslashes($product_info['products_description']); ?></p>

 

And add this immediately below it:

 

<?PHP

// START: Extra Fields Contribution

$extra_fields_query = tep_db_query("

SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value

FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef

LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf

ON ptf.products_extra_fields_id=pef.products_extra_fields_id

WHERE ptf.products_id=".$HTTP_GET_VARS['products_id']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')

ORDER BY products_extra_fields_order");

 

while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {

if (! $extra_fields['status']) // show only enabled extra field

continue;

echo '<b>'.$extra_fields['name'].': </b>';

echo $extra_fields['value'].'<BR>';

}

// END: Extra Fields Contribution

?>

 

Hope this helps somebody out!

Link to comment
Share on other sites

Im wondering if anyone has a working advanced_search.php file for this mod?

 

i want to be able to list each of the extra fields on the search page so that customers can search by all the current ways but also then by each of the extra fields as well

 

I looked at the one with the extra 4 fields in the latest zip but it doesnt seem to do much?

Link to comment
Share on other sites

Hrmm.. Not a bad idea.. When you do a "quick find" search for the extra field the products will pop-up correctly.. But it would be useful to let the customer search specifically for an "extra field". I'm gunna look into this.

Link to comment
Share on other sites

Hrmm.. Not a bad idea.. When you do a "quick find" search for the extra field the products will pop-up correctly.. But it would be useful to let the customer search specifically for an "extra field". I'm gunna look into this.

 

I solved this by making the Oscom engine search in my keywords field (assuming that you have custom metatags, if you don't, you're missing somethimg in your store, haha) and I modified by advanced search by adding the field products_keywords in what needs to be searched. And of course, I add the most important contant of my extra fields to the keyword field when I create my products

Edited by pixclinic
Link to comment
Share on other sites

please need help with advanced search

i retreive the following error:

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

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_extra_fields pef where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pef.products_extra_fields_id=p2pef.products_extra_fields_id and ((pd.products_name like '%cilindru%' or p.products_model like '%cilindru%' or m.manufacturers_name like '%cilindru%' or pef.products_extra_fields_name like '%cilindru%' or p2pef.products_extra_fields_value like '%cilindru%') )

 

[TEP STOP]

 

i have tried everything posted... but nothing new...

 

here is the part of code in advanced search results

 

 

if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {

$select_str .= ", SUM(tr.tax_rate) as tax_rate ";

}

 

// START: Extra Fields Contribution - by Infobroker

// $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(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";

$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, " . TABLE_PRODUCTS_EXTRA_FIELDS . " pef";

// END: Extra Fields Contribution - by Infobroker

// START: Extra Fields Contribution

// $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(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";

// $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";

// END: Extra Fields Contribution

 

 

 

if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {

if (!tep_session_is_registered('customer_country_id')) {

$customer_country_id = STORE_COUNTRY;

$customer_zone_id = STORE_ZONE;

}

$from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";

}

 

 

// CROWTHER REMOVED $from_str LINE BELOW FOLLOWING SQL ERRORS. THIS WAS AFTER ADDING EXTRA PRODUCT DETAILS MODULE.

// $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 

// START: Extra Fields Contribution - by Infobroker

$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pef.products_extra_fields_id=p2pef.products_extra_fields_id";

// $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

// END: Extra Fields Contribution - by Infobroker

 

if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {

if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) {

$subcategories_array = array();

tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);

 

$where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";

 

for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {

$where_str .= " or p2c.categories_id = '" . (int)$subcategories_array[$i] . "'";

}

 

$where_str .= ")";

} else {

$where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";

}

}

 

if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {

$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

}

 

if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {

$where_str .= " and (";

for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {

switch ($search_keywords[$i]) {

case '(':

case ')':

case 'and':

case 'or':

$where_str .= " " . $search_keywords[$i] . " ";

break;

default:

$keyword = tep_db_prepare_input($search_keywords[$i]);

 

// START: Extra Fields Contribution - by Infobroker

// $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";

$where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%' or pef.products_extra_fields_name like '%" . tep_db_input($keyword) . "%' or p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%'";

// END: Extra Fields Contribution - by Infobroker

// START: Extra Fields Contribution

// $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";

// $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%' or p2pef.products_extra_fields_value like '%" . tep_db_input($keyword) . "%'";

// END: Extra Fields Contribution

 

if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";

$where_str .= ')';

break;

}

 

PLEASE HELP!

Link to comment
Share on other sites

  • 2 weeks later...

This is an awesome contrib - however i see a lot of people asking, but havent found the answer - Is it possible to add the extra fields to the productlisting and new_products.php display?

 

Well actually im sure its posible, question is...how?

 

 

 

Thank you in advance and for a great contrib.

Link to comment
Share on other sites

1054 - Unknown column 'p2pef.manufacturers_id' in 'on clause'

 

I have a clean and successful installation using oscommerce-2.2ms2-051113 with the UK Based osCommerce 2.2 contribution.

 

No other changes made before installing extra_fields_v2_0j.

 

Now, when I do a search, I receive the error:

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 using(manufacturers_id) left join specials s on p.products_id = s.products_id, 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%') )

Is anybody able to suggest a fix for this? I have seen many posts in the forum, but I have not found one that can solve the problem.

 

My MySQL version is 3.23

Link to comment
Share on other sites

I have done several subsequent installations and I am still having the same problem

 

In the most recent installation, I merged the Extra Fields files into the osc distribution and uploaded it as part of a new installation (having removed all of the previous files from the server and creating a new database specifically for each new installation). The most recent installation included nothing extra whatsoever - no other contributions and no other edits.

 

Is anybody able to shed some light on this issue for me?

 

What additional information do I need to provide?

 

I have been at this constantly now for two days and two nights :'( . I would really like to move on to something else, but having extra fields is essential to this shop.

 

please help!

Link to comment
Share on other sites

1054 - Unknown column 'p2pef.manufacturers_id' in 'on clause'

 

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 using(manufacturers_id) left join specials s on p.products_id = s.products_id, 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%') )

I think that I have found the solution to 1054 - Unknown column 'p2pef.manufacturers_id' in 'on clause'

 

After much poking about (I am a MySQL and PHP neophyte) I discovered that in the MySQL table products_to_products_extra_fields, there was no entry for manufacturers_id - therefore, I created this field using the same paramaters as existed for manufacturers_id in the table products.

 

As soon as I did this, the search woked perfectly.

 

As an additional test, I created a new installation with an additional line to the "product_extra_fields.sql" file of manufacturers_id int(11) default NULL, )as included in the contribution)

 

...

 

DROP TABLE IF EXISTS products_extra_fields;

CREATE TABLE products_extra_fields (

products_extra_fields_id int NOT NULL auto_increment,

products_extra_fields_name varchar(64) NOT NULL default '',

products_extra_fields_order int(3) NOT NULL default '0',

# Change to make the new extra field active by default

# products_extra_fields_status tinyint(1) NOT NULL default '0',

products_extra_fields_status tinyint(1) NOT NULL default '1',

PRIMARY KEY (products_extra_fields_id)

);

 

DROP TABLE IF EXISTS products_to_products_extra_fields;

CREATE TABLE products_to_products_extra_fields (

products_id int NOT NULL,

products_extra_fields_id int NOT NULL,

products_extra_fields_value varchar(64),

manufacturers_id int(11) default NULL,

PRIMARY KEY (products_id,products_extra_fields_id)

);

 

ALTER TABLE `products_extra_fields` ADD `languages_id` INT( 11 ) DEFAULT '0' NOT NULL ;

 

Can anybody in the know, tell me if I have actually solved the problem, or if other problems await me in the future?

 

If this has in fact solved the problem, should this "extra" line be included as an update to the Contribution?

Link to comment
Share on other sites

  • 3 weeks later...
This contribution works perfectly. Now can anyone direct me to a SQL script that can populate ALL of my extra fields that I have created to the correct product?

 

Any help is appreciated!

 

Best regards.

 

Easy Populate can do this although I think that it is a little awkward...

 

http://www.oscommerce.com/community/contributions,1838

 

You need to create a tab delimted csv file in this format, with a separate line for EAcH of the extra fields:

v_products_model	v_products_extra_fields_name	v_products_extra_fields_id	v_products_id	v_products_extra_fields_value	EOREOR
98765f	Extra-Field-1	1	60	Value_1	EOREOR
98765f	Extra-Field-1	60	Value_1	EOREOR
98765f	Extra-Field-1	60	Value_1	EOREOR

If you have 10 products with 5 extra fields, then you would have a 10 line csv for the main product info and a 50 line csv for the extra fields.

 

I am working on a database for entering all of the information about a product, including the extra fields which can create the two required csv, but I am busy and it is taking a little time.

 

If anyone has a quicker way of creating the tab-delimited CSV for extra fields, I would love to see it

Link to comment
Share on other sites

Hi

 

I installed this contrib and all went OK, no errors etc and I can copy the product into another category with no probs but the extra fields are not being displayed when you pick on categories in left column but they do display when you pick on the link in the product name column.

 

What I want to be able to do is to have the extra fields showing in the product listing part of index.php. I think its part of the SQL query but can't get it to work.

 

Thanks

 

ian

Link to comment
Share on other sites

  • 2 weeks later...

Hello

 

Im installing the version:Product Extra Fields v 2.0j

 

in last version: osCommerce 2.2 Milestone 2 Update 060817

 

 

and in this step 8 say that I must find this:

 

  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(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";

 

in osCommerce 2.2 Milestone 2 Update 060817 that line is different:

 

$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";

 

that different I think is for update 060817, for compatibility with MySQL 5.0

 

different are here:

 

old: ... using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join ...

 

new: ... using(manufacturers_id) left join ...

 

 

That line on step 8 indicate that must be replace by:

 

$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";

 

 

 

comparing the code and for compatibility with MySQL 5.0 it will be?:

 

$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 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 

 

Any can confirm that ?

 

Thank

Edited by nicko107
Link to comment
Share on other sites

  • 2 weeks later...

Hi there Everybody!

 

i use http://www.oscommerce.com/community/contri...ttribute+search

as a base, modified for PEF.

Now my code look like.advanced_search.php

 

<?php

$attributes_pef_query = tep_db_query("select * from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where languages_id = '" . (int)$languages_id . "'");

while ($attributes_pef = tep_db_fetch_array($attributes_pef_query)) {?>

<tr>

<td class="fieldKey"><?php echo $attributes_pef["products_extra_fields_name"]; ?></td>

<?php

 

$option_values_pef_query = tep_db_query("select * from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p where p.products_extra_fields_id =" . $attributes_pef["products_extra_fields_id"] . " ");

 

echo '<td class="fieldValue">';

echo '<select name="'.$attributes_pef["products_extra_fields_name"].'">';

echo '<option selected></option>';

while ($option_values_pef = tep_db_fetch_array($option_values_pef_query)) {

echo '<option value="'.$option_values_pef["products_extra_fields_id"].'">'.$option_values_pef["products_extra_fields_value"].'</option>';

}

echo '</select>'; ?>

</td>

</tr><?php } ?>

it shows, all Produkt Extra Fields in dropdown

my advanced search_result.php look like

 

...

 

$where_str .= " and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 ";

 

// search in extra fields
 $attributes_pef_query = tep_db_query("select * from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " ");
  $option_value_selected_pef = false;
  while ($attributes_pef = tep_db_fetch_array($attributes_pef_query)) {
  if (isset($HTTP_GET_VARS["'product_extra_field_name'"]) && !empty($HTTP_GET_VARS["'product_extra_field_name'"]))
	  $option_value_selected_pef = true;
 }
 if ($option_value_selected_pef == true){
  	$attributes2_pef_query = tep_db_query("select * from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " ");
  while ($attributes2_pef = tep_db_fetch_array($attributes2_pef_query)) {
	  if (isset($HTTP_GET_VARS[$option_values_pef["products_extra_fields_value"]]) && !empty($HTTP_GET_VARS[$attributes2_pef["products_extra_fields_value"]])) {
		  $str_selected_values_pef .= $HTTP_GET_VARS[$attributes2_pef["products_extra_fields_value"]].",";
	}
  }
  $str_selected_values_pef = substr($str_selected_values_pef,0,strlen($str_selected_values_pef) - 1);
  $where_str .= " and p2pef.products_extra_fields_id in (" . $str_selected_values_pef .") and p.products_id = p2pef.products_id";
			}

 

My Problem $option_value_selected_pef dont becom value true!

I can see value in array

[test1] => 1

[test2] =>

[test3] =>

[test4] =>

 

when i set $option_value_selected_pef = false; to $option_value_selected_pef = true;

i can see in the query $where_str .= " and p2pef.products_extra_fields_id in (" . $str_selected_values_pef .") and p.products_id = p2pef.products_id";

 

$str_selected_values_pef dont have value

 

can anybody help? (please)

 

cz

Edited by beruska77
Link to comment
Share on other sites

Not sure of a response but must ask.

 

 

I'm setting up to sell CDs. I want to be able to put the songs with each CD, and have them seen with the CD, but I want people to also want people to be able to do a search by the song title (and not have to enter them as seperate products). Is this the right contribution for that (the songs as extra fields)? I noticed in this thread that some people were having problems with search.

 

Thanks if there is a response B)

Link to comment
Share on other sites

Not sure of a response but must ask.

I'm setting up to sell CDs. I want to be able to put the songs with each CD, and have them seen with the CD, but I want people to also want people to be able to do a search by the song title (and not have to enter them as seperate products). Is this the right contribution for that (the songs as extra fields)? I noticed in this thread that some people were having problems with search.

 

Thanks if there is a response B)

 

Do not use this contrib, it would be a nightmare! (and it doesn't make sense for your database design to create fields for song names)

Just list the title of your songs with bullet points in your description, and it will be searchable!

Edited by pixclinic
Link to comment
Share on other sites

Hi there,

 

Just installed this contribution and nothing shows in product info page. I have sts so I have done the extra install for this "products extra fields + sts", but nothing shows. I have a newer version of sts, and the contribution is for rthe old, so maybe thats the problem?

 

I do not use the product_indo.php file much as I have this page implemented in my index.php file, but I have tried to install the code that was going in product_info.php in these pages:

 

product_info.php

sts_product_info.php

index.php

 

but nothing shows.

In admin it works fine

 

I have tried to put the $product_extra_fields_box tag in these pages:

 

product_info.php

sts_product_info.php

sts_display_output.php

sts_template.html

index.php

 

but since my index.php and my product_info.php is the same file, and this is an sts tag, it might not work to put it in index.php.

 

How can I write this tag to put it in index.php ?

 

Please help someone :-)

 

Thanks,

Best regards

Kjolebutikken

Link to comment
Share on other sites

Hi there. I love this contribution... and I think that I would like it better if I could make it work...

 

I just installed Extra_fiels_v2_0j, and everything looks good from the admin panel... and i was able to add in the extra fields without any problem....

 

however, when i goto look at a product, it starts to load, and then I get an error saying

 

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 'and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languag' at line 5

 

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value ,pef.products_extra_fields_status as status 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= and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='1') ORDER BY products_extra_fields_order

 

I do not have any extra contributions installed yet. I literally just copied the files onto my server. Instead of making the changes to each file, i just uploaded the ones that were in the zip file. The instructions said i could do that is there were not any changes made to those files.

 

Please let me know ASAP what I can do to fix this.

 

if you need to see what the page looks like... goto http://www.yourprintersource.com/product_i...3c81b83ceeb18ec

 

Thank you in advance

Link to comment
Share on other sites

Hi everybody,

 

Any idea how to implement the code in product_info.php

 

// START: Extra Fields Contribution v2.0b - mintpeel display fix

 

$extra_fields_query = tep_db_query("

SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value

FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef

LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf

ON ptf.products_extra_fields_id=pef.products_extra_fields_id

WHERE ptf.products_id=". (int) $products_id ." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')

ORDER BY products_extra_fields_order");

 

while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {

if (! $extra_fields['status']) // show only enabled extra field

continue;

echo '<tr>

<td>

<table border="0" width="50%" cellspacing="0" cellpadding="1px"><tr>

<td class="main" align="left" vallign="middle"><b><font size="1" color="#666666">'.$extra_fields['name'].': </b></font>';

echo '<font size="1" color="#666666">' .$extra_fields['value'].'<BR></font> </tr>

</table>

</td>

</tr>';

}

// END: Extra Fields Contribution - mintpeel display fix

 

into html code below the product title (<?php echo $products_name; ?>)

 

i have no idea, but inserted like this now as stated in manual, it displays extra fields at the top of product .. above title and above banner .. useless :huh:

 

thanx

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