Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute Sets Contribution


Recommended Posts

I have installed the contrbution but my host wouldn't let me upload the edit code because the fine name was too long. I changed the name from products_attributes_sets_edit.php to products_attributes_sete.php. I changed it in the codes everywhere I saw it but I guess I missed something... when I go to add one of my attribute sets I have made to a product I get this.... it trys to take me to..

 

http://customphotoinvitations.com/osCommer...&cPath=26_41_44

Link to comment
Share on other sites

  • Replies 659
  • Created
  • Last Reply

Top Posters In This Topic

I installed your Atribute sets it works fantastic great job ...I do need to be able to sort all the options in a specific order do you have any ideas?anyone? I am willing to pay

Thanks

Dave

PS I have alot of options 15 to 20 per item

Link to comment
Share on other sites

I have installed the contrbution but my host wouldn't let me upload the edit code because the fine name was too long.  I changed the name from products_attributes_sets_edit.php to products_attributes_sete.php.  I changed it in the codes everywhere I saw it but I guess I missed something... when I go to add one of my attribute sets I have made to a product I get this.... it trys to take me to..

 

http://customphotoinvitations.com/osCommer...&cPath=26_41_44

 

You most certainly did. Every file in osC is defined as a filename constant.

You need to find the files filenames.php (in admin/includes directory I think) and change the lines in there where the constant variable FILENAME_PRODUCTS_ATTRIBUTES_SETS is defined. .eg.

define('FILENAME_PRODUCTS_ATTRIBUTES_SETS', 'products_attributes_sets.php');
define('FILENAME_PRODUCTS_ATTRIBUTES_SETS_EDIT', 'products_attributes_sets_edit.php');

 

Be lucky!

 

Chris.

Link to comment
Share on other sites

Ok, please help me figure out what's going on here...

 

I had one of the early versions installed and although everything seemed to work ok on the buyer's end, when I got the orders on the administration end I'd see something like this:

 

1 x Cascading Ear-Cuff

- :

- :

 

The two " -: " are where the attributes are supposed to be (one for gemstone and one for crystal color) that were selected at the items's description on the website (http://www.airuma.com/product_info.php/cPath/70_3/products_id/374?osCsid=124888f169b9248bed926cebe97ef0c7)

 

So, after seen there was another few versions loaded, I got my husband to download the latest and set it up, also checking if there was anything I was missing from my previous install.

 

Well, everything works about the same. I still get the - : under the products, and I can't figure out what's gone wrong.

 

Please help!

 

Thanks!!

Link to comment
Share on other sites

Sorry if this has been posted before. I've searched the word "bug" in the first 7 pages. But I found no such post. Just don't have the patience to continue searching.

 

I found a bug:

If some attribute-sets are setup and assigned to a product, and one of the attribute-sets is modified, the product will lose all other ASes with only the modified AS remained.

(Attribute Sets version 5.5)

 

This is not a critical bug. But it will be great if it's fixed.

 

Almost forgot to say: Thank you Joey for the great contribution. Thank you osCommerce.

 

PS: This is my first post in osCommerce community. B)

 

EDIT: add version info.

Edited by ala5
Link to comment
Share on other sites

Hello Attribute set'ers

I posted this yesterday to the general support topic by mistake so here it is again in the proper topic:

 

I am a fairly new user so this might be obvious to someone else but not to me. I followed the instructions for the installation of Attribute Sets and the process of adding and assigning attributes to a product works great. A real time saver. Thank you.

 

In the process of that straight forward installation, a not so straight-forward problem emerged in the catalog section. All seems to ok until a product info page is displayed and in which case the attribute pulldown boxes show up but no product desciption, price or image, and the error:

 

"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\.........\catalog\includes\functions\database.php on line 99"

 

The function pointed to in database.php is:

 

line 98 function tep_db_fetch_array($db_query) {

line 99 return mysql_fetch_array($db_query, MYSQL_ASSOC);

}

 

This datbase.php file is unmodified and compares identically. The admin/includes/functions/database.php was checked and the same line is identical. The changes to that file are in the appending of two functions at the end. Apparently this function returns the associated index of the array but I am not sure.

 

Ok, master Gurus, any ideas?

Stan

Link to comment
Share on other sites

Hello Attribute set'ers

I posted this yesterday to the general support topic by mistake so here it is again in the proper topic:

 

I am a fairly new user so this might be obvious to someone else but not to me. I followed the instructions for the installation of Attribute Sets and the process of adding and assigning attributes to a product works great. A real time saver. Thank you.

 

In the process of that straight forward installation, a not so straight-forward problem emerged in the catalog section. All seems to ok until a product info page is displayed and in which case the attribute pulldown boxes show up but no product desciption, price or image, and the error:

 

"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\.........\catalog\includes\functions\database.php on line 99"

 

The function pointed to in database.php is:

 

line 98 function tep_db_fetch_array($db_query) {

line 99 return mysql_fetch_array($db_query, MYSQL_ASSOC);

}

 

This database.php file is unmodified and compares identically. The admin/includes/functions/database.php was checked and the same line is identical. The changes to that file are in the appending of two functions at the end. Apparently this function returns the associated index of the array but I am not sure.

 

Ok, master Gurus, any ideas?

Stan

 

check product_info.php for the relevant call to the function tep_db_fetch_array.

Then find the variable that is sent as the db query e.g. tep_db_fetch_array($my_query)

You then need to find the line that assigns $my_query (e.g. $my_query='select....';)

Something in $my_query is not a valid my_sql query e.g. likely issues (guesses): the syntax is incorrect and/or a variable has an empty value. (this can also be caused by register_globals off if the code is not optimised for this - not up to date with latest version so not sure if this still an issue)

 

have fun.

Chris

Link to comment
Share on other sites

I'm having a similar problem as the one guy above.

The error I get is this:

 

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/airuma/public_html/admin/includes/functions/database.php on line 45

0 -

 

select products_attributes_sets_id from products_attributes_sets_to_products where products_id=97

 

[TEP STOP]

 

It comes up when I try to EDIT a product, no matter if it has attributes or not (the only thing that changes between products is the product id, the rest is always the same)

When I try to add a product, everything looks and works peachy.

 

Here is line 45 on the admin/includes/functions/database.php

It has never been edited, and is identical to the original.

 

$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

 

Where should I be looking at to fix this?

 

Thanks.

Link to comment
Share on other sites

check product_info.php for the relevant call to the function tep_db_fetch_array.

Then find the variable that is sent as the db query e.g. tep_db_fetch_array($my_query)

You then need to find the line that assigns $my_query (e.g. $my_query='select....';)

Something in $my_query is not a valid my_sql query e.g. likely issues (guesses): the syntax is incorrect and/or a variable has an empty value. (this can also be caused by register_globals off if the code is not optimised for this - not up to date with latest version so not sure if this still an issue)

 

have fun.

Chris

 

Hi Chris

Thanks for the suggestions but contrary to your last suggestion...I am not having fun.

I tried searching in the areas you kindly suggested and have not found the culprit so I decided to start over, reloaded the entire MS2.2 and will try it again. All is well with the original code and the modified MySql db. I'll shout out again if I run into problems as I install Attribute Sets the second time. Even this hassle will be worth not having to add all the attributes for each product as with the original attribute functions of osCommerce.

Thanks again

Stan

Link to comment
Share on other sites

any idea why on some items my sets are sorting correctly and on others they are not?

Product 1~ sorting correctly

http://customphotoinvitations.com/osCommer...&products_id=39

 

Product 2~ same attribute sets but not sorting correctly...

http://customphotoinvitations.com/osCommer...&products_id=45

 

Any idea why?? I used the same sets on both items.

Link to comment
Share on other sites

I can also confirm this error. It's actually a pretty serious bug. If you have an attribute assigned to say 100 products, then edit the attribute, ALL of the other attributes are deleted for the 100 products. Then you have to go back in and reassign attributes for all 100 products :(

 

Anyone have a quick fix?

 

Sorry if this has been posted before. I've searched the word "bug" in the first 7 pages. But I found no such post. Just don't have the patience to continue searching.

 

I found a bug:

If some attribute-sets are setup and assigned to a product, and one of the attribute-sets is modified, the product will lose all other ASes with only the modified AS remained.

(Attribute Sets version 5.5)

 

This is not a critical bug. But it will be great if it's fixed.

 

Almost forgot to say: Thank you Joey for the great contribution. Thank you osCommerce.

 

PS: This is my first post in osCommerce community. B)

 

EDIT: add version info.

Link to comment
Share on other sites

To explain further:

For example, you have the attributes

Color: red, green, blue

Size: Small, Medium, Large

Sleeves: Long-sleeve, Short-sleeve

 

If you edit the Color attribute, ALL of the attributes are deleted from any products using the Color attribute. IE Size and Sleeves are deleted as well.

Link to comment
Share on other sites

I can also confirm this error. It's actually a pretty serious bug. If you have an attribute assigned to say 100 products, then edit the attribute, ALL of the other attributes are deleted for the 100 products. Then you have to go back in and reassign attributes for all 100 products :(

 

Anyone have a quick fix?

 

It happened on my site too and I lost a bunch of attributes. I'm using 4.0. I also seemed to lose a lot of the actual attribute sets somehow (but not the attributes). I haven't figured out why some were lost but not all.

 

If I figure out a fix I'll post it.

Link to comment
Share on other sites

Ok, I got the database.php error figured out, but I still have a problem.

 

When a customer places an order and chooses the attribute, the attribute is not transfered to the database like everything else and they see this on the checkout confirmation (and the same shows on the order side on the admin):

 

1 Dress

-:

 

The table orders_products_attributes is empty in the following fields:

 

products_options

products_options_values

 

for all products purchased since I installed this contribution.

 

All the other tables look ok, I rechecked them quite a bit.

 

When placing an order, the customer can see the attributes all the way through checkout until the checkout confirmation page, so there is probably something just not going through when they click the "continue" button after all the data is entered. Everything else goes through, though except for the attributes.

 

Someone PLEASE help. This is a live shop and I've had to ask customers via email what the attributes they chose were. I need to figure this out but I can't put my finger on it! :'(

Link to comment
Share on other sites

HI,

 

i installed this contribution, but when i try to add the set to a product i get this error.

 

 

Attribute Sets Edit 

 

1054 - Unknown column 'sort_order' in 'field list'

 

insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix, sort_order) values (28,1,1,0,'+',1)

 

[TEP STOP]

 

 

Can some one plese help. thank you

Link to comment
Share on other sites

I can also confirm this error. It's actually a pretty serious bug. If you have an attribute assigned to say 100 products, then edit the attribute, ALL of the other attributes are deleted for the 100 products. Then you have to go back in and reassign attributes for all 100 products :(

 

Anyone have a quick fix?

 

 

This is a serious bug, and it cost me a lot of time. I used the most recent version 5.5, and lost a lot of attributes because of this.

 

The problem was that the code triggered upon editing the AS was not taking into account additinoal Attribute Sets installed on the products.

 

Here is the quick fix, as requested. I am going to update the package once I make a few more changes to this contribution.

 

In catalog/admin/products_attributes_sets.php, around line 231, find this:

 

jjg_db_attributeSets( $arr_ProductsAttributeSetsIDs, $products_ids['products_id'], "update_product" );

 

and CHANGE it to this:

 

                $arr_NewProductsAttributeSetsIDs = array();
               $products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS." where products_
id =".$products_ids['products_id'];
               $products_attributes_sets_query = tep_db_query($products_attributes_sets_query_sql);
               $newcount = 0;
               while($fixed_products_attributes = tep_db_fetch_array($products_attributes_sets_query)) {
                       $arr_NewProductsAttributeSetsIDs[$newcount] = $fixed_products_attributes['products_attributes_sets_id'];
                       $newcount++;
               }
               jjg_db_attributeSets( $arr_NewProductsAttributeSetsIDs, $products_ids['products_id'], "update_product" );

 

 

If there are lingering problems after this, let me know. I'll see what I can do before repackaging. Feel free to aim me if you are still having problems and I'll try to help.

 

LinuxDave

LinuxDave

Link to comment
Share on other sites

Hi there,

 

i implemented this contribution a while ago and it works really great.

I only have one question.

 

I was also searching for a contrib for quantity/stock managing per product attribute, for example on sizes:

 

the product has stock quantity 1, there is 1 size L left but there are still 12 sizes XL left, so the costumer wont be able to buy XL if stock became zero for the product not considering the quantity per size, but if size L became zero and the stock quantity would be still 1 than the customer can order the size L while i don't have it anymore..

 

(My english is not superb I apologize)

 

So i found some contributions who seem to fix this problem, but what i dont know when i'm going to install them, if they will work flawlessly with this contrib.

 

Has anyone already tried to use those contribs together? Maybe you have an advice for me wich contrib on quantity to use best?

 

Thanks in advance!

 

Inge

Link to comment
Share on other sites

i was looking around for an answer to this but couldn't find anything. i installed attribute sets and all seems to be working fine EXCEPT when i go to apply a set to a product. if i click on the 'AS' button on the 'Categories / Products' page, i can choose which set i want but when i hit the save button i get this error message:

 

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 ''+',1)' at line 1

 

insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix, sort_order) values (32,2,1,,'+',1)

 

[TEP STOP]

 

 

i also get that error when i click on the 'add AS' button on the product edit page, choose the set and hit the save button.

 

i'm using osCommerce 2.2 MS2 and register_globals is set to "on" and i didn't click on the "Remove Set Element" check box. i can create sets but can't apply them to products.

Link to comment
Share on other sites

i was looking around for an answer to this but couldn't find anything. i installed attribute sets and all seems to be working fine EXCEPT when i go to apply a set to a product. if i click on the 'AS' button on the 'Categories / Products' page, i can choose which set i want but when i hit the save button i get this error message:

 

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 ''+',1)' at line 1

 

insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix, sort_order) values (32,2,1,,'+',1)

 

[TEP STOP]

i also get that error when i click on the 'add AS' button on the product edit page, choose the set and hit the save button.

 

i'm using osCommerce 2.2 MS2 and register_globals is set to "on" and i didn't click on the "Remove Set Element" check box. i can create sets but can't apply them to products.

 

i found a fix to my problem in this post:

http://www.oscommerce.com/forums/index.php?sho...ndpost&p=426160

 

i deleted all the previous attributes and then added them in again and all is good :)

Link to comment
Share on other sites

Hi, i get this error when updatng a attribute set

 

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 'id =35' at line 4

 

select products_attributes_sets_id from products_attributes_sets_to_products where products_ id =35

 

[TEP STOP]

[code]

 

 

any ideas how to solve this?

 

Thanks

Criag

Link to comment
Share on other sites

Ok, I got the database.php error figured out, but I still have a problem.

 

When a customer places an order and chooses the attribute, the attribute is not transfered to the database like everything else and they see this on the checkout confirmation (and the same shows on the order side on the admin):

 

1 Dress

  -:

 

The table orders_products_attributes is empty in the following fields:

 

products_options

products_options_values

 

for all products purchased since I installed this contribution.

 

All the other tables look ok, I rechecked them quite a bit.

 

When placing an order, the customer can see the attributes all the way through checkout until the checkout confirmation page, so there is probably something just not going through when they click the "continue" button after all the data is entered. Everything else goes through, though except for the attributes.

 

Someone PLEASE help. This is a live shop and I've had to ask customers via email what the attributes they chose were. I need to figure this out but I can't put my finger on it! :'(

 

Still waiting for any ideas on how to fix this. PLEASE!!

Link to comment
Share on other sites

Hi, i get this error when updatng a attribute set

 

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 'id =35' at line 4

 

select products_attributes_sets_id from products_attributes_sets_to_products where products_ id =35

 

[TEP STOP]

[code]

 

 

any ideas how to solve this?

 

Thanks

Criag

 

 

just a little more info.

 

i only get this error when i view an existing set and edit it.

 

so if i change the Option Value, Price Prefix, Option Value Price, Sort Order, Remove Set Element or Name For This Set and click the Save button, i get the error.

 

I does update but I don?t feel comfortable with and error on the site.

 

any help wouldbe great.

 

thanks

Craig

Edited by pixelhub
Link to comment
Share on other sites

i also added the "AS Edit Bug Fix" by linuxdave so i removed the bug fix and the error went away.

 

So now i dont know what to do as i need the bug fix tso i dont delete the other attributs when editing sets.

 

here is the code of the fix in catalog/admin/products_attributes_sets.php that replaces

 

jjg_db_attributeSets( $arr_ProductsAttributeSetsIDs, $products_ids['products_id'], "update_product" );

 

with this

 

  $arr_NewProductsAttributeSetsIDs = array();
$products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS." 

where products_
id =".$products_ids['products_id'];
$products_attributes_sets_query = tep_db_query($products_attributes_sets_query_sql);
$newcount = 0;
while($fixed_products_attributes = tep_db_fetch_array($products_attributes_sets_query)) {
$arr_NewProductsAttributeSetsIDs[$newcount] = $fixed_products_attributes['products_attributes_sets_id'];
$newcount++;
}
jjg_db_attributeSets( $arr_NewProductsAttributeSetsIDs, $products_ids['products_id'], "update_product" );

 

can any one solve this?

 

cheers

Craig

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