Jump to content
Sign in to follow this  
toasty

Attribute Sets Plus

Recommended Posts

Attribute Sets Plus for osCommerce 2.2 MS2

=================================

 

Purpose of this Contribution

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

This contribution builds on the original Attributesets contribution. It provides the ability to add a set of predefined 'attributes' (herafter known as an Attribute Set) to a product.

Attributes Sets Plus irons out the creases and any remaining bugs of the excellent original contribution for a smoother operation.

 

CHANGES

-----------

Attributes Sets Plus includes the following improvements:

 

- This contribution is now register_globals OFF ready

- Ability to add multiple attribute sets to a single product at a time.

- The engine now uses database structures instead of arrays.

- A number of bugs were ironed out

- The processes alterred to allow for legacy products AND legacy attributes to co-exist with new attributes sets

- The deletes now make mor logical sense and work correctly

- No core osC tables are alterred - custom tables are used instead

- Less chance of conflict with other contributions (so I am told)

- The install is clear and well commented to help spot editting errors

 

See the install file for more information.

 

[Note: As far as I can see this contribution includes at least everything up to attribute sets 5.5, although the it is not the same code.]

________________________________________

(Contribution thread will be shown in next post)

Share this post


Link to post
Share on other sites

Hey Chris, I just gave the new Attribute Sets Plus a try on two stores and wanted to thank you for an excellent contribution! VERY straightforward install and no errors. The two sites already had a bunch of contributions, but this code didn't bump into anything, which is a great relief.

 

I have Register Globals Off, so for me, this is much easier to install than the original version (which I have on two other sites) and I had no issues at all.

 

Many thanks to you and to Joey for the original contribution! It makes my life much easier! :thumbsup:

 

Janet

Share this post


Link to post
Share on other sites

Yeah! Great contribution. But i cant get the hang of what you mean in the install procedure at step 6. to 6.1 an 6.2, wich are as followes:

Step 6. This code retrieves the attributes and orders them according to the required sort order.
	It also orders attributes by the table 'id' number (the order in which they are created)
			if the attributes are not part of a set. If you do not like this default orderring then
			remove the following line from the new code:
			ORDER BY pase.sort_order, pa.options_values_id");
			and replace with:
			ORDER BY pase.sort_order");

	**HINT**: In a fresh copy of osCommerce's /catalog/product_info.php page, look at line 134 for this
	query.

******** 6.1a: Change this query:


$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");	


******** 6.1b: To this query by adding an "order by" clause to the end of the statement.
Note: (this is not tested outside my own install. I think this will work but if it doesn't let me know and I'll work out what I've missed!)
			// BOF Linkmatics attributes sets plus								  
	  $products_options_query = tep_db_query("
	  SELECT pov.products_options_values_id, pov.products_options_values_name, 
		   pa.options_values_price, pa.price_prefix , pase.sort_order
		  FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . 
				TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS . " pas2pa, " . 
				TABLE_PRODUCTS_ATTRIBUTES_SETS . " pas, " .
				TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase, " .
				TABLE_PRODUCTS_OPTIONS_VALUES . " pov
				WHERE	  pa.products_id = '" . (int)$_GET['products_id'] . "'		   
			AND pa.options_id = '" . $products_options_name['products_options_id'] . "'
			AND pas2pa.products_id = pa.products_id
			AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id
			AND pas.products_options_id = pa.options_id
			AND pase.products_attributes_sets_id = pas.products_attributes_sets_id
			AND pase.options_values_id = pa.options_values_id
			AND pov.products_options_values_id = pa.options_values_id
			AND pov.language_id = '" . $languages_id . "'
			ORDER BY pase.sort_order, pa.options_values_id");	   
	  // EOF Linkmatics attributes sets plus

 

What iam i supposed to replace, and visa versa.. Hope that you get my problem.

It would be great if you could be a little more spesific. Thanks, and again: GREAT CONTR.! :thumbsup:

 

Best Regards!

Share this post


Link to post
Share on other sites
Attribute Sets Plus for osCommerce 2.2 MS2

=================================

 

Purpose of this Contribution

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

This contribution builds on the original Attributesets contribution. It provides the ability to add a set of predefined 'attributes' (herafter known as an Attribute Set) to a product.

Attributes Sets Plus irons out the creases and any remaining bugs of the excellent original contribution for a smoother operation.

 

CHANGES

-----------

Attributes Sets Plus includes the following improvements:

 

- This contribution is now register_globals OFF ready

- Ability to add multiple attribute sets to a single product at a time.

- The engine now uses database structures instead of arrays.

- A number of bugs were ironed out

- The processes alterred to allow for legacy products AND legacy attributes to co-exist with new attributes sets

- The deletes now make mor logical sense and work correctly

- No core osC tables are alterred - custom tables are used instead

- Less chance of conflict with other contributions (so I am told)

- The install is clear and well commented to help spot editting errors

 

See the install file for more information.

 

[Note: As far as I can see this contribution includes at least everything up to attribute sets 5.5, although the it is not the same code.]

________________________________________

(Contribution thread will be shown in next post)

 

First, thanks for the great contribution. I love the development process and really appreciate your efforts!!! I do have one question I hope you can help with. The Attribute Sets contribution had many problems with multiple attirbutes when pricing was involved. i.e. with a diamond ring. Set 1: Gold: white/yellow Set 2 Carrats: 1, $10 2, $20 etc. It would total wrong when added to the shopping cart if there were 2 or more attributes and one of them had pricing. Do you know if this is an issue with Attribute Sets Plus???

Kindest regards,

Kenyastar :)

Share this post


Link to post
Share on other sites
..................

What iam i supposed to replace, and visa versa.. Hope that you get my problem.

It would be great if you could be a little more spesific. Thanks, and again: GREAT CONTR.! :thumbsup:

 

Best Regards!

 

thankyou for pointing this out - it is a little hazy.

I have changed the text for the next upload.

Just change the original code (6.1a) for the new code (6.1b)

 

Simple as that!

 

Chris.

Share this post


Link to post
Share on other sites
First, thanks for the great contribution. I love the development process and really appreciate your efforts!!! I do have one question I hope you can help with. The Attribute Sets contribution had many problems with multiple attirbutes when pricing was involved. i.e. with a diamond ring. Set 1: Gold: white/yellow Set 2 Carrats: 1, $10 2, $20 etc. It would total wrong when added to the shopping cart if there were 2 or more attributes and one of them had pricing. Do you know if this is an issue with Attribute Sets Plus???

Kindest regards,

Kenyastar :)

 

I have not experienced any issue (nor any reported) with pricing, nor should there be.

Having 'multiple attributes' is a core feature of osC and is not added by this contribution.

Once the set of attributes is added to the product, (using the contribution), the pricing uses the standard osC tables and the standard attributes functionality (and is therefor not using the contribution code).

 

The approach of this contribution is to 'add' functionality, not to 'change' existing functionality.

 

regards

Chris.

Share this post


Link to post
Share on other sites

In the original Attribute SEt Contribution it effects the order total when you add the product to the shopping cart which than messes up the total at checkout... but ONLY IF there were TWO or more attirubutes and one had PRICING for each option in the drop down list. though it worked fine with one attribute that had pricing. And it boy did it effect the order total! I spent 3 days on the phone with an OSC developer trying to fix it. And in the thread on that contribution there are many examples of others with similar issues. The problem was inherent to how that contribution had been developed. The way you developed it looks like it should not be a problem at all. But before installing, I thought I'd pose the question :). As more folks find out about your awesome contribution, you will defintiley be posed with this question again. If any site can break it, it's mine, so I'll let you know ;). I'll install it this weekend on my DEV site and test test test on our stud earrings.

Thanks again!

Kenya

 

I have not experienced any issue (nor any reported) with pricing, nor should there be.

Having 'multiple attributes' is a core feature of osC and is not added by this contribution.

Once the set of attributes is added to the product, (using the contribution), the pricing uses the standard osC tables and the standard attributes functionality (and is therefor not using the contribution code).

 

The approach of this contribution is to 'add' functionality, not to 'change' existing functionality.

 

regards

Chris.

Share this post


Link to post
Share on other sites
In the original Attribute SEt Contribution it effects the order total when you add the product to the shopping cart which than messes up the total at checkout... but ONLY IF there were TWO or more attirubutes and one had PRICING for each option in the drop down list. though it worked fine with one attribute that had pricing. And it boy did it effect the order total! I spent 3 days on the phone with an OSC developer trying to fix it. And in the thread on that contribution there are many examples of others with similar issues. The problem was inherent to how that contribution had been developed. The way you developed it looks like it should not be a problem at all. But before installing, I thought I'd pose the question :). As more folks find out about your awesome contribution, you will defintiley be posed with this question again. If any site can break it, it's mine, so I'll let you know ;). I'll install it this weekend on my DEV site and test test test on our stud earrings.

Thanks again!

Kenya

 

In fact I think I do remember having that problem now I think about it (with the old contrib) - but it is not a problem now: so go give it hell (!) and do let me know of any issues at all.

 

regards

Chris

Share this post


Link to post
Share on other sites

Sorry to take a place here!

A short question: Is there any functions overlayed between the Attributes Set Plus and the AttributesWizzard v0.12? It seems a lot of work to do in order to make it work. I still got an unsovled problem in my admin/categories.php file so i just wanna ensure it. Thanks for the great idea!

Share this post


Link to post
Share on other sites
Sorry to take a place here!

A short question: Is there any functions overlayed between the Attributes Set Plus and the AttributesWizzard v0.12? It seems a lot of work to do in order to make it work. I still got an unsovled problem in my admin/categories.php file so i just wanna ensure it. Thanks for the great idea!

 

I am not familar with Attributes Wizard. All I can tell you is that Atrributes Sets Plus works.

If there is more functionality that is required then please feel free to let me know and I'll add it to the wish list.

 

 

regards

 

Chris.

Share this post


Link to post
Share on other sites

Attribute Sets Plus v1.0 uploaded today.

 

Changes:

 

- Minor updates to the install file for clarity.

- This is the full package.

- No code changes have been made for this upload

 

regards

 

Chris.

Share this post


Link to post
Share on other sites

Is there anyone that can put out a link to some page that use this system, so i can see how it looks like. For the

buyer and admin?

 

Bj?rn

Share this post


Link to post
Share on other sites

Hi!

 

I got a problem with the contribution. If I assign an attribute set to a product, I get an error message in the shop (product_info.php):

 

1146 - Table 'sql11890.TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS' doesn't exist

SELECT pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix , pase.sort_order FROM products_attributes pa, TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS pas2pa, TABLE_PRODUCTS_ATTRIBUTES_SETS pas, TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS pase, products_options_values pov WHERE pa.products_id = '103' AND pa.options_id = '1' AND pas2pa.products_id = pa.products_id AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id AND pas.products_options_id = pa.options_id AND pase.products_attributes_sets_id = pas.products_attributes_sets_id AND pase.options_values_id = pa.options_values_id AND pov.products_options_values_id = pa.options_values_id AND pov.language_id = '2' ORDER BY pase.sort_order, pa.options_values_id

[TEP STOP]

 

But I executed the sql-file. The table do exist. I don't know what to do. Please help me.

Share this post


Link to post
Share on other sites
Hi!

 

I got a problem with the contribution. If I assign an attribute set to a product, I get an error message in the shop (product_info.php):

 

1146 - Table 'sql11890.TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS' doesn't exist

SELECT pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix , pase.sort_order FROM products_attributes pa, TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS pas2pa, TABLE_PRODUCTS_ATTRIBUTES_SETS pas, TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS pase, products_options_values pov WHERE pa.products_id = '103' AND pa.options_id = '1' AND pas2pa.products_id = pa.products_id AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id AND pas.products_options_id = pa.options_id AND pase.products_attributes_sets_id = pas.products_attributes_sets_id AND pase.options_values_id = pa.options_values_id AND pov.products_options_values_id = pa.options_values_id AND pov.language_id = '2' ORDER BY pase.sort_order, pa.options_values_id

[TEP STOP]

 

But I executed the sql-file. The table do exist. I don't know what to do. Please help me.

 

 

I made the same mistake initially. Check step 5 and make sure you've made the edits to the database_tables.php as below:

 

Step 5.2 Add database table names to /catalog/includes/database_tables.php.

 

Add the following lines to this file: /catalog/includes/database_tables.php

 

// BOF Linkmatics attributes sets

define('TABLE_PRODUCTS_ATTRIBUTES_SETS', 'products_attributes_sets');

define('TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS','products_attributes_sets_elements');

define('TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS', 'products_attributes_sets_to_products');

// EOF Linkmatics attributes sets

Share this post


Link to post
Share on other sites

Thanks for that hint. I made the step, but put the file in the wrong directory.

 

Maybe you could help me with this problem: - screenshot -

I have it everytime the option has a price.

Share this post


Link to post
Share on other sites

Just wanted to thank you for the awesome contrib! The install took less than 30 min thanks to your great documentation, its now working flawlessly and I can see its going to save me many tedius hours of adding attributes!

Share this post


Link to post
Share on other sites
Just wanted to thank you for the awesome contrib! The install took less than 30 min thanks to your great documentation, its now working flawlessly and I can see its going to save me many tedius hours of adding attributes!

 

Thankyou Latitudes. It is great to have positive feedback for those that are unsure.

 

...and thanks Janet for responding to 3H's missing table definition issue. Following Janet having this issue I did update the documentation to ensure it is very clear that both steps must be done. That is now incorporated in the latest upload (still version 1.00 as no code updates were required).

 

regards to all

 

Chris.

Share this post


Link to post
Share on other sites

Further Development Ideas

_______________________

 

Hi all,

 

Its a bit soon to expect too much feedback I guess but anyone that gets to read this please do be thinking about further development of this contribution.

 

I have a couple of ideas for the next version such as:

 

1. Integration with EasyPopulate

This approach is great if you manage your shop externally like I do. If I make any stock changes in the stock control system they are loaded up automatically using (slightly modified) EP. Takes a few seconds for thousands of rows and all sets are added to the products automatically. Sound interesting?

(see my thoughts here: http://forums.oscommerce.com/index.php?s=&...dpost&p=723996)

 

2. Integrating with the Options Types contribution.

This is how I use it. This means I can create sets of attributes of any type (e.g. select lists, radio buttons, fixed length text input fields, free text input fields). The integration of the two was a bit tricky and I had to remove a couple of bugs too but its easy to use now it works. If the types or attributes sets are not needed then they don't have to be used- its just extra if required.

I think this is stuff that folk would normally expect as standard in a cart. Can anyone see any downside of providing this as a fully combined version of the two? Would anyone love to have it?

 

regards to all

 

Chris.

Share this post


Link to post
Share on other sites
Further Development Ideas

_______________________

 

Hi all,

 

Its a bit soon to expect too much feedback I guess but anyone that gets to read this please do be thinking about further development of this contribution.

 

I have a couple of ideas for the next version such as:

 

1. Integration with EasyPopulate

This approach is great if you manage your shop externally like I do. If I make any stock changes in the stock control system they are loaded up automatically using (slightly modified) EP. Takes a few seconds for thousands of rows and all sets are added to the products automatically. Sound interesting?

(see my thoughts here: http://forums.oscommerce.com/index.php?s=&...dpost&p=723996)

 

2. Integrating with the Options Types contribution.

This is how I use it. This means I can create sets of attributes of any type (e.g. select lists, radio buttons, fixed length text input fields, free text input fields). The integration of the two was a bit tricky and I had to remove a couple of bugs too but its easy to use now it works. If the types or attributes sets are not needed then they don't have to be used- its just extra if required.

I think this is stuff that folk would normally expect as standard in a cart. Can anyone see any downside of providing this as a fully combined version of the two? Would anyone love to have it?

 

regards to all

 

Chris.

 

 

Chris, I would be doing the happy dance if it worked with Easy Populate! Also another feature I'd love to see is the ability to add more attributes to an existing set. We currently can remove attributes, but my client often gets new color options in, which means I need to recreate the whole set to add them in. Is this a possibility?

 

One other thought would be a documented way to upgrade from the original contribution to the Plus version to be able to take advantage of the new functionality.

 

And again, thanks for simplifying the install of such a great contribution!

Janet

Share this post


Link to post
Share on other sites
Chris, I would be doing the happy dance if it worked with Easy Populate! Also another feature I'd love to see is the ability to add more attributes to an existing set. We currently can remove attributes, but my client often gets new color options in, which means I need to recreate the whole set to add them in. Is this a possibility?

 

One other thought would be a documented way to upgrade from the original contribution to the Plus version to be able to take advantage of the new functionality.

 

And again, thanks for simplifying the install of such a great contribution!

Janet

 

Hi Janet - how's things?

I am looking for ideas on how to integrate with EP in a generic way so that everyone get's what they want. One of the questions is where the control over new sets should be. Should it remain in admin/database, or should EP be able to 'create' new sets?...i.e. should EP just add existing sets to products that have been pre-created using admin - I am leaning to the latter. Any chance you could read my other post (in the EP thread, link in my last post) and then explain how YOU would like it to work?

 

Regarding an upgrade path I decided against this for two reasons:

1. The new code is too different and I did not document all the additions/bug repairs/removals.

2. I think it is easier to back out the old code (i.e. follow the old install intructions in reverse) and start again with the new install than it would be to pick through changing over. I do however incorporate the script to remove the database changes from the old version as a part of the install process....and of course if there are no other changes to consider one can always revert to a standard osC file and start again.

 

Yes - being able to add new attributes should be a possible enhancement - I'll add it to the wish list.

 

any thoughts welcome.

 

regards

Chris.

Share this post


Link to post
Share on other sites
2. Integrating with the Options Types contribution.

This is how I use it. This means I can create sets of attributes of any type (e.g. select lists, radio buttons, fixed length text input fields, free text input fields). The integration of the two was a bit tricky and I had to remove a couple of bugs too but its easy to use now it works. If the types or attributes sets are not needed then they don't have to be used- its just extra if required.

I think this is stuff that folk would normally expect as standard in a cart. Can anyone see any downside of providing this as a fully combined version of the two? Would anyone love to have it?

 

This is something I would love! Can I expect to see this in the next version?

Share this post


Link to post
Share on other sites

Contribution works great, but I must have done something wrong because I lost my previous attributes. They are still listed in admin, but they don't show up when you look at a product. The name of the attribute set shows, but the selection box is empty. If I add an attribute to a product the normal way it will not show up, but if I add it as an attribute set it will. Any help appreciated.

Share this post


Link to post
Share on other sites

Hi I am in the process of installing this contrib, but I must say that the install instructions are extremely confusing and unfriendly for beginners. I doubt I will be able to successfuly install the contrib. But I will keep you updated.

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  

×