Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute Sets Contribution


Recommended Posts

Hi, I'm having a basic prob & just want to be sure I'm dong this right. I stayed with 2.01 and it seems fine, at least I can define & attach attrib sets no problem.

But if I edit a product with a set attached, I always lose any other attribs.

Sorry if I'm doing something wrong, that's how I read the install notes. Am I doing the right steps, or is my install screwy? :-

 

1. Edit a Product; add an attribute set

2. Then add other attributes to the product (Admin > Products Attributes)

 

3. Edit the Product again: shows three drop-downs, one with my attrib set showing, not selected. So I select the set in that drop-down, and proceed.

The Preview secreen shows (pink zone at top):

 

Warning: No file uploaded.

Warning: No file uploaded.

ATTRIBUTE SET WARNING: At least one Attribute Set is set to '--none--' of the 3 total set(s) used for this product.

ATTRIBUTE SET WARNING: At least one Attribute Set is set to '--none--' of the 3 total set(s) used for this product.

 

4. If I hit Update, the Product loses my 'other' attribs (as in step 2 i.e. ones not in a set)

 

Thanks ~

I am also having the same problem, though I have installed 3.0. I did a "Differences" search on my backed-up /catalog/admin/categories.php and I think I've isolated the source of the problem, though I haven't found a way to fix it yet.

 

Here's what I believe to be the culprit code (from 3.0 - 2.0-ers, search for //JJG preview - warning that an Attribute Set is set to '--none--' in /catalog/admin/categories.php)

 

        }

       $products_image_small = new upload('products_image_small');

       $products_image_small->set_destination(DIR_FS_CATALOG_IMAGES);

       if ($products_image_small->parse() && $products_image_small->save()) {

         $products_image_small_name = $products_image_small->filename;

       } else {

         $products_image_small_name = (isset($HTTP_POST_VARS['products_previous_image_small']) ? $HTTP_POST_VARS['products_previous_image_small'] : '');

       }

// npe begin admin attributes set 040818 #change

//JJG preview - warning that an Attribute Set is set to '--none--' Begin

// replaced both lines below

//        $WARNING_MSG = "<b>ATTRIBUTE SET WARNING:</b> At least one Attribute Set is set to '--none--'";

//        $WARNING_MSG .= "  of the  ".$HTTP_POST_VARS['AttributeSetCount']. " total set(s) used for this product.";

       

       $WARNING_MSG = sprintf(ERROR_ATTRIBUTE_SET_WARNING,TEXT_NONE, $HTTP_POST_VARS['AttributeSetCount']);

       for($i=0; $i< ($HTTP_POST_VARS['AttributeSetCount']-1); $i++){

// replaced line below

//              if( empty($HTTP_POST_VARS["products_attributes_sets_id_$i"]) ){

                               

               if( empty($HTTP_POST_VARS['products_attributes_sets_id_' . $i]) ){

                       $messageStack->add($WARNING_MSG, 'error');

               }

       }

//JJG preview - warning that an Attribute Set is set to '--none--' End

// npe end admin attributes set #change

      

       break;

 

I'll post any solution I can come up with. (If I do.)

 

Amber

Link to comment
Share on other sites

  • Replies 659
  • Created
  • Last Reply

Top Posters In This Topic

Hey man, I just installed your contribution exactly as you stated on your installation files. Had no problem with that.

 

The problem i'm facing now is the fact that I get a PERMESSION DENIED when I try to access ATTRIBUTE_SETS. I get this

 

No Right Permission Access

Please contact your Webmaster to request

more access or if you found any problem.

 

[ BACK ]

 

it's all within the admin panel! The chmod on the file is 644 "just like all the other files" so it should work.

 

Another problem i'm facing is I'm seeing two Products Attributes! The one at the very top i cannot click on it. What's the problem here? This is what my CATALOG option looks like on the left:

 

Products Attributes < cannot click on this one

Attributes Sets

Categories/Products

Products Attributes

 

 

Can you help out here because I got no clue what's wrong...thnx man :)

Link to comment
Share on other sites

I have installed and reinstalled osCommerce, and this contrib.. but I get this error when trying to add a product with an attribute set:

 

Size > S

Size > m

Size > L

Size > XL

Size > XXL 10% +

Size > XXXL 15% +

 

Then I get this error when I click insert:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''+')' at line 1

 

insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) values (33,2,6,10%,'+')

 

As well, Item prices no longer show up anywhere in the store....

 

Any ideas? :'(

 

Thanks

 

Bob

 

PS.. if I use a set without xxl and xxxl and the associated increases in price, I do not get the error, but the prices still do not show up..

Edited by canajun
Link to comment
Share on other sites

hi

trying to install your contribution.

i've installed version 2.0 without problems, than i wanted to install the updates to version 3. and... well. maybe i'm stupid or something, but i totally don't understand what author wants me to do... for example:

Changes on SQL-DB

 

update product_attribute_sets update

 

 

ALTER TABLE `products_attributes_sets` ADD `products_attributes_language` INT( 11 ) NOT NULL AFTER `products_attributes_sets_id` ;

 

 

DROP TABLE IF EXISTS `products_attributes_sets_values`;

CREATE TABLE `products_attributes_sets_values` (

  `products_attributes_sets_id` int(6) NOT NULL default '0',

  `products_attributes_languages` int(11) NOT NULL default '0',

  `products_attributes_sets_name` varchar(30) NOT NULL default '',

  KEY `products_attributes_sets_id` (`products_attributes_sets_id`),

  KEY `products_attributes_language` (`products_attributes_language`)

) TYPE=MyISAM;

 

// change the 1 to your administrativ main language. edit them and give a name according to the language for each set afterwards

 

INSERT  INTO products_attributes_sets_values

SELECT products_attributes_sets_id, 1, products_attributes_sets_name

FROM  `products_attributes_sets`

 

 

ALTER TABLE `products_attributes_sets` DROP `products_attributes_sets_name`

 

where should i put this? what should i do with it...? i've tried to put it in to phpmyadmin but it didn't worked...;] can you please explain step by step how to install this update? i'm new in php and mysql, so it's possible that i've done something wrong.

Link to comment
Share on other sites

Tired of adding each Attribute for each Option Drop Down List?  Yeah, me too!  This is why I created this contribution. 

 

Here is how it works:

Create an Attribute Set by clicking "Attribute Sets" in the Catalog are of your osCommerce Administration.  Select an Option Name (e.g., Sizes, Colors, Memory, etc...).  Then select how many item in the Option Drop Down list you need (e.g. if you list is for Sizes you may need a list size of 3 for Small, Medium, Large).  Then you click Ok.  The next page you will have three attribute rows that you can set values for, then give this Attribute Set a name.  That's it.

 

Now when you edit an existing product or when you create a new product you just select which set you want this product to have.

 

You will have to create your own Options and Option Values, but you will never have to ever use that Product Attribute  page again. :-)

 

All this contribution does is insert rows into the products_attributes table, so it is compatiable with your site now.  The only thing you'll have to do is when you edit a product, set it to use an Attribute Set, if it needs a drop-down list in the online catalog, otherwise leave it set to "-- none --".

You can find this contribution at: http://www.oscommerce.com/community/contributions,2201 

I developed this contribution with osCommerce 2.2 MS2.

 

I only use 1 language, English so I don't know how it would work with other languages but I'd be willing to work with someone if they want to improve on this first version to make it multi-language compatiable.

 

 

 

Joey,

 

This contribution is just what I need. I have a candle company with 93 fragrances.

 

My problem is that I'm a total newbie and don't know how to add a contribution to the OSCommerce package. I am using a 2003 version supplied by my webhost (IPowerweb). I have d/l the contribution. What directories do I add the files to? Are there any pitfall I should know about?

 

Thanks in advance.

 

Jerry P.

Link to comment
Share on other sites

Hi Joey, :thumbsup:

 

Good to see that the contrib support has crossed 9 pages :D . I am one of the 1st users I guess and though I dont concentrate on adding new stuff (contribs) to my store anymore, yours is a major help to me anytime.

 

Keep in touch

 

-Murali B)

Edited by donthecat

--- DontheCat ---

 

Obviously the truth is what's so

Not so obviously, it's also so what.

Link to comment
Share on other sites

:( NEED HELP!!!

 

I've read all 10 pages now of this topic......some with similar, but, nothing i try seems to work for me......

 

when i goto admin/product_attribute_sets.php.........

 

I create a new set, name it "SIZE", add 7 rows, but the option value list is empty...."tried adding new options, still nothing....."

 

Also on my products page...i dont have the attibute set menu?????

 

 

have already put head through wall trying to figure this out

 

please help

 

Kpoythat

Link to comment
Share on other sites

Hello,

I am wondering if it is possible to use Attribute Sets as well as other Attributes added one at a time. Currently, I have different sizes for shoes that are available for products, but some shoes don't have all the sizes, so I need to add these seperately. I don't think the Attribute Set was designed to work with using the Product Attributes page. I can add Attributes one at a time, but when I edit the product and update (even if I change nothing), the other attributes are wiped off the product. It seems to be erasing everything except the attribute sets that are selected. Some of the options I need are only one color, so I don't need a whole set for a single color. Is there a way to change it so that when editing a product, it doesn't erase all the attributes that are connected to the product. More of an append than replace, I guess. I'm not sure how I could do this, but any help would be appreciated.

 

Thanks,

Matt

Link to comment
Share on other sites

Alley Kat:

 

I think you have misunderstood the procedure.

 

Once you create your Attibute Sets, you should never have to go back to the Product Attributes area again. Use these steps.

 

1) Try to create all the Attribute Sets you could possible need.

2) For new products: select the attribtue set this product will use.

- If this product needs more attribute sets (i.e., more than one drop-down on eht product_info.php page) then edit the product and it should show one unused attribute set drop-down list that can be used to add the second attribute set which will ad another drop down list on the product_info.php page. Continue if you need more drop down lists on the product_info.php page.

- For exisiting products: just edit the product and it should show one unused attribute set drop-down list that can be used to add the second attribute set which will ad another drop down list on the product_info.php page. Continue if you need more drop down lists on the product_info.php page.

 

I hope this helps.

 

Joey

 

 

 

 

Hi, I'm having a basic prob & just want to be sure I'm dong this right. I stayed with 2.01 and it seems fine, at least I can define & attach attrib sets no problem.

But if I edit a product with a set attached, I always lose any other attribs.

Sorry if I'm doing something wrong, that's how I read the install notes. Am I doing the right steps, or is my install screwy? :-

 

1. Edit a Product; add an attribute set

2. Then add other attributes to the product (Admin > Products Attributes)

 

3. Edit the Product again: shows three drop-downs, one with my attrib set showing, not selected. So I select the set in that drop-down, and proceed.

The Preview secreen shows (pink zone at top):

 

Warning: No file uploaded.

Warning: No file uploaded.

ATTRIBUTE SET WARNING: At least one Attribute Set is set to '--none--' of the 3 total set(s) used for this product.

ATTRIBUTE SET WARNING: At least one Attribute Set is set to '--none--' of the 3 total set(s) used for this product.

 

4. If I hit Update, the Product loses my 'other' attribs (as in step 2 i.e. ones not in a set)

 

Thanks ~

Link to comment
Share on other sites

Nevsie, and others:

 

The pink warning you get at the top is normal in most cases, because when you edit a product with just ONE attribute set you will also have one attibute set unused, which is the cause of the warning. One warning is typcally OK, more than one warning is probably telling you that you are probably going to lose you drop-down list because your attribute sets are all UNSET. It is just a warning, it is not an error, if you understand what I just typed then it shouldn't be a problem, it is just a reminder so you don't accidently post an edited product with zero attribute sets.

 

Joey

 

 

Having the exactly same problem as above... If i load am image its says successfull image load... but it is always followed by Warning: No file uploaded... no matter what...

 

I am sure this is just a typo of mine, or a missed patch... I have only done the basic 2.0.1 so far... any ideas?

 

Cheers, N

Link to comment
Share on other sites

agentolivia:

 

Thanks for the help!!!! I don't know what versions above 2.1 do. I am hoping do some work on my own site and add the modification feature to version 2.1 during the holidays time-off.

 

Joey

 

 

I am also having the same problem, though I have installed 3.0. I did a "Differences" search on my backed-up /catalog/admin/categories.php and I think I've isolated the source of the problem, though I haven't found a way to fix it yet.

 

Here's what I believe to be the culprit code (from 3.0 - 2.0-ers, search for //JJG preview - warning that an Attribute Set is set to '--none--' in /catalog/admin/categories.php)

 

        }

       $products_image_small = new upload('products_image_small');

       $products_image_small->set_destination(DIR_FS_CATALOG_IMAGES);

       if ($products_image_small->parse() && $products_image_small->save()) {

         $products_image_small_name = $products_image_small->filename;

       } else {

         $products_image_small_name = (isset($HTTP_POST_VARS['products_previous_image_small']) ? $HTTP_POST_VARS['products_previous_image_small'] : '');

       }

// npe begin admin attributes set 040818 #change

//JJG preview - warning that an Attribute Set is set to '--none--' Begin

// replaced both lines below

//        $WARNING_MSG = "<b>ATTRIBUTE SET WARNING:</b> At least one Attribute Set is set to '--none--'";

//        $WARNING_MSG .= "  of the  ".$HTTP_POST_VARS['AttributeSetCount']. " total set(s) used for this product.";

       

       $WARNING_MSG = sprintf(ERROR_ATTRIBUTE_SET_WARNING,TEXT_NONE, $HTTP_POST_VARS['AttributeSetCount']);

       for($i=0; $i< ($HTTP_POST_VARS['AttributeSetCount']-1); $i++){

// replaced line below

//              if( empty($HTTP_POST_VARS["products_attributes_sets_id_$i"]) ){

                               

               if( empty($HTTP_POST_VARS['products_attributes_sets_id_' . $i]) ){

                       $messageStack->add($WARNING_MSG, 'error');

               }

       }

//JJG preview - warning that an Attribute Set is set to '--none--' End

// npe end admin attributes set #change

      

       break;

 

I'll post any solution I can come up with. (If I do.)

 

Amber

Link to comment
Share on other sites

If you want to remove the warnings, feel free to do so. Again, warnings do hurt anything and won't change anything regarding to the way your product is displayed it is just added as a reminder. This is especially helpful when editing an existing product that had its attributes added the old, OSC way. When you edit this product it will have the attribute set list UNSET and the warning is a reminder to check the attribute set list to assure you didn't forget something.

 

If you remove it, don't come back making posts that your products are showing up with zero drop-down lists.

 

Joey

 

 

agentolivia:

 

Thanks for the help!!!! I don't know what versions above 2.1 do.  I am hoping do some work on my own site and add the modification feature to version 2.1 during the holidays time-off.

 

Joey

Link to comment
Share on other sites

If you are seeing all uppercase text for links or names, this tells me that you didn't (correctly) install the file located in either of these locations:

 

includes\languages\english\categories.php(line 79):

define('TEXT_PRODUCTS_ATTRIBUTES_SET', 'Attribute Sets:');

 

 

includes\languages\english\products_attributes_sets.php(line 13):

define('HEADING_TITLE', 'Attribute Sets');

 

Where and how are you trying to access the attribute sets?

 

You are getting duplicates for the "Products Attributes" because you must have made an error in the installation.

 

Look in /catalog/admin/includes/boxes/catalog.php and you should see an if statement that looks very close to this (from mine):

 

  if ($selected_box == 'catalog') {
   $contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
                                  '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
                                  '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES_SETS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES_SETS . '</a><br>' .
      '<a href="' . tep_href_link('froogle.php', '', 'NONSSL') . '" class="menuBoxContentLink">Froogle Exporter</a><br>' .                                  '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
                                  '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
                                  '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
                                  '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');
 }

 

Joey

 

 

 

Hey man, I just installed your contribution exactly as you stated on your installation files. Had no problem with that.

 

The problem i'm facing now is the fact that I get a PERMESSION DENIED when I try to access ATTRIBUTE_SETS. I get this

 

No Right Permission Access

Please contact your Webmaster to request

more access or if you found any problem.

 

[ BACK ]

 

it's all within the admin panel! The chmod on the file is 644 "just like all the other files" so it should work.

 

Another problem i'm facing is I'm seeing two Products Attributes! The one at the very top i cannot click on it. What's the problem here? This is what my CATALOG option looks like on the left:

 

Products Attributes < cannot click on this one

Attributes Sets

Categories/Products

Products Attributes

Can you help out here because I got no clue what's wrong...thnx man :)

Link to comment
Share on other sites

canajun:

 

Interesting!!! I think this is a legitamate bug. I bet it is because of the "%". It should have a tick on each side of it just like the plus sign.

 

In the products_attributes_sets.php page, there is line like the one below (around line 211), notice that my last two

$insert_sql="insert into ".TABLE_PRODUCTS_ATTRIBUTES_SETS." (products_attributes_sets_name, products_attributes_sets_value) values ('".$HTTP_POST_VARS['products_attributes_sets_name']."','".$insert_value."')";

 

Make sure it looks like my line.

 

Joey

 

 

I have installed and reinstalled osCommerce, and this contrib.. but I get this error when trying to add a product with an attribute set:

 

Size > S

Size > m

Size > L

Size > XL

Size > XXL  10%  +

Size > XXXL 15%  +

 

Then I get this error when I click insert:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''+')' at line 1

 

insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) values (33,2,6,10%,'+')

 

As well, Item prices no longer show up anywhere in the store....

 

Any ideas?  :'(

 

Thanks

 

Bob

 

PS.. if I use a set without xxl and xxxl and the associated increases in price, I do not get the error, but the prices still do not show up..

Link to comment
Share on other sites

soloo:

 

I totally understand about version 3 by the other guy. I can't see why you would have even tried to install it considering all the negative posts about version 3.

 

I will not troubleshoot his code, sorry. It takes enough time just answering questions on my versions.

 

Joey

 

 

hi

trying to install your contribution.

i've installed version 2.0 without problems, than i wanted to install the updates to version 3. and... well. maybe i'm stupid or something, but i totally don't understand what author wants me to do... for example:

where should i put this? what should i do with it...? i've tried to put it in to phpmyadmin but it didn't worked...;] can you please explain step by step how to install this update? i'm new in php and mysql, so it's possible that i've done something wrong.

Link to comment
Share on other sites

airtap:

 

I will do it for you for a small charge for my time just to make sure there are no problems, or you can pay someone else to do it for you, but I wouldn't try it yourself unless you are comfortable with PHP and SQL. People don't realize that any contribution is an exact science, you make a small mistake anywhere and it just won't work right.

 

Good luck,

 

Joey

 

Send me an email via this forum's control panel by clicking my user name and send me an email.

 

 

Joey,

 

This contribution is just what I need. I have a candle company with 93 fragrances.

 

My problem is that I'm a total newbie and don't know how to add a contribution to the OSCommerce package. I am using a 2003 version supplied by my webhost (IPowerweb). I have d/l the contribution. What directories do I add the files to? Are there any pitfall I should know about?

 

Thanks in advance.

 

Jerry P.

Link to comment
Share on other sites

donthecat:

 

Good to hear from you too. As you can see this one contribution is keeping me busy answering questions.

 

I'm glad your version is working for you.

 

Take care.

 

Joey

 

 

Hi Joey, :thumbsup:

 

Good to see that the contrib support has crossed 9 pages  :D . I am one of the 1st users I guess and though I dont concentrate on adding new stuff (contribs)  to my store anymore, yours is a major help to me anytime.

 

Keep in touch

 

-Murali  B)

Link to comment
Share on other sites

tfadonis:

 

With some custom programming this could be done. It would be just a combination of using the old method and the Attribute Set method.

 

Joey

 

Hello,

I am wondering if it is possible to use Attribute Sets as well as other Attributes added one at a time.  Currently, I have different sizes for shoes that are available for products, but some shoes don't have all the sizes, so I need to add these seperately.  I don't think the Attribute Set was designed to work with using the Product Attributes page.  I can add Attributes one at a time, but when I edit the product and update (even if I change nothing), the other attributes are wiped off the product.  It seems to be erasing everything except the attribute sets that are selected.  Some of the options I need are only one color, so I don't need a whole set for a single color.  Is there a way to change it so that when editing a product, it doesn't erase all the attributes that are connected to the product.  More of an append than replace, I guess.  I'm not sure how I could do this, but any help would be appreciated.

 

Thanks,

Matt

Link to comment
Share on other sites

Just a quick note to the osComm dev community that has been working with Joey's useful Attribute Set contribution:

 

We've successfully developed the code to allow for MULTIPLE ATTRIBUTE SETs on any given product, successfully installed on a stable version of Attribute Sets 2.1.

 

You may want to avoid version 3 until something cleaner is in place!

 

Thx

Carpe Carp: Seize the Fish.

Link to comment
Share on other sites

can someone tell me which is the last known good config to this attribute, the one i downloaded doest seem to work, i people have added to this contribution and maybe they screwed it up or maybe it was me...

 

Please state the person and date of the contribution that you use.

i am still using version 2

 

thanks

 

derreck

Edited by kopythat200
Link to comment
Share on other sites

can someone tell me which is the last known good config to this attribute, the one i downloaded doest seem to work, i people have added to this contribution and maybe they screwed it up or maybe it was me...

 

Please state the person and date of the contribution that you use.

i am still using version 2

 

thanks

 

derreck

 

Kopycat,

 

Stick with version 2.1 for now. I believe Joey is still doing some more work on instructions and coding for version 3. The major diff between the two versions is that version 3 attempts to offer editable Attribute sets.

 

Thx

Carpe Carp: Seize the Fish.

Link to comment
Share on other sites

version 3 does offer editable attribute sets and does work. it works great.

 

one thing i found is the attributes sets field is set at varchar 255 and i ran into trouble with that, if you get too many attributes, it will not add all the sets, i changed mine to text and now i can add tons of attributes.

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...