Jump to content
Sign in to follow this  
Chandra

Option Type Feature v1.6 (for osc 2.2 MS2)

Recommended Posts

You can sort by ID. Assuming the order you want is the order you created your option fields, you can make the following change in product_info.php:

 

Original (Sorting by Name):

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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");

 

Sorting by ID:

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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_id");

 

If you did not create them in the desired order, you can always delete them, then recreate them. The ID auto increments as you create more option fields, so you'll get the effect you're looking for.

 

Robert

Share this post


Link to post
Share on other sites
i have looked in to CREloaded aswell as oscmax, problem with these two is tht support is even slower than osc, i placed a few questions in the forums and never heard back from anyone...

 

Zaxxon - things must have changed since you last tried. I installed CREloaded, and had questions from the get go... I registered in the creloaded forum and began to post my questions, I received responses to all of my questions within 24 hours and my site was completely up, running, and live within a week with all of the options that I wanted and needed...and they were ALL WORKING. I even had other users offering tips and hints to help me do some amazing things with my store!

 

CREloaded was the answer for me... will it be for you or others? Can't say... as it was a bit harder to understand how things worked at first, but now, for the time being, I am thankful that I found it.

Share this post


Link to post
Share on other sites

Hi there

I've tried to install OTF v1.72 with huge problems.

I'm having trouble merging these files:

catalog/product_info.php

catalog/shopping_cart.php

catalog/includes/classes/shopping_cart.php

catalog/includes/functions/general.php

admin/products_attributes.php

 

currently Im running a standard osCommerce MS2 shop.

downbelow is product_info<-basic merged with OTF 1.72

 
<?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 (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

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

 $product_check_query = tep_db_query("select count(*) as total 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_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')
}
/* DDB - 041031 - Form Field Progress Bar */
/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/
function textCounter(field,counter,maxlimit,linecounter) {
// text width//
var fieldWidth =  parseInt(field.offsetWidth);
var charcnt = field.value.length;
// trim the extra text
if (charcnt > maxlimit) {
	field.value = field.value.substring(0, maxlimit);
} else {
// progress bar percentage
var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit);
document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
// color correction on style from CCFFF -> CC0000
setcolor(document.getElementById(counter),percentage,"background-color");
}
}
function setcolor(obj,percentage,prop){
obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
</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 . "'");

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'];
}
?>
  <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
$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) {
?>
	  <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
	}  //clr 030714 end switch
  } //clr 030714 end while
?>
	  </table>
<?php
} //clr 030714 end if
?>
	</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'); ?>

 

Here's the Basic osC2 code

<?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 (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

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

 $product_check_query = tep_db_query("select count(*) as total 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_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 . "'");

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'];
}
?>
  <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
$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) {
?>
	  <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'); ?>

 

I really need some help!!!!!!

Share this post


Link to post
Share on other sites

Great contribution. I have it installed along with Attribute Sets Plus. Everything is functioning with one minor problem: When I use the drop down (select) option type. The options are always duplicated for this option type when displayed. Option - value 1, value 2 , value 3 appears as Option - value 1, value 2 , value 3, value 1, value 2 , value 3 (repeated). I have verified that the problem does not exist with mysql db. I believe it is a problem with the select statements in product_info.php. The relevant code is posted here. Any assistance would be greatly appreciated. Thank you, Rodney

 

<?php

$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) {

?>

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

<tr>

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

</tr>

<?php

//clr 030714 update query to pull option_type

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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)) {

//clr 030714 add case statement to check option type

switch ($products_options_name['products_options_type']) {

case PRODUCTS_OPTIONS_TYPE_TEXT:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment'] ;

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

$tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';

}

?>

<tr>

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

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_TEXTAREA:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

wrap="soft"

name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

rows=5

id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>

<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>

<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //-->

<tr>

<?php

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

?>

<td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>

<?php } else {

?>

<td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td>

<?php }

?>

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_RADIO:

//CLR 030714 Add logic for radio buttons

$tmp_html = '<table>';

$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 = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");

$checked = true;

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

$tmp_html .= '<tr><td class="main">';

$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);

$checked = false;

$tmp_html .= $products_options_array['products_options_values_name'] ;

$tmp_html .=$products_options_name['products_options_comment'] ;

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

$tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')?';

}

$tmp_html .= '</tr></td>';

}

$tmp_html .= '</table>';

?>

<tr>

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

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

case PRODUCTS_OPTIONS_TYPE_CHECKBOX:

//CLR 030714 Add logic for checkboxes

$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

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

echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);

echo $products_options_name['products_options_comment'] ;

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

echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')?';

}

echo '</td></tr>';

break;

default:

//clr 030714 default is select list

//clr 030714 reset selected_attribute variable

$selected_attribute = false;

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

}

 

// BOF Linkmatics attributes sets plus

$products_options_query = tep_db_query("

SELECT pov.products_options_values_id, pov.products_options_values_name,

pa.options_values_price, pa.price_prefix , pase.sort_order

FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .

TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS . " pas2pa, " .

TABLE_PRODUCTS_ATTRIBUTES_SETS . " pas, " .

TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase, " .

TABLE_PRODUCTS_OPTIONS_VALUES . " pov

WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'

AND pa.options_id = '" . $products_options_name['products_options_id'] . "'

AND pas2pa.products_id = pa.products_id

AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id

AND pas.products_options_id = pa.options_id

AND pase.products_attributes_sets_id = pas.products_attributes_sets_id

AND pase.options_values_id = pa.options_values_id

AND pov.products_options_values_id = pa.options_values_id

AND pov.language_id = '" . $languages_id . "'

ORDER BY pase.sort_order, pa.options_values_id");

// >>>>> BOF Linkmatics attributes sets plus patch v1.01

if (tep_db_num_rows($products_options_query)== 0 ) {

$products_options_query = tep_db_query("

SELECT pov.products_options_values_id, pov.products_options_values_name,

pa.options_values_price, pa.price_prefix , pa.options_values_id

FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .

TABLE_PRODUCTS_OPTIONS_VALUES . " pov

WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'

AND pa.options_id = '" . $products_options_name['products_options_id'] . "'

AND pov.products_options_values_id = pa.options_values_id

AND pov.language_id = '" . $languages_id . "'

ORDER BY pa.options_values_id");

}

// <<<<< EOF Linkmatics attributes sets plus patch v1.01

// EOF Linkmatics attributes sets plus

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

} //clr 030714 end switch

} //clr 030714 end while

?>

</table>

<?php

} //clr 030714 end if

?>

Share this post


Link to post
Share on other sites

I am still trying to merge this contrib with the cart (version 051113 but should be ready for others). can some one please help?


currently using OSC2.2MS2 051113 with the following contributions:

 

AJAX Attributemanager 2.1 - All_products 4.4 - Banner manager 1.5b - banner hack picture in manager * description in product listing hack ms2 v2.4 * drop shadow boxes v.1.1 * Easy populater 2.76d-ms2 by surfalot * FCKEditor * header tag controller v2.5.9 * jcssmenu * LoginBox 5.6 * option type feature v1.71 * OSC-Cach-v1.1 * popup_imagecleaned_stilized_2 * Remove from cart button hack * scrolling bestsellers * Article manager1.4 * Links Manager v1.14. * proffessional invoice&packingslip 6.1 * Ultimate SEO URLs

Personaly i think all these features NEED to be in the main core as they are quite basic features that are missing. but then again what do i know?

Share this post


Link to post
Share on other sites

WELL DONE PD_STEVE

finaly this useful contrib(should be really made part ofthe core code) is updated for the latest snapshot, just went through the entire install, and all is now working just right.. well almost some ofthe column are poping out of alignment when i try to update the type option- but its very much still usefull and doesnt break. FUNPLASTIC!

 

i am really jumping for joy for this one.....many thanks PD_STEVE great job! :)


currently using OSC2.2MS2 051113 with the following contributions:

 

AJAX Attributemanager 2.1 - All_products 4.4 - Banner manager 1.5b - banner hack picture in manager * description in product listing hack ms2 v2.4 * drop shadow boxes v.1.1 * Easy populater 2.76d-ms2 by surfalot * FCKEditor * header tag controller v2.5.9 * jcssmenu * LoginBox 5.6 * option type feature v1.71 * OSC-Cach-v1.1 * popup_imagecleaned_stilized_2 * Remove from cart button hack * scrolling bestsellers * Article manager1.4 * Links Manager v1.14. * proffessional invoice&packingslip 6.1 * Ultimate SEO URLs

Personaly i think all these features NEED to be in the main core as they are quite basic features that are missing. but then again what do i know?

Share this post


Link to post
Share on other sites

after a couple of hours testing and playing with the cart i checked out a few product andgot this error after confirmation:

Fatal error: Call to undefined function tep_decode_specialchars() in C:\wamp\www\catalog\checkout_process.php on line 213

 

Line 213 reads:

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']);


currently using OSC2.2MS2 051113 with the following contributions:

 

AJAX Attributemanager 2.1 - All_products 4.4 - Banner manager 1.5b - banner hack picture in manager * description in product listing hack ms2 v2.4 * drop shadow boxes v.1.1 * Easy populater 2.76d-ms2 by surfalot * FCKEditor * header tag controller v2.5.9 * jcssmenu * LoginBox 5.6 * option type feature v1.71 * OSC-Cach-v1.1 * popup_imagecleaned_stilized_2 * Remove from cart button hack * scrolling bestsellers * Article manager1.4 * Links Manager v1.14. * proffessional invoice&packingslip 6.1 * Ultimate SEO URLs

Personaly i think all these features NEED to be in the main core as they are quite basic features that are missing. but then again what do i know?

Share this post


Link to post
Share on other sites
after a couple of hours testing and playing with the cart i checked out a few product andgot this error after confirmation:

Fatal error: Call to undefined function tep_decode_specialchars() in C:\wamp\www\catalog\checkout_process.php on line 213

 

Line 213 reads:

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']);

 

Hi Zaxxon

 

My mistake on the install file. I missed a function during the creation of the manual install.

 

In /includes/functions/general.php

 

ADD before the final ?>

 

// Decode string encoded with htmlspecialchars()

function tep_decode_specialchars($string){

$string=str_replace('>', '>', $string);

$string=str_replace('<', '<', $string);

$string=str_replace(''', "'", $string);

$string=str_replace('"', "\"", $string);

$string=str_replace('&', '&', $string);

 

return $string;

}

 

I'll update the manual installation notes accordingly.

 

Many thanks

 

Steve


My Toolbox: Crimson Editor, Adobe Photoshop CS2.0, Expression Web, Macromedia Suite 8.0, Cinema 4D, Nvu.

Share this post


Link to post
Share on other sites

great - thanks again for updating this contribution.

just out of curiosity - why not use the built in osc function for special char cleaning ? and also, is this to replace this function :

//CLR 030228 Add function tep_decode_specialchars

// Decode string encoded with htmlspecialchars()

function tep_decode_specialchars($string){

$string=str_replace('>', '>', $string);

$string=str_replace('<', '<', $string);

$string=str_replace("'", "'", $string);

$string=str_replace('"', "\"", $string);

$string=str_replace('&', '&', $string);

 

return $string;

}


currently using OSC2.2MS2 051113 with the following contributions:

 

AJAX Attributemanager 2.1 - All_products 4.4 - Banner manager 1.5b - banner hack picture in manager * description in product listing hack ms2 v2.4 * drop shadow boxes v.1.1 * Easy populater 2.76d-ms2 by surfalot * FCKEditor * header tag controller v2.5.9 * jcssmenu * LoginBox 5.6 * option type feature v1.71 * OSC-Cach-v1.1 * popup_imagecleaned_stilized_2 * Remove from cart button hack * scrolling bestsellers * Article manager1.4 * Links Manager v1.14. * proffessional invoice&packingslip 6.1 * Ultimate SEO URLs

Personaly i think all these features NEED to be in the main core as they are quite basic features that are missing. but then again what do i know?

Share this post


Link to post
Share on other sites
Great contribution. I have it installed along with Attribute Sets Plus. Everything is functioning with one minor problem: When I use the drop down (select) option type. The options are always duplicated for this option type when displayed. Option - value 1, value 2 , value 3 appears as Option - value 1, value 2 , value 3, value 1, value 2 , value 3 (repeated). I have verified that the problem does not exist with mysql db. I believe it is a problem with the select statements in product_info.php. The relevant code is posted here. Any assistance would be greatly appreciated. Thank you, Rodney

 

Rodney, are you using 1.7.2? if so I have the same problem, I think its to do with Gidgidonihah's addition to this contribution which seems to be adding in duplicates, I'll try and ask him

Share this post


Link to post
Share on other sites
I've seen this problem posted a number of times but never a fix... has anyone found a way to stop the text attribute sort order from being 'scrambled' during login?

 

Thanks,

Paul

 

Hello Paul,

 

Did you find the solution ?

Because I have the same bug ...

 

Thanks a lot

 

Thierry

Share this post


Link to post
Share on other sites
disregard the post above. I found a solution.

 

Hi there,

 

I know you posted this a while back but is there any chance you can remember what your solution was for the layout of the attributes using Option Type?

 

Thank you!

 

Tatty

Share this post


Link to post
Share on other sites

Okay I think I've found how to make the product options (radio buttons) display horizontally. Bear in mind I am new to php and so I'm stumbling through with the html bits of the code to acheive this, but it seems to be working.

 

The changes are to catalog/product_info.php, and involve just changing some <br>, <table>, <tr> and </tr> bits of code.

 

There are two options -

 

Number 1: to display all your attributes in one long horizontal line, e.g.

 

Name: (text box) Colour: Red (radio) Pink (radio) Yellow (radio) Message: (text box)

 

Number 2: to display each attribute on a new line, but the choices for that attribute horizontally, e.g.

 

Name: (text box)

Colour: Red (radio) Pink (radio) Yellow (radio)

Message: (text box)

 

Here's my code for Number 1, starting from about line 157 of product_info.php up to about line 264. Please don't copy and paste it because lord knows what other changes I've made to my code! Just copy where I've fiddled with the html code (<br>, <tr>, </tr>, <table>, </table> etc):

 

//clr 030714 update query to pull option_type

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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_id");

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

//clr 030714 add case statement to check option type

switch ($products_options_name['products_options_type']) {

case PRODUCTS_OPTIONS_TYPE_TEXT:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment'] ;

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

$tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';

}

?>

<tr>

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

<td class="main"><?php echo $tmp_html; ?></td>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_TEXTAREA:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

wrap="soft"

name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

rows=5

id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>

<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>

<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //-->

<?php

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

?>

<td class="main"><?php echo $products_options_name['products_options_name'] . '(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>

<?php } else {

?>

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

<?php }

?>

<td class="main"><?php echo $tmp_html; ?></td>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_RADIO:

//CLR 030714 Add logic for radio buttons

$tmp_html = '<table>';

$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 = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");

$checked = true;

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

$tmp_html .= '<td class="main">';

$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);

$checked = false;

$tmp_html .= $products_options_array['products_options_values_name'] ;

$tmp_html .=$products_options_name['products_options_comment'] ;

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

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

}

$tmp_html .= '</td>';

}

$tmp_html .= '</table>';

?>

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

<td class="main"><?php echo $tmp_html; ?></td>

<?php

break;

case PRODUCTS_OPTIONS_TYPE_CHECKBOX:

//CLR 030714 Add logic for checkboxes

$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

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

echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);

echo $products_options_name['products_options_comment'] ;

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

echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

echo '</td>';

break;

default:

//clr 030714 default is select list

//clr 030714 reset selected_attribute variable

$selected_attribute = false;

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

}

?>

<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) . $products_options_name['products_options_comment']; ?></td>

<?php

} //clr 030714 end switch

} //clr 030714 end while

 

Number 2: Again, starting from about line 157 of product_info.php up to about line 264. Please don't copy and paste it because lord knows what other changes I've made to my code! Just copy where I've fiddled with the html code (<br>, <tr>, </tr>, <table>, </table> etc):

 

//clr 030714 update query to pull option_type

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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_id");

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

//clr 030714 add case statement to check option type

switch ($products_options_name['products_options_type']) {

case PRODUCTS_OPTIONS_TYPE_TEXT:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment'] ;

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

$tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';

}

?>

<tr>

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

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_TEXTAREA:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

wrap="soft"

name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

rows=5

id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>

<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>

<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //-->

<?php

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

?>

<td class="main"><?php echo $products_options_name['products_options_name'] . '(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>

<?php } else {

?>

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

<?php }

?>

<td class="main"><?php echo $tmp_html; ?></td>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_RADIO:

//CLR 030714 Add logic for radio buttons

$tmp_html = '<table>';

$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 = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");

$checked = true;

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

$tmp_html .= '<td class="main">';

$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);

$checked = false;

$tmp_html .= $products_options_array['products_options_values_name'] ;

$tmp_html .=$products_options_name['products_options_comment'] ;

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

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

}

$tmp_html .= '</td>';

}

$tmp_html .= '</table>';

?>

<tr>

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

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

case PRODUCTS_OPTIONS_TYPE_CHECKBOX:

//CLR 030714 Add logic for checkboxes

$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

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

echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);

echo $products_options_name['products_options_comment'] ;

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

echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

echo '</td>';

break;

default:

//clr 030714 default is select list

//clr 030714 reset selected_attribute variable

$selected_attribute = false;

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

}

?>

<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) . $products_options_name['products_options_comment']; ?></td>

<?php

} //clr 030714 end switch

} //clr 030714 end while

 

I hope this helps someone! If you want to see it in action, let me know.

 

Tatty

Share this post


Link to post
Share on other sites

Hi,

 

i've installed products attributes option type feature, but there's a bug in catalog/checkout_confirmation.php.

 

when i log out and log in back, the attributes disappear from the products already in the cart.

 

Any idea?

 

In fact, i don't understand very well how's the cart content is managed.

 

Thank to check this out.

Share this post


Link to post
Share on other sites

can you guys please help me to make like the below?

display all options with own quantity boxes. than people could choose more than one selection for wholesalers.

or anyone know right contribution?

 

test.gif

 

thank for reading this topic

Share this post


Link to post
Share on other sites

Is there a way to keep stock (and out of stock) on the actual letters that will be typed in the filed by the customer?

 

Thanks,

Fredrik

Share this post


Link to post
Share on other sites

I found a bug in this contribution.

 

I have 3 attributes with a product:

 

- a text field

- 2 checkboxes

 

I select the three of them and add to cart. They are displayed under the product name in the shopping cart however the checkboxes text dissapears when I click update in the shopping cart.

 

Any ideas how to solve this problem?

Share this post


Link to post
Share on other sites
can you guys please help me to make like the below?

display all options with own quantity boxes. than people could choose more than one selection for wholesalers.

or anyone know right contribution?

 

test.gif

 

thank for reading this topic

 

You can create text fields for each entry. This contribution is good for you.

Share this post


Link to post
Share on other sites

2 questions! Please help. I am trying to install this on a changed version of 2.2 MS2 (051113) and having a terrible time trying to find (by comparing) changes on all the files. Is there a place that has super clear instructions on which files to change... and what parts?

 

Also, I want to start a new store... so is there bundled oscommerce package that has this already installed so I don't have to install it manually for the new store?

 

Thanks so much.

Share this post


Link to post
Share on other sites
2 questions! Please help. I am trying to install this on a changed version of 2.2 MS2 (051113) and having a terrible time trying to find (by comparing) changes on all the files. Is there a place that has super clear instructions on which files to change... and what parts?

 

Also, I want to start a new store... so is there bundled oscommerce package that has this already installed so I don't have to install it manually for the new store?

 

Thanks so much.

 

Check this - http://www.openstoresolutions.com/option_t...ontribution.php

 

I installed it manually yesterday and took me some hours but all is functional.

Share this post


Link to post
Share on other sites
Check this - http://www.openstoresolutions.com/option_t...ontribution.php

 

I installed it manually yesterday and took me some hours but all is functional.

 

 

I saw that... but there isn't one posted. It says coming soon. I tried emailing the email given there and it was returned. And are there more step by step instructions on manually installing it somewhere? Thanks!

Share this post


Link to post
Share on other sites

Wow, I came here to ask one question but reading post I have about a total of three now. First things first:

 

1- Has anyone got a textcounter working with this contrib for people who do letter customizationf or products and charge by the letter? (i.e. First ten letters typed are free for a product but anything after that is .50 cents per letter and added to the total, so a mug with 12 letters would be (price of mug) +($1.00 for extra letters))

 

2- I notice lots of you talking about checkboxes and radio buttons, but I see no options for this in the contribution I installed, all i see are textareas and textboxes. How'd you accomplish this as I would like this to :)

 

3- Has anyone gotten something working in a way that , how can I explain this.... You get to choose an image and a color out of two drop down list right? ... but after that you want another image(and to specify it's color), so you click the checkbox "Want another image" and when you check it, the two droplist for images and colors popup for this second image selection process.(this has sparked another question)

 

4- Has anyone gotten a setup going where I, let's say, chose a siez of a shirt, the colors available for that shirt in a seperate droplist would update to colors available? (i.e. say I sell Small, Medium, and large shirts T-shirts, when you select medium as your preferred size all colors are available in medium, but Large and small are only available in few colors, not all) I'm sure this is just messing with the attributes function, but right now it escapes me of how I would set this up.

 

Thanks so much for hearing me out guys(and ladies), if you have the answer to ANY of these please let me know, ESPECIALLY for the text counter deal. OH speaking of which, I know of a site that implements the textcounter and it IS an OSC store(i know because i used to work for them). HOWEVER, because they outsource thier admin and such they cannot and will not (especially since i no longer work there) give me the info I need on hwo to get it to work. but looking at thier source I've come up with this information (posted below), and I think this is part of my solution for the textcounting, but I cannot figure out how to implement it with the Option Type feature :( Can this help anybody in helping me figure this out? If I can get this to work, I will submit this to the creators of this Contribution so everybody can have this option, as I've seen others looking for the same option with no results either. here is what i've found in their source from product_info.php:

<script LANGUAGE="JavaScript">
function textCounter(field,cntfield,xtrafield) {
if (field.value == '') {
	cntfield.value = 0;
}else{
	var charCount=0;
for (var i = 0; i < field.value.length; i++) {
	if (field.value.charAt(i) != " ")
	charCount++;
}
	cntfield.value = charCount;
}
if (cntfield.value >14) {
	xtrafield.value=(cntfield.value-14)*0.65;
}else{
	xtrafield.value=0;
}
}
</script>

 

That's the script and this is the html/php used in the actual products attribute listing (when selecting size, colors,text and such). It's only the simplified html/php code used for display purposes, not the actual useful code(i'm pretty sure), but I figure someone seeing this will realize how it works and can help me out.

 

<tr><Td valign=top><img src="images/icons/step_4.gif" width=50 height=50 name=img_3 hspace=5 border=0></a></Td><td class="main" valign=top><big><b>Custom Text</b></big><br>What's it going to say? The first 14 letters are free, after that each letter is ?65<br><input

onKeyDown="textCounter(document.cart_quantity.id_3,document.cart_quantity.idlen_3,document.cart_qua
ntity.idxtra_3)"

onKeyUp="textCounter(document.cart_quantity.id_3,document.cart_quantity.idlen_3,document.cart_qua
ntity.idxtra_3)"

type=text maxlength=250 value="" id="id_3" name="id[3]"><bR>Total Letters Used <input type=text size=3 id="idlen_3"> Extra Charge <input type=text id="idxtra_3" size=3><br><!--<input type=checkbox name="idnotxt[3]" id="idnotxt_3" onClick="notxtitems();">I'd actually prefer not to have any text on my order (Reduce Order Cost by $10)--></td></tr>

<script>textCounter(document.cart_quantity.id_3,document.cart_quantity.idlen_3,document.cart_qua
ntity.idxtra_3);</script>

 

 

Thanks again


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

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

p.s. BACKUP!

Share this post


Link to post
Share on other sites

Just did a sample order using this feature, so far no glitches EXCEPT, the title of My text area and text boxes are not carried over into the invoice or the e-mails sent out confirming the order.

it basically says - Sample Shirt $2.99

- Hey this is my shirt!

Color - black

- place centered and 3 inches from the neck

 

Any to control this so it can be announce the titles of the attribute(like it states color):

 

Sample Shirt $2.99

Custom Text - Hey this is my shirt!

Color- black

Placement Instruction - place centered and 3 inches from the neck

 

This would help customer understand exactly what they ordered when looking at thier invoices. I notice in the e-mails sent it doesn't even have the " - " between the attribute title and the selected variable so it's basically:

 

Products

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

1 x sampleshirt (sample) = $2.99

Hey this is my shirt!

Color Black

place centered and 3 inches from the neck

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

 

I mean not only is this atrocious looking, I only understand what it says because I'm the admin. It's like writing a letter without using commas or period.(my grammar is poor I know, but thats a different topic). Any ideas on how to improve this?


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

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

p.s. BACKUP!

Share this post


Link to post
Share on other sites
2 questions! Please help. I am trying to install this on a changed version of 2.2 MS2 (051113) and having a terrible time trying to find (by comparing) changes on all the files. Is there a place that has super clear instructions on which files to change... and what parts?

 

Also, I want to start a new store... so is there bundled oscommerce package that has this already installed so I don't have to install it manually for the new store?

 

Thanks so much.

 

So, never found the bundled download version and found better instructions - I had just not checked the newer downloads! I have run into a problem that 2 others had but never saw a solution. I am confused using this, first off! When I create a text box, all I get is a dropdown menu with the word text in it! I have been staring at the directions for hours now and just don't get how to create a text box. If anyone can point out step by step (for a newbie, sorry) the steps to adding a text box. Touching on the three areas in the admin panel; product options, option values, and product values.

 

I am trying to add options for a customized stationary store. So I want to have like 5 lines of text boxes. Any help or pointing me towards another post would be great.

Share this post


Link to post
Share on other sites
Has anyone seem a problem with this contribution with it creating duplicate Option Values?

 

I added the three option values in via the database script insert_text_option.sql

I created a product option for Custom Name with a type of text

Now every time I add another product attribute of Custom Name to a product it adds another Option Value with id=0 Option Name=Custom Name Option Value=TEXT

 

It all seems to work ok, but if its going to create 3 option values for every product attribute with a type of text then its going to get pretty polluted

 

Is this how its meant to work?

 

 

Did anyone ever find a solution to this? I am having the same problem.

 

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×