Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute - Please help me identify this Contribution!


wade

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...