Jump to content
Sign in to follow this  
joeyjgarcia

Attribute Sets Contribution

Recommended Posts

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

 

 

Sorry... there was an extra line break in there messing things up...

this line:

$products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS." 

where products_
id =".$products_ids['products_id'];

 

should actually be this:

$products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS." where products_id =".$products_ids['products_id'];

 

See the problem? with the space in products_id?

 

Hope this helps.


LinuxDave

Share this post


Link to post
Share on other sites
Sorry... there was an extra line break in there messing things up...

this line:

$products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS." 

where products_
id =".$products_ids['products_id'];

 

should actually be this:

$products_attributes_sets_query_sql = "select products_attributes_sets_id from ".TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS." where products_id =".$products_ids['products_id'];

 

See the problem? with the space in products_id?

 

Hope this helps.

 

 

 

:D Thanks, that worked a treat. :thumbsup:

Share this post


Link to post
Share on other sites

Great contribution - installed OK and seemed to work perfectly but I just noticed one issue:

 

If I add a product to the shopping card with attributes set and then, in the cart, click on the product name that links back to the product page I get the following error:

 

1064 - You have an error in your SQL syntax near '{1}1{3}17{4}14 ORDER BY products_extra_fields_order' at line 6

 

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM products_extra_fields pef LEFT JOIN products_to_products_extra_fields ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=1755{1}1{3}17{4}14 ORDER BY products_extra_fields_order

 

The URL of the link is: http://mytestsite.com/product_info.php?pro...5{1}1{3}17{4}14

 

I think the numbers in brackets refer to the sort order of the attribute so I'm assuming it's trying to automatically re-select all the attributes in the product page.

 

Anyone know how to fix??

 

Cheers

Share this post


Link to post
Share on other sites

how can you sort the Attribute Sets at the moment onmy site it displays the atributes in alphabetical order depending on the option name.

 

Colour:

Size:

Type:

 

I want it to display

 

Colour:

Size:

Type:

 

How is this done?

 

Thanks

Craig

Share this post


Link to post
Share on other sites
how can you sort the Attribute Sets at the moment onmy site it displays the atributes in alphabetical order depending on the option name.

 

Colour:

Size:

Type:

 

I want it to display

 

Colour:

Size:

Type:

 

How is this done?

 

Thanks

Craig

 

 

:-"

 

I mean, I want it to display

 

Size:

Colour:

Type:

Share this post


Link to post
Share on other sites

I have tried Attributes Sort but i can not get it to work with attributes sets.

 

Can any one help

 

Cheers

Craig

Edited by pixelhub

Share this post


Link to post
Share on other sites
can you explain what you have done to try to get it to work?  (detail please)

 

i installed "Product Attrib Sort v1.2"

 

--/catalog/product_info.php--
FIND:
       $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 . "'");

REPLACE WITH:
       $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 . "' order by pa.attribute_sort");
       

 

but attributes sets uses order by pa.sort_order i tried adding it

order by pa.attribute_sort, order by pa.sort_order");

but i that does not work.

 

Thanks

Craig

Share this post


Link to post
Share on other sites

thanks for the reply Sean, i will give that a go.

 

i have been ameing my option names with numbers in front of them like:

 

1. Size

2. Colour

3. Type

 

which is easy, but your solution looks better :)

 

Is it possible to have the options going horizontally for example:

 

 

Size: ________ Colour: ________ Type: ________

 

 

Thanks

Craig

Share this post


Link to post
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

 

 

 

 

anyone??????

Share this post


Link to post
Share on other sites

Does anyone have a plain categories.php file with the modifications already added to it? I have tried a few times to modify the file and when I try to load the page it shows nothing after the Product Manufacturer drop-down box.

Share this post


Link to post
Share on other sites

Hi kahombur

 

You are not alone with your problem, I've been over my install and I have made no errors that I can see.

 

It seems that the AS code we inserted after the manufacturers box ONLY appears when you re-edit you product after you have added it.

 

To me this is a waste of time having to the following:-

 

Enter the product, preview it then insert it and then have to re-edit the product to add the attribute set :angry:

 

Has anyone got a fix for this bug?

 

regards

Andy


Literally, Laterally Thinking! If you cannot get through it, go round it.

Share this post


Link to post
Share on other sites
Hi kahombur

 

You are not alone with your problem, I've been over my install and I have made no errors that I can see.

 

It seems that the AS code we inserted after the manufacturers box ONLY appears when you re-edit you product after you have added it.

 

To me this is a waste of time having to the following:-

 

Enter the product, preview it then insert it and then have to re-edit the product to add the attribute set  :angry:

 

Has anyone got a fix for this bug?

 

regards

Andy

 

 

My apologies to Joey, after re-reading the docs, the inability to add an attribute set while adding a new products is not an error, but there by design.

 

But this is a hinderance as I have already created the attribute sets needed for our store.

 

I chose joey's contribution for our store because in the version I downloaded you were able to add attributes sets while adding a new product :thumbsup: .

 

Do not get me wrong it's a great contribution because it handles the attributs the way I prefer but now has had the main reason for us using it removed :( .

 

Any chance of it being put back in?

 

Andy


Literally, Laterally Thinking! If you cannot get through it, go round it.

Share this post


Link to post
Share on other sites

Hi,

 

I have the Attribute Sets installed and working correctly. Works great actually.

 

The only item that I see in a couple of posts here that has never been addressed is weight.

 

Currently, we have to add an attribute set, add products (and then define which Set to use, which is fine), and then go back into the default Products and set extra weight on every attribute for every product (using the Add Weight to Product Attributes contrib Found HERE). That is where the biggest time-killer is. Having to go back to every product for all options just to add the weight.

 

I've tried to play around with integrating the field that the product_options_weight is in the product-options table... I can pull that out just fine with the product query but run into trouble when trying to write the sql update function since it has to update the products-options-sets table, plus update the products_options_weight in the product-options table. I know I have been close to getting it a couple of times, but there always remains another error.... I'm just not that great with PHP (amonst others ;) )

 

Even if it won't work with the add weight contrib, any plans to integrate adding weight as a factor?

 

Have a nice day

Share this post


Link to post
Share on other sites

WHEW....just finished reading all 29 pages!!

 

First of all, Joey...THANK YOU!! This is an amazing contribution not only because of what it does but because of the tireless support you kindly offer (even to those not using the search function).

 

I installed your version 5.5 (not cip) and added the AS edit fix. I have had NO problems with it. BUT I wanted to share that I also added the ITNEtwork Designs fix.

 

You are told to add the following to ;admin/includes/language/english.php

 

// text for product_attributes_sets.php
define('IMAGE_CREATE_ATTRIBUTE_SET', 'Create Set');
define('HEADING_TITLE', 'Attribute Sets');
define('TEXT_SELECT_OPTION', 'Select Atributes');
define('TEXT_CHOOSE_OPTION', 'Choose an Option');
define('TEXT_CHOOSE_SET_SIZE', 'Set Size');

 

 

 

and it changes all page headings in the catalog section of admin panel to "attribute sets". I suppose you could take out the HEADING_TITLE. But I just took the whole thing out..didn't see a reason for it or for bothering to play with the file. I am NOT a coder but can wing my way around.

 

Thanks again!!! And not sure if this is appropriate but you should definately add a "donate" button to your site for all of the very grateful! I wish I could donate to all but the contribs with the choice support get my spare change!!

 

Lauren

Share this post


Link to post
Share on other sites

Hello, I have a small but importand issue with the A.S. contrib. Some of the Attributes are sorted and displayed correctly and some are not. In this example both of these products are using the same A.S. One is displayed in the correct order, the other is not. Does anybody have any solutions for this problem. Thanks a lot.

 

Here is the Attribute Set

a.gif

 

Here is a properly sorted item using the Attribute Set

b.gif

 

Here is a incorrectly sorted item using the SAME Attribute Set

c.gif

Share this post


Link to post
Share on other sites
Here is the link to the screenshots.

 

http://www.goodnewsclothing.com/screenshots.htm

 

Joey

 

Hi Joey, I've just had the laterst attribute set contribution installed, I went it to create attribute sets that I needed, now, where do I go to match it up with a product? I went to Product Attributs which is above Attribute sets but the sets are nowhere to be found. Is there a code or something that needs to be implemented for this?

Thanks in advance,

Lana

Share this post


Link to post
Share on other sites

I suggest that you download "Attribute Sets version 5.5" and install it. Then once you have that finished, download and apply the "AS Edit Bug Fix" dated 8 Aug 2005. I wouldn't install the "Small mod to attribute sets" because it messed up the ordering for me and it fixes something I don't want it to fix any way :)

Share this post


Link to post
Share on other sites

Is anyone else having problems deleting products after installing this contrib?

 

I know atleast one other person is having this issue:

http://forums.oscommerce.com/index.php?showtopic=164587

 

I can't delete any products, even those that don't have attribute sets assigned to them.

 

When it says "Are you sure you want to permanently delete this product?" I click delete and it just takes me back to the category and the item is still there, and the URL contains "action=delete_product_confirm".

 

Any solution?

Share this post


Link to post
Share on other sites

hey i have a huge error message that displays.....

 

function jjg_db_attributeSets($arr_attributeSetID, $productID, $action, $arr_remove_sets = array(), $link = 'db_link'){ //remove all references to this product_id in these tables, and reinsert new ones if( $action == 'update_product' || 'delete_product_confirm' ){ $delete_query = "delete from products_attributes_sets_to_products where products_id=".$productID; tep_db_query($delete_query, $link); } //if you remove the product, then our work is done if( $action == 'delete_product_confirm' ){ return; } for($j=0; $j
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/chronix/public_html/shop/admin/includes/functions/database.php:153) in /home/chronix/public_html/shop/admin/includes/functions/sessions.php on line 67

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/chronix/public_html/shop/admin/includes/functions/database.php:153) in /home/chronix/public_html/shop/admin/includes/functions/sessions.php on line 67

 

 

Then if you click to go into any of the admin sections you get this error in the section as well as the error above;

 

Parse error: parse error, unexpected '<' in /home/chronix/public_html/shop/admin/includes/boxes/catalog.php on line 28

 

How do i fix this problem?

Share this post


Link to post
Share on other sites

Sounds like a possible error in database.php, re-check the instructions and make sure you made the correct additions.

 

I'm also having the same sorting problem that saubz described. In additon to the delete prodocts issue, this is kind of frustrating. Any support available?

Share this post


Link to post
Share on other sites

I'm happy to report that the delete issue is no longer an issue for me :) I wne tto my backup files and re-installed the contrib and everything is fine now. I'm gussing I made a mistake in categories.php somewhere. So if anyone else runs into this, just try re-installing, which means you'll have to backup your files first (like you always should).

 

Now, if we can just get this sort problem fixed....

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  

×