Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Extra Fields


KiLLaH

Recommended Posts

Hi everybody,

 

Any idea how to implement the code in product_info.php

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

 

post your product_info.php file, I will fix this

Link to comment
Share on other sites

  • Replies 225
  • Created
  • Last Reply

Top Posters In This Topic

post your product_info.php file, I will fix this

 

here's the part of page that you need :)

 

<!-- body //-->

<div align="center">

<table border="0" width="990" cellspacing="0" cellpadding="0" class="maincont_tb">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_left_td">

<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0" class="leftbar_tb">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table>

</td>

<!-- body_text //-->

<td width="100%" valign="top" class="maincont_mid_td"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php

if ($product_check['total'] < 1) {

?>

<tr>

<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<?php

} else {

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_beseda, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

 

/// osplayer v2 start

$product_mp3['folder'] = tep_get_mp3_folder($product_info['products_id']) ;

/// osplayer v2 end

 

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

 

 

if (tep_not_null($product_info['products_model'])) {

$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';

} else {

$products_name = $product_info['products_name'];

}

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

//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED

if(tep_session_is_registered('wishlist_id')) {

?>

<tr>

<td class="messageStackSuccess"><?php echo PRODUCT_ADDED_TO_WISHLIST; ?></td>

</tr>

<?php

tep_session_unregister('wishlist_id');

}

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><? include("./HBRtop/hioxBannerRotate.php") ?>

<tr>

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

<td class="pageHeading" align="right" valign="top"><?php if ($product_info['products_price'] == 999999){ echo '<a href=contact_us.php>Info:<br>03 492 39 00</a>'; }else{ echo "<div id=\"products_price_div\">".$products_price."</div><input type=\"hidden\" id=\"tmp_price\" name=\"tmp_price\" value=\"".$products_price."\"><input type=\"hidden\" id=\"tmp_att\" name=\"tmp_att\" value=\"\">";}/*BRECIPRICE*/ ?><?/*if($HTTP_SERVER_VARS['REMOTE_ADDR']=="myip"){ */?><script language="javascript">init(document.getElementById('tmp_price').value);</script><?/*}*/?></td>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

 

thanx

Edited by gregy
Link to comment
Share on other sites

here's the part of page that you need :)

thanx

 

I wrote "post your product_info.php file" not the beginning of the file :-) please provide the entire file

Link to comment
Share on other sites

Contrib works great, but it's cutting off characters on the product info page. I read in another thread to change the sql code:

products_extra_fields_name varchar(64)

 

to:

products_extra_fields_name varchar(255)

 

But that didn't change anything at all. It still get's cut off midway (after a certain amount of characters)

Link to comment
Share on other sites

Contrib works great, but it's cutting off characters on the product info page. I read in another thread to change the sql code:

products_extra_fields_name varchar(64)

 

to:

products_extra_fields_name varchar(255)

 

But that didn't change anything at all. It still get's cut off midway (after a certain amount of characters)

 

an url where we can see this?

Link to comment
Share on other sites

I wrote "post your product_info.php file" not the beginning of the file :-) please provide the entire file

extra fields displaying above , wrongly

Similar problem I have tried moving the code below the heading but it displaces the right info box which ends up bottom left, also I am using m_s contrib if you could help??

 

 

START PRODUCT_INFO

 

<?php

/*

$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

//rmh M-S_multi-stores edited next line

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_STORES . " p2s where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and p.products_id = p2s.products_id and p2s.stores_id = '" . STORES_ID . "' and pd.language_id = '" . (int)$languages_id . "'");

$product_check = tep_db_fetch_array($product_check_query);

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php

if ($product_check['total'] < 1) {

?>

<tr>

<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<?php

} else {

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

 

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

 

//rmh M-S_pricing begin

/*

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

*/

$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);

$products_price=$pf->getPriceString();

//rmh M-S_pricing end

 

if (tep_not_null($product_info['products_model'])) {

$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';

} else {

$products_name = $product_info['products_name'];

}

?>

<?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="2px"><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

?>

 

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">

<?php

if (tep_not_null($product_info['products_image'])) {

?>

<table border="0" cellspacing="0" cellpadding="2" align="right">

<tr>

<td align="center" class="smallText">

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

</td>

</tr>

</table>

<?php

}

?>

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

<?php

//rmh M-S_fixes begin

// $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");

// $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

// $products_attributes = tep_db_fetch_array($products_attributes_query);

// if ($products_attributes['total'] > 0) {

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

//rmh M-S_fixes end

?>

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>

</tr>

<?php

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

$products_options_array = array();

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

</tr>

<?php

}

?>

</table>

<?php

}

?>

</td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$reviews = tep_db_fetch_array($reviews_query);

if ($reviews['count'] > 0) {

?>

<tr>

<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if (tep_not_null($product_info['products_url'])) {

?>

<tr>

<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>

</tr>

<?php

} else {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

</td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

extra fields displaying above , wrongly

Similar problem I have tried moving the code below the heading but it displaces the right info box which ends up bottom left, also I am using m_s contrib if you could help??

 

SORTED IT AFTER A WHILE

<tr>

<td class="main">

MOVE THIS BELOW ADDITION IT WORKS

CHEERS

DAVID

Link to comment
Share on other sites

i managed with a help from pixclinic

 

insert code in product_info.php

 

<?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="100%" cellspacing="0" cellpadding="1px"><tr>

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

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

</table></td>

</tr>';

}

 

// END: Extra Fields Contribution - mintpeel display fix

?>

 

into <td> code above </td> where you want them to be displayed ... see it in action on my site here

 

.. works like a charm

Edited by gregy
Link to comment
Share on other sites

I think this is the same extra fields contrib I use and I had a simple question. When i originally downloaded it and installed I thought an extra field feature would be(but is not) setting up a droplist. Is there a way or an update to implement this as an extra field? I wnated to give my customers a choice of options when i'd asked them how they heard about my store (i.e. yahoo, google, advertising in paper, etc.). Any ideas?

We must be the change we wish to see in the world.

------------------------------------------------------------

p.s. BACKUP!

Link to comment
Share on other sites

I think this is the same extra fields contrib I use and I had a simple question. When i originally downloaded it and installed I thought an extra field feature would be(but is not) setting up a droplist. Is there a way or an update to implement this as an extra field? I wnated to give my customers a choice of options when i'd asked them how they heard about my store (i.e. yahoo, google, advertising in paper, etc.). Any ideas?

 

You are in teh wrong threat : this is what you need;

 

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

 

good luck for the installation :-)

Edited by pixclinic
Link to comment
Share on other sites

Ah, pretty cool, thanks pixclinic, but...now that I have this already installed, what would I use it for? hehe... my mind draws a blank now :(

We must be the change we wish to see in the world.

------------------------------------------------------------

p.s. BACKUP!

Link to comment
Share on other sites

Hey that's friggin' awesome. How come when I go to setup and Extra field it ONLY shows up in the Create-an-account page? Thats why i decided to make the "hwo'd you find us" part. I couldn't add it to other pages like product_info and stuff. I like what you did there, But I don't know how to do that. also, I noticed there is a slight problem with alignment on that example you showed me, i'm running firefox 1.5 in Debian in a 1280x1024 resolution, if that helps you out.

We must be the change we wish to see in the world.

------------------------------------------------------------

p.s. BACKUP!

Link to comment
Share on other sites

Hey that's friggin' awesome. How come when I go to setup and Extra field it ONLY shows up in the Create-an-account page? Thats why i decided to make the "hwo'd you find us" part. I couldn't add it to other pages like product_info and stuff. I like what you did there, But I don't know how to do that. also, I noticed there is a slight problem with alignment on that example you showed me, i'm running firefox 1.5 in Debian in a 1280x1024 resolution, if that helps you out.

 

Setting up an extra field in teh create account page is VERY complex if you have no knowledge of php mysql.

You cannot create this with the mod extra field (it's only for products)

 

We are aware of the alignment pb in firefox, thanks

Link to comment
Share on other sites

thats odd, because I have it setup for the create account page and NOT the product page. :( so umm, I guess i have to go over the instructions again. because customers have been telling me how they found me using this mod in thier create account page, and I needed this mod for products for custom text... i'm all confused I gotta go lie down. thanks though :P

We must be the change we wish to see in the world.

------------------------------------------------------------

p.s. BACKUP!

Link to comment
Share on other sites

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)

 

...

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?

 

 

This fix did stop the error message from coming up.... BUT There is still a problem.

 

If i goto search for something that IS NOT in the extra product fields, then results of a search are zero. if i search for something that IS in the extra fields, then the products show up.

 

Any idea on how to fix this?

Link to comment
Share on other sites

thats odd, because I have it setup for the create account page and NOT the product page. :( so umm, I guess i have to go over the instructions again. because customers have been telling me how they found me using this mod in thier create account page, and I needed this mod for products for custom text... i'm all confused I gotta go lie down. thanks though :P

 

YOU DON'T UNDERSTAND: EXTRA FIELDS IS NO FOR THE CREATE ACCOUNT PAGE. THAT'S NOT MEANT TO. NOT GOOD. PAS BON. NICHT GUT

 

You need to install the mod how did you hear about us for achieve what you are refering. It's not because it's called "extra field" that you may install them anywhere you want. Oscomm has thousands of fields in it's database and the extra field is only dealing with adding extra fields on top of the product description.

Link to comment
Share on other sites

Sorry, thought I had e-mail notifications on.

 

http://electricquarter.com/38mm-45mm-game-...ries-p-109.html

 

Notice this part:

"# Product Features: Batteries Manufactured LESS THAN 3 Months ago

# New i"

 

No matter what I try, it cuts off after that many characters (at the "new i" part)

 

you have a problem in your HTML table structure next to this extra field contibution

 

 <table border="0" width="50%" cellspacing="0" cellpadding="2px"><tr>
  <td class="main" align="left" vallign="middle"><b><font size="1" color="#666666">Product Features: </b></font><font size="1" color="#666666"><li>Batteries Manufactured LESS THAN 3 Months ago</li><li> New i<BR></font> </tr>
  </table>
  </td>
  </tr></tr>
</table>

 

check in you product_info.php where the extra field mod has been inserted

 

1) you style is not rendered: that means a tag has been closed too early, or that there is an extra closing tag: I see two </tr></tr> folowwing each other, wich is not normal :-)

 

2) after new i<br></font>, there is no </li></td> as there is supposed to: I'm suspecting your loop is ending too early, double check that the entire row is correctly looped. You may not have enough table closing tag inside the loop, it may exits too early without closing the tag.

 

To debug, I would suggest:

 

1) add more extra fields and see if the problem always occurs on the last field

2) change the content of the field: try not to put HTML in the field (you have a <BR> now, why?

 

Keep us posted!

Link to comment
Share on other sites

I have been looking around, and been trying to figure out how to get this contribution to work with Easy Populate. I understand that I need to find a way to add extra fields to the easy populate files for the download... but what will the names of those fields be, and how do I add them?

 

I have posted in the easy populate forum, and no responses......

 

Please help

Link to comment
Share on other sites

I have been looking around, and been trying to figure out how to get this contribution to work with Easy Populate. I understand that I need to find a way to add extra fields to the easy populate files for the download... but what will the names of those fields be, and how do I add them?

 

I have posted in the easy populate forum, and no responses......

 

Please help

 

In your easypopulate admin screen, you should see a link in the list:

 

Download Extra Field (CREATE THE EXTRA FIELD FIRST BEFORE USING THIS FEATURE) tab-delimited .txt file to edit

 

 

this will export the "product extra fields" table (first you need tocreate a product with etra fields in your admin page first before exporting) then, look at what you get, it will give you the structure and how to build your file to reupload.

 

Working with extra fields built in another table is not easy: you have to renter the extra fields IDs when you work on this: not very convenient

 

I designed one of database with extra fields, and regret i did so: all my new sites have the extra fields added in the product table itself using the mod:

 

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

 

it's more hardcoding, and requires heavy modifications on the easypopulate file, but they show in the general export, because they are part of the same table as the products) But all the extra fields need to be defined before the site is created, it's less flexible than the extra field mod (that adds the fields dynamically in an external table

)

Edited by pixclinic
Link to comment
Share on other sites

In your easypopulate admin screen, you should see a link in the list:

 

Download Extra Field (CREATE THE EXTRA FIELD FIRST BEFORE USING THIS FEATURE) tab-delimited .txt file to edit

this will export the "product extra fields" table (first you need tocreate a product with etra fields in your admin page first before exporting) then, look at what you get, it will give you the structure and how to build your file to reupload.

 

Working with extra fields built in another table is not easy: you have to renter the extra fields IDs when you work on this: not very convenient

 

I designed one of database with extra fields, and regret i did so: all my new sites have the extra fields added in the product table itself using the mod:

 

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

 

it's more hardcoding, and requires heavy modifications on the easypopulate file, but they show in the general export, because they are part of the same table as the products) But all the extra fields need to be defined before the site is created, it's less flexible than the extra field mod (that adds the fields dynamically in an external table

)

 

I do not have an option in easypopulate admin to download extra field.

 

What i have is.

 

Download Complete tab-delimited .txt file

download model/price/qty

donload model/category

download froogle

download model/attributes

 

What version of EP are you using???? how can I get that extra fields option there?

Link to comment
Share on other sites

I do not have an option in easypopulate admin to download extra field.

 

What i have is.

 

Download Complete tab-delimited .txt file

download model/price/qty

donload model/category

download froogle

download model/attributes

 

What version of EP are you using???? how can I get that extra fields option there?

 

I work with versions from 2.8, 2.9 and 3, from this mod

 

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

Link to comment
Share on other sites

Hi there.

I just started using Extra Fields, verything cool BUT:

 

i would love to have a INPUT TYPE option,

means for each field i add, i would like to be able to set short text/long text/select/radiobutton etc.

 

Do you know if anyone is working on this?

 

thanks!

Expresionario.com | Pura Sub-cultura!

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