Hello,
I have a page that has been modified by a person during the original build. The site is for a contact lens company opticalnow.ca
The modification made sense when the site was built as every product had needs a prescription. We now have a new product that doesn't so the code on the tpl_modules_attributes is causing an issue.
I need to keep the code for the prescription for every product except this one.
I've managed to get the product attribute to display on the page by adding another line with it's attribute but it isn't right.
This is the page - http://opticalnow.ca/adlens-hemisphe....html?cPath=32
Here is the code I added to the rest to get it to show
My php is not great - thanks for the helpPHP Code:case 'Colour':
$result['Colour']['right'][] = $options_menu[$i];
break;
This is the rest of the page code.
PHP Code:<?php
/**
* Module Template
*
* Template used to render attribute display/input fields
*
* @package templateSystem
* @copyright Copyright 2009 Glenn Herbert
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.gnu.org/licenses/ GNU Public License V3.0
* @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $
* Modified for Flexible Attributes by Glenn Herbert (gjh42) 20091228
*/
?>
<div id="productAttributes">
<?php if ($zv_display_select_option > 0) { ?>
<h3 id="attribsOptionsText"><?php //echo TEXT_PRODUCT_OPTIONS; ?>Enter your Prescription:</h3>
<?php } // show please select unless all are readonly ?>
<?php
$html = '<table id="products_attributes_table">';
$result = array();
for($i=0;$i<sizeof($options_name);$i++)
{
switch( strip_tags($options_name[$i]))
{
case 'BC (mm) / Dia (mm)':
$result['BC / DIA']['right'][] = $options_menu[$i];
break;
case '2 BC (mm) / Dia (mm)':
$result['BC / DIA']['left'][] = $options_menu[$i];
break;
case 'Power Range (D)':
$result['Power']['right'][] = $options_menu[$i];
break;
case '2 Power Range (D)':
$result['Power']['left'][] = $options_menu[$i];
break;
case 'Cyl':
$result['Cyl']['right'][] = $options_menu[$i];
break;
case '2 Cyl':
$result['Cyl']['left'][] = $options_menu[$i];
break;
case 'Axes':
$result['Axes']['right'][] = $options_menu[$i];
break;
case '2 axes':
$result['Axes']['left'][] = $options_menu[$i];
break;
case 'Adds':
$result['Adds']['right'][] = $options_menu[$i];
break;
case '2 adds':
$result['Adds']['left'][] = $options_menu[$i];
break;
case 'quantity':
$result['Qty']['right'][] = $options_menu[$i];
break;
case '2 quantity':
$result['Qty']['left'][] = $options_menu[$i];
break;
case 'Colour':
$result['Colour']['right'][] = $options_menu[$i];
break;
default:
echo 'not found: '.$options_name[$i];
}
}
$heading = "";
$left = '';
$right = '';
$body = '';
$count = 0;
foreach( $result as $key => $value )
{
if( $count == 0 )
{
$heading .= '<th colspan="2" align="right">'.$key.'</th>';
}
else
{
$heading .= '<th>'.$key.'</th>';
}
$count++;
foreach( $value['left'] as $leftValues )
{
$left .= '<td>'.$leftValues.'</td>';
}
foreach( $value['right'] as $rightValues )
{
$right .= '<td>'.$rightValues.'</td>';
}
}
?>
<?php
for($i=0;$i<sizeof($options_name);$i++) {
?>
<div class="wrapperAttribsOptions" id="<?php echo $options_wrapper_id[$i];//gjh42 ?>">
<?php
if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {
?>
<h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3>
<?php
}
?>
<?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
<div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
<?php } ?>
</div>
<?php
if ($options_attributes_image[$i] != '') {
?>
<?php echo $options_attributes_image[$i]; ?>
<?php
}
?>
<div class="clearBoth"></div>
<?php
}
?>
<?php
if ($show_onetime_charges_description == 'true') {
?>
<div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
<?php } ?>
<?php
if ($show_attributes_qty_prices_description == 'true') {
?>
<div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . ' ' . '<a href="javascriptopupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
<?php } ?>
<?php
echo '<table cellpadding="0" cellspacing="0"><tr>'.$heading.'</tr><tr><td><span>Right Eye</span></td>'.$right.'</tr><tr class="empty"><td colspan="4"></tr><tr><td><span>Left Eye</span></td>'.$left.'</tr><tr class="empty"><td colspan="4"></tr></table>';
?>
</div>


Reply With Quote

