Jump to content
Sign in to follow this  
wade

Attribute - Please help me identify this Contribution!

Recommended Posts

I've been searching the contributions for the past few hours with no luck. I have a store I setup quite a long time ago that uses an attribute contribution where when you add, or edit, a product, all the attributes are listed at the bottom of the product screen in the admin area. Unfortunately, I wiped all my old contributions last year without thinking and now I need to find this one.

 

This code, part of the contribution, is from the categories.php:

 

<!-- INSERT CODE BLOC 2, ATTRIBUTES CODE -->
<!-- INSERT CODE BLOC 2, ATTRIBUTES CODE -->

  <tr>
	<td><table border="0" cellspacing="0" cellpadding="2">
	  <tr valign="top">
<?php
$rows = 0;
$options_query = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name");
while ($options = tep_db_fetch_array($options_query)) {
  $values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "'");
  $header = false;
  while ($values = tep_db_fetch_array($values_query)) {
	$rows ++;
	if (!$header) {
	  $header = true;
?>
		<td><table border="0" cellpadding="0" cellspacing="0">
		  <tr class="dataTableHeadingRow">
			<td class="dataTableHeadingContent" colspan="4"><?php echo $options['products_options_name']; ?></td>
		  </tr>
		  <tr class="dataTableHeadingRow">
			<td class="dataTableHeadingContent" align="center">Option</td>
			<td class="dataTableHeadingContent" align="center">Prefix</td>
			<td class="dataTableHeadingContent" align="center">Price</td>
			<td class="dataTableHeadingContent" align="center">Sort Order</td>
		</tr>
<?php
	}
	$attributes = array();
	if (sizeof($HTTP_POST_VARS) > 0) {
	  if ($HTTP_POST_VARS['option'][$rows]) {
		$attributes = array('products_attributes_id' => $HTTP_POST_VARS['option'][$rows],
							'options_values_price' => $HTTP_POST_VARS['price'][$rows],
							'attribute_sort' => $HTTP_POST_VARS['sort'][$rows],						 'price_prefix' => $HTTP_POST_VARS['prefix'][$rows]);


//			,								'attribute_sort' => $HTTP_POST_VARS['sort'][$rows];
	  }
	} else {
	  $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, attribute_sort from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pInfo->products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
	  if (tep_db_num_rows($attributes_query) > 0) {
		$attributes = tep_db_fetch_array($attributes_query);
	  }
	}
?>
		  <tr class="dataTableRow">
			<td class="dataTableContent"><?php echo tep_draw_checkbox_field('option[' . $rows . ']', $attributes['products_attributes_id'], $attributes['products_attributes_id']) . ' ' . $values['products_options_values_name']; ?> </td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('prefix[' . $rows . ']', $attributes['price_prefix'], 'size="2"'); ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('price[' . $rows . ']', $attributes['options_values_price'], 'size="7"'); ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('sort[' . $rows . ']', $attributes['attribute_sort'], 'size="7"'); ?></td>
		  </tr>
<?php
  }
  if ($header) {
?>
		</table></td>
<?php
  }
}
?>
	  </tr>
	</table></td>
  </tr>

<!-- END INSET CODE BLOCK 2 -->
<!-- END INSET CODE BLOCK 2 -->

 

I cannot figure out the contribution name. We are setting up a new store and I want to add this code to our new store.

 

Does anyone recognize this?

 

Thanks in advance!

 

Wade

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  

×