A (manual) solution for my situation, 4 Categories with SubCat
Contact Lenses ()
Eyeglasses Frames (Men, Women, Children Unisex)
Prescription Lenses ()
Sunglasses ( Men, Women, Unisex )
So, The Rx for Contact Lenses and Prescription Lenses are different so I need to upload a differente (tpl_module_attributes.php) base on Category situation,
This is what came up to me, so far so good I think is working!!!
1. I create all my Attributes in the Admin section
( I use the sort order in the names)
2. I create my display table
--- for contact Lenses: tpl_module_attributes_1.php
--- for Eyeglases Frames: tpl_module_attributes_2.php
Code: tpl_module_attributes_1.php
PHP Code:
<?php
/**
* Module Template
*
* Template used to render attribute display/input fields
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $
*/
?>
<div id="productAttributes">
<div class="wrapperAttribsOptions">
<table width="100%" cellpadding="0" cellspacing="0" style="border: 1px solid #003399;">
<tr>
<td><table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="9" class="leftBoxHeading" id="categoriesHeading"><strong>Please enter your Rx Information Here</strong> </td>
</tr>
<tr>
<td><strong> </strong></td>
<td><strong>Sphere</strong></td>
<td><span class="main"><b>Cylinder</b></span></td>
<td><span class="main"><strong>Axis</strong></span></td>
<td><span class="main"><b>Prism</b></span></td>
<td><span class="main"><b>Add</b></span></td>
<td><strong>Diam</strong></td>
<td><b>BC</b></td>
<td> </td>
</tr>
<tr>
<td><div align="left"> O.D:</div></td>
<td><span class="main"><?php echo "\n" . $options_menu[0]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[1]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[2]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[3]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[4]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[5]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[6]; ?></span></td>
<td> </td>
</tr>
<tr>
<td><div align="left"> O.S:</div></td>
<td><span class="main"><?php echo "\n" . $options_menu[7]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[8]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[9]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[10]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[11]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[12]; ?></span></td>
<td><span class="main"><?php echo "\n" . $options_menu[13]; ?></span></td>
<td> </td>
</tr>
<tr>
<td colspan="9" class="leftBoxHeading" id="categoriesHeading"><strong>Please enter Patient and Doctor's Information Here</strong> </td>
</tr>
<tr>
<td colspan="3"><?php echo $options_name[14]; ?></td>
<td colspan="6"><?php echo "\n" . $options_menu[14]; ?></td>
</tr>
<tr>
<td colspan="3"><?php echo $options_name[15]; ?></td>
<td colspan="6"><?php echo "\n" . $options_menu[15]; ?></td>
</tr>
<tr>
<td colspan="3"><?php echo $options_name[16]; ?></td>
<td colspan="6"><?php echo "\n" . $options_menu[16]; ?></td>
</tr>
<tr>
<td colspan="3"><?php echo $options_name[17]; ?></td>
<td colspan="6"><?php echo "\n" . $options_menu[17]; ?></td>
</tr>
<tr>
<td colspan="3"><?php echo $options_name[18]; ?></td>
<td colspan="6"><?php echo "\n" . $options_menu[18]; ?></td>
</tr>
</table></td>
</tr>
</table>
</div>
</div>
3. I change a Code in tpl_product_info_display.php
Original Code
PHP Code:
<!--bof Attributes Module -->
<?php
if ($pr_attr->fields['total'] > 0) {
?>
<?php
/**
* display the product atributes
*/
require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
<?php
}
?>
<!--eof Attributes Module -->
Change for (Totally PHP Sinner ) but so far so good I think is working!
Manual
PHP Code:
<!--bof Attributes Module -->
<?php if ($pr_attr->fields['total'] > 0) { ?>
<?php /*** display the product atributes***/
if($current_category_id=="1")
require($template->get_template_dir('/tpl_modules_attributes_1.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_1.php');
if($current_category_id=="2")
require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php');
if($current_category_id=="5")
require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php');
if($current_category_id=="6")
require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php');
if($current_category_id=="7")
require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php');
if($current_category_id=="8")
require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php');
?>
<?php } ?>
<!--eof Attributes Module -->
As I said is "a manual solution for my situation"
Contact Lenses http://opticlubusa.com/index.php?mai...&products_id=3
Eyeglasses Frames http://opticlubusa.com/index.php?mai...&products_id=1
Miri4413
Bookmarks