Jump to content
Sign in to follow this  
Greeves

New Attribute Manager Released..

Recommended Posts

Wow, this is a much better interface!!!! Why doesn't something like this get added to the main release!?!?!

Share this post


Link to post
Share on other sites
Good contribution, but is there a way to submit all of this to the DB via a CSV file? The manager looks pretty good...except I have a few thousand products to do this for.
Easy Populate
I'm talking about doing the product attributes. I didn't see anything within easypopulate that'd do it? If so, maybe I missed it - could you point me in the right direction? I checked its readme and such...

 

As has been pointed out many, many times, easy populate does NOT do attributes. They are not handled in a way that easy populate can manage.


[no external urls in signatures please, kthanks]

Share this post


Link to post
Share on other sites
Good contribution, but is there a way to submit all of this to the DB via a CSV file? The manager looks pretty good...except I have a few thousand products to do this for.

 

If you know how to add information to your database via phpMyAdmin you certainly can add information directly from a CSV file. But you need to know the structure and relationships and it ain't easy. I have added the attributes themselves, but not the associations to products in this way.


[no external urls in signatures please, kthanks]

Share this post


Link to post
Share on other sites

I have this contribution installed and working fine - however I want to have the drop down box inslude the model numbers.

 

Here is the new_attribute_select.php code:

 

<TR>

<TD class="pageHeading" colspan="3"><?=$pageTitle?></TD>

</TR>

<FORM ACTION="<?=$PHP_SELF?>" NAME="SELECT_PRODUCT" METHOD="POST">

<INPUT TYPE="HIDDEN" NAME="action" VALUE="select">

<?

echo "<TR>";

echo "<TD class="main"><BR><B>Please select a product to edit:<BR></TD>";

echo "</TR>";

echo "<TR>";

echo "<TD class="main"><SELECT NAME="current_product_id">";



$query = "SELECT * FROM products_description where products_id LIKE '%' AND language_id = '$languageFilter' ORDER BY products_name ASC";



$result = mysql_query($query) or die(mysql_error());



$matches = mysql_num_rows($result);



if ($matches) {



  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {

                                                           

       $title = $line['products_name'];

       $current_product_id = $line['products_id'];

       

       echo "<OPTION VALUE="" . $current_product_id . "">" . $title;

       

  }

} else { echo "You have no products at this time."; }

  

echo "</SELECT>";

echo "</TD></TR>";



echo "<TR>";

echo "<TD class="main"><input type="image" src="" . $adminImages . "button_edit.gif"></TD>";

echo "</TR>";



?>

</FORM>

 

Ideally I would like to have a drop down that has :

 

model_number | Product Name

 

However if I can only get the model number that is fine.

 

I have tried to play around with the code to get it to work myself but have had no luck yet. I know that the table has to be changes from 'product_descriptions' to just 'products' (as the model number isn;t kept in 'product_descriptions'.

 

Any help would be appreciated.

 

Thanks.

Share this post


Link to post
Share on other sites

Would anybody be kind enough to share with me a URL, so that I can see a demo of this contribution?

Thanks in advance.


GALATASARAY RULES!

ultrAslan - ultrAslan - ultrAslan

Share this post


Link to post
Share on other sites

Ok after playing around with it I managed to get the dropdown to list the model numbers instead of the descriptions - however I think I will defiantely need a hand to get both model numbers and descriptions working in the one dropdown.

 

To get the model numbers working I changed

 

$query = "SELECT * FROM products_description where products_id LIKE '%' AND language_id = '$languageFilter' ORDER BY products_name ASC";

 

to

 

$query = "SELECT * FROM products ORDER BY products_model ASC";

 

and then:

 

 

$title = $line['products_name'];

 

to

 

$title = $line['products_model'];

 

If anyone else can give me a hand getting both to work together that would be great!

Share this post


Link to post
Share on other sites

While I can't give access to my admin section I can post some links on how this mod works and looks.

 

attribute1.jpg

 

This is the first option - I have made some changes, by getting the mod to display the model number as well as the description, the default install will just list the descritption. This pulldown lists ALL your products. Once you have selected a product you get taken to the next page:

 

attribute2.jpg

 

Again - I have added my model number at the top.

 

This screen lists ALL of your attributes and allows you to quickly select what attributes you require as well as any dollar differences. Click subit and you are all done.

 

Finally it also adds a Edit Attributes on the edit product page - as shown below.

 

attribute3.jpg

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hallo...

Work the v4b with MS2 and option_type_feature-v1.5?

 

billi


My English is unfortunately bad. Excused ask.

Share this post


Link to post
Share on other sites

Hiya...

 

Billi - I suggest you download option type feature v1.6 as the ReadMe.html file has been updated... and yes the two contribs. are compatiable.

 

Billi, bmcewan, AnnieO & whoever else is having this prob...

 

Small problem...might be a bit vague but.....

 

running MS1 with chandras option type feature 1.4 i have an option value set up with id o as text as per chandras readme although there is no name in the name column and a product option set up with name as the name and option type set up as text however when i go into your attribute manager it shows as No Values under this option where i would expect the text option to show.

barry

 

download the option type feature v1.6 contrib. as the ReadMe.html file has been updated and take a look at STEP 3. Update the Product Options to Product Options Values mapping.

 

This is lifted from the ReadMe.html file...

Some contributions require that the products_options_values_to_products_options_id table list the mapping of option types to option values. If you use one of these contributions i.e New Attribute Manager Contrib., then you must add a new record to the products_options_values_to_products_options table whenever you setup a new text option. Currently there is no admin tool for this step, so you must do it manually.

 

Table products_options_values_to_products_options_id

Field 1). products_options_values_to_products_options_id field - Let this autogenerate

Field 2). products_opitons_id field - Id from step 1

Field 3). products_options_values_id field - value of PRODUCTS_OPTIONS_VALUE_TEXT_ID (likely 0)

 

It is recommended that you keep the products_options_values_to_products_options_id table up to date, even if you don't use contributions that require you to do so. This is to ensure compatibility with future enhancements that you may want to use.

 

Hope this helps... :D

Share this post


Link to post
Share on other sites

Hi

 

Just loaded this program "Problem with New Attribute Manager" and it was very easy to load and only a couple of files to edit.

 

But I have a problem.

 

In the Admin section the program is listed on the left hand side as it should be but a little * is beside of it.

 

When I click on it to open the contribution it says:

 

Access Denied  

 

No Right Permission Access  

Please contact your Web Administrator to request  

more access or if you found any problem.

 

Anyone got any idea what I need to change to get this file to open?

 

thanks

Leon


I'm having a great Day - hope you are too!

 

Leon

Share this post


Link to post
Share on other sites

Found it in another Post!

 

I needed to store the files in the Admin section of the Administrator.

 

It would sure be nice if their was a manual or a troubleshooting page for this cart.

 

I still think the cart is the worlds best!

 

 

Posted: Wed Sep 10, 2003 7:31 pm    Post subject: Re: Define MAINPAGE v1.3    

 

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

 

It sounds to me like you've got an Admin contribution running in admin.  

 

If your admin contribution is like mine, you have to go into the Administrator within Admin, and click on file access, then open up the Catalog folder, and store the files associated with define_mainpage.php.  

 

I am using oscommerce 2.2 MS1 and Admin Account 1.2. This is what I had to do to make it accessable.  

 

If you are using another Admin Contribution, you may have to add a line in one of the languages files to make it accessable so that the Admin contribution recognizes it, and allows you permission to open that link.  

 

I hope this helps...


I'm having a great Day - hope you are too!

 

Leon

Share this post


Link to post
Share on other sites

@arse_soul

Thanks.. It works...

 

billi


My English is unfortunately bad. Excused ask.

Share this post


Link to post
Share on other sites

Hello I have installed v4b of this contr. looks good. I have a couple of problems however. When I click on the attribute manager on the left of the screen it goes to the edit screen then when I pick a product to edit and select edit I get a page cannot be displayed error. This also happens when I go to a specific product and click edit attributes, then make the changes and click update.

 

Any idea's. I am running ms2.2 I have the wyswyg html area with main page mod. my admin area is out side of the catalog folder and is in ssl directory. along with pwd protected.

 

Thanks, Kevin

Share this post


Link to post
Share on other sites

Ok, I don't think the links are pulling the full url. They only whow part of it in the address column instead of the full url. Anyones help would be greatly appre.

 

Thanks, Kevin

Share this post


Link to post
Share on other sites

Hey,

 

Does this work with 2.2 Milestone 2? I downloaded the newest version and it only referrs to the MS1 release. I figured to ask before I went and messed things up.

 

Thanks!

 

Kevin


Kevin Rosenthal

Share this post


Link to post
Share on other sites

No problems with this contrib since I came late to the party and seemingly everything is fixed...

 

 

Just wanted to say many, many, many thanks, as this baby is a life - ok amend that, tremendous time saver!!! :D :D :D

Share this post


Link to post
Share on other sites

I'm having a problem with this contribution,

 

Everything looks great and the attributes appear in the table to be selected for that product. But when i check some and click preview then update I get the following error:

 

1136 - Column count doesn't match value count at row 1

insert into products_attributes values ('', '155', '2', '9', '', '', '', '', '', '', '', '' )

[TEP STOP]

 

Does anyone know what the problem might be?

 

I would love to get this working as I have many many products to add attributes too.

 

Thanks in advance for anyhelp

Share this post


Link to post
Share on other sites

i have it installed. it was origanally not working because all my database tables have a prefix of osc_ infront of them so i looked through the php files included and added the prefix everywhere i thought it need it and now i am able to select products, however when i hit the edit button the page just seems to reload and does nothing.

 

what is the problem here?

 

i have my files in code listed below. thanks for helping

 

new_attributes.php

<?
$adminImages = "includes/languages/english/images/buttons/";
$backLink = "<a href=\"javascript:history.back()\">";

require('new_attributes_config.php');
require('includes/application_top.php');

if ( $cPathID && $action == "change" )
{
      require('new_attributes_change.php');

      tep_redirect( './' . FILENAME_CATEGORIES . '?cPath=' . $cPathID . '&pID=' . $current_product_id );

}

?>

<!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>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
   <table border="0" width="100%" cellspacing="2" cellpadding="2">
   <tr>
  <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
   <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
  </table></td>

<!-- body_text //-->
  <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  
<?
function findTitle( $current_product_id, $languageFilter )
{
$query = "SELECT * FROM osc_products_description where language_id = '$languageFilter' AND products_id = '$current_product_id'";

$result = mysql_query($query) or die(mysql_error());

$matches = mysql_num_rows($result);

if ($matches) {

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                        
      $productName = $line['products_name'];
      
}

return $productName;

} else { return "Something isn't right...."; }

}

function attribRedirect( $cPath )
{

return '<script LANGUAGE="JavaScript"> window.location="./configure.php?cPath=' . $cPath . '"; </script>';

}

switch( $action )
{
case 'select':
$pageTitle = 'Edit Attributes -> ' . findTitle( $current_product_id, $languageFilter );
require('new_attributes_include.php');
break;

case 'change':
$pageTitle = 'Product Attributes Updated.';
require('new_attributes_change.php');
require('new_attributes_select.php');
break;

default:
$pageTitle = 'Edit Attributes';
require('new_attributes_select.php');
break;

}

?>

  </table></TD>
  </TR>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

new_attributes_change.php

<?
// I found the easiest way to do this is just delete the current attributes & start over =)
MYSQL_QUERY( "DELETE FROM osc_products_attributes WHERE products_id = '$current_product_id'" );

// Simple, yet effective.. loop through the selected Option Values.. find the proper price & prefix.. insert.. yadda yadda yadda.
for ($i = 0; $i < sizeof($optionValues); $i++) {

  $query = "SELECT * FROM osc_products_options_values_to_products_options where products_options_values_id = '$optionValues[$i]'";

  $result = mysql_query($query) or die(mysql_error());

  $matches = mysql_num_rows($result);

     while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                              
          $optionsID = $line['products_options_id'];
          
     }


  $value_price =  $HTTP_POST_VARS[$optionValues[$i] . '_price'];

  $value_prefix = $HTTP_POST_VARS[$optionValues[$i] . '_prefix'];
  
  if ( $optionTypeInstalled == "1" ) {
                                      
      $value_type = $HTTP_POST_VARS[$optionValues[$i] . '_type'];
      $value_qty = $HTTP_POST_VARS[$optionValues[$i] . '_qty'];
      $value_order = $HTTP_POST_VARS[$optionValues[$i] . '_order'];
      $value_linked = $HTTP_POST_VARS[$optionValues[$i] . '_linked'];
      
      MYSQL_QUERY( "INSERT INTO osc_products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix, options_type_id, options_values_qty, attribute_order, collegamento )
                   VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix', '$value_type', '$value_qty', '$value_order', '$value_linked' )" ) or die(mysql_error());
                  
  } else if ( $optionSortCopyInstalled == "1" ) {
                                                
      $value_sort = $HTTP_POST_VARS[$optionValues[$i] . '_sort'];
      $value_weight = $HTTP_POST_VARS[$optionValues[$i] . '_weight'];
      $value_weight_prefix = $HTTP_POST_VARS[$optionValues[$i] . '_weight_prefix'];

      MYSQL_QUERY( "INSERT INTO osc_products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, products_attributes_weight, products_attributes_weight_prefix )
                   VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix', '$value_sort', '$value_weight', '$value_weight_prefix' )" ) or die(mysql_error());
                  
  } else {

      MYSQL_QUERY( "INSERT INTO osc_products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix )
                   VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix' )" ) or die(mysql_error());
              
  }            

}

// For text input option type feature by chandra
if ( $optionTypeTextInstalled == "1" && is_array( $HTTP_POST_VARS['optionValuesText'] )) {

 for ($i = 0; $i < sizeof($optionValuesText); $i++) {
                                                    
      $value_price =  $HTTP_POST_VARS[$optionValuesText[$i] . '_price'];

      $value_prefix = $HTTP_POST_VARS[$optionValuesText[$i] . '_prefix'];
      
      $value_product_id = $HTTP_POST_VARS[$optionValuesText[$i] . '_options_id'];
      
      MYSQL_QUERY( "INSERT INTO osc_products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix )
      VALUES( '$current_product_id', '$value_product_id', '0', '$value_price', '$value_prefix' )" ) or die(mysql_error());
      
 }

}










?>

new_attributes_config.php

<?

// Change to your default language ID if it differs.
$languageFilter = "1";

// If you have Options Type Feature ver. 2.02.MS1 by countezero installed - make this = "1"
$optionTypeInstalled = "0";

// If you have "Attributes Sorter & Copier v5.1 with weight"
// by Linda McGrath installed - make this = "1"
$optionSortCopyInstalled = "0";

// If you have Option Type Feature v-1.4 by Chandra Roukema installed - make this = "1"
$optionTypeTextInstalled = "0";
// If you have Option Type Feature v-1.4 by Chandra Roukema installed - set this to your
// PRODUCTS_OPTIONS_VALUE_TEXT_ID value ( usually "0" )
$optionTypeTextInstalledID = "0";

?>

new_attributes_functions.php

<?
// A simple little function to determine if the current value is already selected for the current product.
function checkAttribute( $current_value_id, $current_product_id, $current_product_option_id )
{
global $attribute_value_price, $attribute_value_prefix, $posCheck, $negCheck;

$query = "SELECT * FROM osc_products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id' AND options_id = '$current_product_option_id'";

$result = mysql_query($query) or die(mysql_error());

$isFound = mysql_num_rows($result);

if ($isFound) {

  while($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
      
      $attribute_value_price = $line['options_values_price'];
      $attribute_value_prefix = $line['price_prefix'];
      
      if ($attribute_value_prefix == "+") { $posCheck = " SELECTED";
                                            $negCheck = "";
                                            
      } else { $posCheck = "";
               $negCheck = " SELECTED";

      }

  }

  return true;
  
  } else {
  
  $attribute_value_price = "";
  $attribute_value_prefix = "";
  $posCheck = "";
  $negCheck = "";

  return false; }

}

function rowClass($i){
  $class1 = "attributes-odd";
  $class2 = "attributes-even";

  if ( $i%2 ) {
      return $class1;
  } else {
      return $class2;
  }
}

// For Options Type Contribution
function extraValues( $current_value_id, $current_product_id )
{
global $attribute_qty, $attribute_order, $attribute_linked, $attribute_prefix, $attribute_type, $isSelected;

if ( $isSelected ) {
                  
      $query = "SELECT * FROM osc_products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id'";

      $result = mysql_query($query) or die(mysql_error());

      while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                              
              $attribute_qty = $line['options_values_qty'];
              $attribute_order = $line['attribute_order'];
              $attribute_linked = $line['collegamento'];
              $attribute_prefix = $line['price_prefix'];
              $attribute_type = $line['options_type_id'];

      }
      
} else {
      
       $attribute_qty = "1";
       $attribute_order = "100";
       $attribute_linked = "0";
       $attribute_prefix = "";
       $attribute_type = "";
}

}

function displayOptionTypes( $attribute_type )
{
global $isSelected;

$availableTypes = array( 'Disabled' => '0', 'Select' => '1', 'Checkbox' => '2', 'Radio' => '3', 'Select Multiple' => '4', 'Text' => '5' );

foreach( $availableTypes as $name => $id ){
                                          
      if ( $isSelected && $attribute_type == $id ) { $SELECT = " SELECTED"; }

      else { $SELECT = ""; }
                                                                                            
      echo "<OPTION VALUE=\"" . $id . "\"" . $SELECT . ">" . $name;
      
}

}

// Get values for Linda McGrath's contribution
function getSortCopyValues( $current_value_id, $current_product_id )
{
global $attribute_sort, $attribute_weight, $attribute_weight_prefix, $isSelected;

if ( $isSelected ) {
                  
      $query = "SELECT * FROM osc_products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id'";

      $result = mysql_query($query) or die(mysql_error());

      while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                              
              $attribute_sort = $line['products_options_sort_order'];
              $attribute_weight = $line['products_attributes_weight'];
              $attribute_weight_prefix = $line['products_attributes_weight_prefix'];

      }
      
} else {
      
       $attribute_sort = "0";
       $attribute_weight = "";
       $attribute_weight_prefix = "";
}

}
function sortCopyWeightPrefix( $attribute_weight_prefix )
{
global $isSelected;

$availablePrefixes = array( '+', '-' );

foreach( $availablePrefixes as $prefix ) {
                                        
      if ( $isSelected && $prefix == $attribute_weight_prefix ) {
                                                                
              $SELECT = " SELECTED";
              
      } else { $SELECT = ""; }
      
      echo "<OPTION VALUE=\"" . $prefix . "\"" . $SELECT . ">" . $prefix;
      
      }
      
}

?>

new_attributes_include.php

<TR>
<TD class="pageHeading" colspan="3"><?=$pageTitle?></TD>
</TR>
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="SUBMIT_ATTRIBUTES">
<INPUT TYPE="HIDDEN" NAME="current_product_id" VALUE="<?=$current_product_id?>">
<INPUT TYPE="HIDDEN" NAME="action" VALUE="change">
<?

if ( $cPath ) echo "<INPUT TYPE=\"HIDDEN\" NAME=\"cPathID\" VALUE=\"" . $cPath . "\">";

require( 'new_attributes_functions.php');

// Temp id for text input contribution.. I'll put them in a seperate array.
$tempTextID= "1999043";

// Lets get all of the possible options

$query = "SELECT * FROM osc_products_options where products_options_id LIKE '%' AND language_id = '$languageFilter'";

$result = mysql_query($query) or die(mysql_error());

$matches = mysql_num_rows($result);

if ($matches) {

 while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                          
      $current_product_option_name = $line['products_options_name'];
      $current_product_option_id = $line['products_options_id'];

// Print the Option Name
      echo "<TR class=\"dataTableHeadingRow\">";
      echo "<TD class=\"dataTableHeadingContent\"><B>" . $current_product_option_name . "</B></TD>";
      echo "<TD class=\"dataTableHeadingContent\"><B>Value Price</B></TD>";
      echo "<TD class=\"dataTableHeadingContent\"><B>Price Prefix</B></TD>";
      
      if ( $optionTypeInstalled == "1" ) {
              
              echo "<TD class=\"dataTableHeadingContent\"><B>Option Type</B></TD>";
              echo "<TD class=\"dataTableHeadingContent\"><B>Quantity</B></TD>";
              echo "<TD class=\"dataTableHeadingContent\"><B>Order</B></TD>";
              echo "<TD class=\"dataTableHeadingContent\"><B>Linked Attr.</B></TD>";
              echo "<TD class=\"dataTableHeadingContent\"><B>ID</B></TD>";
              
      }
      
      if ( $optionSortCopyInstalled == "1" ) {
                                              
              echo "<TD class=\"dataTableHeadingContent\"><B>Weight</B></TD>";
              echo "<TD class=\"dataTableHeadingContent\"><B>Weight Prefix</B></TD>";
              echo "<TD class=\"dataTableHeadingContent\"><B>Sort Order</B></TD>";
              
      }

      echo "</TR>";
      
// Find all of the Current Option's Available Values
      $query2 = "SELECT * FROM osc_products_options_values_to_products_options WHERE products_options_id = '$current_product_option_id' ORDER BY products_options_values_id DESC";

      $result2 = mysql_query($query2) or die(mysql_error());
      
      $matches2 = mysql_num_rows($result2);

      if ($matches2) {

         $i = "0";

         while ($line = mysql_fetch_array($result2, MYSQL_ASSOC)) {

              $i++;
              
              $rowClass = rowClass( $i );

              $current_value_id = $line['products_options_values_id'];

              $isSelected = checkAttribute( $current_value_id, $current_product_id, $current_product_option_id );

              if ($isSelected) { $CHECKED = " CHECKED"; } else { $CHECKED = ""; }
              
              $query3 = "SELECT * FROM osc_products_options_values WHERE products_options_values_id = '$current_value_id' AND language_id = '$languageFilter'";
              
              $result3 = mysql_query($query3) or die(mysql_error());

              while($line = mysql_fetch_array($result3, MYSQL_ASSOC)) {

                      $current_value_name = $line['products_options_values_name'];

// Print the Current Value Name
                      echo "<TR class=\"" . $rowClass . "\">";
                      echo "<TD class=\"main\">";

// Add Support for multiple text input option types (for Chandra's contribution).. and using ' to begin/end strings.. less of a mess.
                      if ( $optionTypeTextInstalled == "1" && $current_value_id == $optionTypeTextInstalledID ) {

                              $current_value_id_old = $current_value_id;
                              $current_value_id = $tempTextID;

                              echo '<input type="checkbox" name="optionValuesText[]" value="' . $current_value_id . '"' . $CHECKED . '>  ' . $current_value_name . '  ';
                              echo '<input type="hidden" name="' . $current_value_id . '_options_id" value="' . $current_product_option_id . '">';
                              
                      } else {

                      echo "<input type=\"checkbox\" name=\"optionValues[]\" value=\"" . $current_value_id . "\"" . $CHECKED . ">  " . $current_value_name . "  ";
                      
                      }

                      echo "</TD>";
                      echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_price\" value=\"" . $attribute_value_price . "\" size=\"10\"></TD>";

                      if ( $optionTypeInstalled == "1" ) {
                              
                              extraValues( $current_value_id, $current_product_id );

                              echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_prefix\" value=\"" . $attribute_prefix . "\" size=\"4\"></TD>";
                              echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_type\">";
                              displayOptionTypes( $attribute_type );
                              echo "</SELECT></TD>";
                              echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_qty\" value=\"" . $attribute_qty . "\" size=\"4\"></TD>";
                              echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_order\" value=\"" . $attribute_order . "\" size=\"4\"></TD>";
                              echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_linked\" value=\"" . $attribute_linked . "\" size=\"4\"></TD>";
                              echo "<TD class=\"main\" align=\"left\">" . $current_value_id . "</TD>";
                              
                      } else {

                              echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-</SELECT></TD>";
                              
                      if ( $optionSortCopyInstalled == "1" ) {
                                                              
                              getSortCopyValues( $current_value_id, $current_product_id );

                              echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $attribute_weight . "\" size=\"10\"></TD>";
                              echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_weight_prefix\">";
                              sortCopyWeightPrefix( $attribute_weight_prefix );
                              echo "</SELECT></TD>";
                              echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_sort\" value=\"" . $attribute_sort . "\" size=\"4\"></TD>";
                              
                      }

                      }

                      echo "</TR>";

                      if ( $optionTypeTextInstalled == "1" && $current_value_id_old == $optionTypeTextInstalledID ) {

                         $tempTextID++;

                      }

              }
              
              if( $i == $matches2 ) { $i = "0"; }

         }

      } else {
        echo "<TR>";
        echo "<TD class=\"main\"><SMALL>No values under this option.</SMALL></TD>";
        echo "</TR>";


 }

}
}

?>
<TR>
<TD colspan="10" class="main"><BR><INPUT TYPE="image" src="<?=$adminImages?>button_save.gif">   <?=$backLink?><img src="<?=$adminImages?>button_cancel.gif" border="0"></A></TD>
</TR>
</FORM>

 

 

new_attributes_select.php

<TR>
<TD class="pageHeading" colspan="3"><?=$pageTitle?></TD>
</TR>
<FORM ACTION="<?=$PHP_SELF?>" NAME="SELECT_PRODUCT" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="action" VALUE="select">
<?
echo "<TR>";
echo "<TD class=\"main\"><BR><B>Please select a product to edit:<BR></TD>";
echo "</TR>";
echo "<TR>";
echo "<TD class=\"main\"><SELECT NAME=\"current_product_id\">";

$query = "SELECT * FROM osc_products_description where products_id LIKE '%' AND language_id = '$languageFilter' ORDER BY products_name ASC";

$result = mysql_query($query) or die(mysql_error());

$matches = mysql_num_rows($result);

if ($matches) {

 while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
                                                          
      $title = $line['products_name'];
      $current_product_id = $line['products_id'];
      
      echo "<OPTION VALUE=\"" . $current_product_id . "\">" . $title;
      
 }
} else { echo "You have no products at this time."; }

echo "</SELECT>";
echo "</TD></TR>";

echo "<TR>";
echo "<TD class=\"main\"><input type=\"image\" src=\"" . $adminImages . "button_edit.gif\"></TD>";
echo "</TR>";

?>
</FORM>

Share this post


Link to post
Share on other sites
I have installed this mod and it works fine (MS2 2.2) however we used Model numbers rather than descriptions to identify our products.

Does anyone know how to change the drop down box (new_attributes.php) to display the model number first then the product description?

I played around with the databased functions in new_attributes just trying to get it to list the model numbers instead of the description but no matter what I changed it kept displaying the description (if must be displaying it via one of the included files).

Anyway if anyone can have a look at this and let me know that would be great.

Thanks alot!

 

I would also be interested in a model number then description. I'll try the modification to change it from description to model number, but having both would be good.

 

 

Also, is there any way to set attributes for a complete category, or sub-category at once? This would make attributes a lot easier, and faster for me (and I'm sure other people as well).

 

Other than that, I love this contrib, and am finally using attributes because of it. However, with thousands of products that need to be added to my shop, things would go quicker if there was a way to set certain attributes to a category.

 

Thanks!

Share this post


Link to post
Share on other sites

Hi there...

first things first, FANTASTIC CONTRIB!!! my end users might actually be able to add attributes themselves :)

Number 2... I'm using Add Weight To Product Attributes v0.1 (http://www.oscommerce.com/community/contributions,1622), to add an individual weight to each product. Is this compatable with the attribute manager? Is there a simple way to make it compatable? it looks like Attributes Sorter & Copier v5.1 with weight accomplishes the same thing - should I just try and install this contrib (I'm trying not to install any more things than i need, *trying* to keep this as simple as possible)

Thanks

~Barbara

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  

×