Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute Sets Plus


toasty

Recommended Posts

I am running both together - is there a specific set of code that you are curious about?

 

New issue for me here.

 

Im running Multiple Categories along side of Attribute Sets. I had to move a little code around to get them both to function together. Everything looks ok on the Admin Panel side of things, but when I add a new product, I get garbled descriptions. like this http://www.steelworks-jewelry.com/product_...roducts_id=2397

instead of this http://www.steelworks-jewelry.com/product_...roducts_id=2395

No pictures either. Anyone using both together? Could I steal your code for categories.php (this is the only file that conflicts)

Link to comment
Share on other sites

I got this error in admin after i installed this contribution. Hope you can help:

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/localhost/htdocs/thuve/catalog/admin/includes/functions/database.php:246) in /var/www/localhost/htdocs/thuve/catalog/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/localhost/htdocs/thuve/catalog/admin/includes/functions/database.php:246) in /var/www/localhost/htdocs/thuve/catalog/admin/includes/functions/sessions.php on line 67

Link to comment
Share on other sites

Hello deary

I followed the instructions to the T thinking "great i actually understand what to do for once!" and headed off to my admin panel to get stuck in using it.

Everything that was there previously is grand, but when i go into the new "attribute sets" menu item i get a particularly nasty "internal server error".

In the error log the problem seems to be with the new file "products_attribute_sets", apparently with "premature end of script headers".

Can you think of anything that would cause this error?

 

Thankyou for your help

:)

Link to comment
Share on other sites

Well i managed to get it sorted by simply reuploading a fresh copy of products_attributes_sets.php. Haven't a scooby why it was angry when it was exactly the same file unchanged, but nevertheless it is sorted.

 

Thankyou for making a great contribution, and more importantly for the very detailed installation instructions! this is the first contribution i have managed to install as well :)

 

from a well chuffed website owner

Link to comment
Share on other sites

Well my issue seemed to be an error in CCGV(trad) contribution installation which caused a problem with this contribution - it looks like everything is working great now. Thanks for the great contributions.

Edited by seg
Link to comment
Share on other sites

Oh your just being nice so I reply; but hey, it works! Thanks.

 

Yeah, it works when people post about our software too. Like on our support forum :) Excpet we're not as good at the support thing as you are....

 

We chased it to a certain extent, then decided EP was a better way to go for the client for only 3 reasons: we didn't see any chance for confict with EP, it promised greater abilty for the client and the client is poor and cannot fund this level of debugging. Sorry about that people and Chris who stands by his contrib. Anyone looking to resolve a similar anomaly can PM me and I'll review the contribs which we believe may be confilcting. Sorry we couldn't help more but there's always next time :)

 

And Chris, thanks now that you know I'm not asking you for anything. Way to go bro. Open Source!

Link to comment
Share on other sites

Yeah, it works when people post about our software too. Like on our support forum :) Excpet we're not as good at the support thing as you are....

 

We chased it to a certain extent, then decided EP was a better way to go for the client for only 3 reasons: we didn't see any chance for confict with EP, it promised greater abilty for the client and the client is poor and cannot fund this level of debugging. Sorry about that people and Chris who stands by his contrib. Anyone looking to resolve a similar anomaly can PM me and I'll review the contribs which we believe may be confilcting. Sorry we couldn't help more but there's always next time :)

 

And Chris, thanks now that you know I'm not asking you for anything. Way to go bro. Open Source!

 

Hi Tevor

 

EP (Easy Populate for those that don't know) is a great (and powerful) contrib. I use it integrated with Attributes Sets Plus for loading a full catalog all in one go on a regular basis; I did have to update it for use with Register_Globals OFF when I installed it (if I remember correctly) (and before anyone asks the code is very custom for my site so I can't share it).

 

Where I don't agree is where you said the reason to use EP over ASP is debugging.

There is no debugging with ASP. Apart from a couple of known items that can be worked around it works....and the simplicity of the design means it does not change the core database at all; thus no conflicts. 99% of issues are installation error (just read this thread to confirm).

 

Your error was either a conflict with SPCC or an editting error and if you are doing this for clients you should have been able to solve it easily enough either way.

 

It takes longer to install EP and have it running with a system (i.e. provide a user spreadsheet for editting by the client with suitable backup/load procedures to avoid losing the entire online database) that suits the shop and it provides a totally different set of features and capability, although it does enable loading of some attributes too.

 

I would suggest you chose EP because it offers the 'overall' features that your client requires; please don't suggest it is to do with 'bugs' or conflict issues in ASP - that does not make sense.

 

regards

Chris.

Link to comment
Share on other sites

Thanks for the contribution,

 

Does this contribution support uploading multiple products attribute sets

 

or do you still have to add an attribute set by editing each product by going through the admin side of osc?

 

Thanks!

 

Jon

Link to comment
Share on other sites

Thanks for the contribution,

 

Does this contribution support uploading multiple products attribute sets

 

or do you still have to add an attribute set by editing each product by going through the admin side of osc?

 

Thanks!

 

Jon

Hi Jon

It allows you to create any number of 'sets' of attributes eg size set = small, medium, large

You can then add 1 (or more) sets to any product by editting the product and ticking a box for the sets you wish to attach to that product.

 

If your requirement is different please explain what it is that you need.

regards

Chris.

Link to comment
Share on other sites

Hi Jon

It allows you to create any number of 'sets' of attributes eg size set = small, medium, large

You can then add 1 (or more) sets to any product by editting the product and ticking a box for the sets you wish to attach to that product.

 

If your requirement is different please explain what it is that you need.

regards

Chris.

 

 

Chris,

 

Thank you for a very thoughtful response. Yes my needs are slightly different however they still retain the integrity of your contribution.

 

I have a couple thousand products that I have already added to my database and need to add 1 product attribute set to each one simply by uploading them via phpmyadmin. However when I attempt to do that I have to edit product_attributes table and add the 6 variables for each product instead of adding just the one product attribute set per product number.

 

Anyway to do this? Would save a great deal of time.

 

Thanks so much

 

Jon

Link to comment
Share on other sites

OK - DUE TO POPULAR DEMAND....:Here is a 'quick and dirty' way to:

ADD SETS TO THE ENTIRE PRODUCT DATABASE in one hit.

If you decide to use this consider yourself a test case and back up beforehand.

DO NOT USE THIS ON A LIVE DATABASE!

 

This will not remove existing sets, but will add sets to ALL products in the database.

Only use this if you wish to have the same sets added to ALL products.

No warranties or guarantees at all (but it seemed to work when I gave it a quick go just now!)

Do let us know if you have any success with it so that others may feel better about using it.

 

Install Instructions:

In file catalog/admin/products_attributes_sets_edit.php

find the following code:

  if( $action == 'save' ){
$arr_attributeSetIDs = array();
for($i=0; $i<$_POST['asRowCount']; $i++){
	if( isset($_POST['attSetId_'.$i]) ){
		$arr_attributeSetIDs[] = $_POST['attSetId_'.$i];
	}
}
jjg_db_attributeSets($arr_attributeSetIDs, $_GET['products_id'], "update_product");

 

Add this code just above it:

 

// ***** Global add of all selected sets *****

 if( $action == 'global-save' ){
$arr_attributeSetIDs = array();
for($i=0; $i<$_POST['asRowCount']; $i++){
	if( isset($_POST['attSetId_'.$i]) ){
		echo "attribute= " . $_POST['attSetId_'.$i];		
		$arr_attributeSetIDs[] = $_POST['attSetId_'.$i];
	}
}

				echo ">>> Performing Global ADD for NEW Selected Sets to ALL PRODUCTS </br>";
			  $arr_productIDs = array();
			$productIDs_query = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . " ");
			while ($arr_productIDs = tep_db_fetch_array($productIDs_query)){
			  echo "PRODUCT ID= " . $arr_productIDs[products_id] . " > ";		
			  reset($arr_attributeSetIDs);  
			  jjg_db_attributeSets($arr_attributeSetIDs, $arr_productIDs[products_id], "update_product");
			}

 }

// End Global add code *****

 

and finally, find this line:

 <?php echo tep_draw_form("asEditForm",FILENAME_PRODUCTS_ATTRIBUTES_SETS_EDIT,'action=save&products_id='.$_GET['pID'].'&cPath='.$_GET['cPath']); ?>

 

and edit the word 'save' to become 'global-save' so that the line now reads:

 

<?php echo tep_draw_form("asEditForm",FILENAME_PRODUCTS_ATTRIBUTES_SETS_EDIT,'action=global-save&products_id='.$_GET['pID'].'&cPath='.$_GET['cPath']); ?>

 

INSTRUCTIONS FOR USE:

 

Assumption: You already have Attributes Sets Plus installed and sets created.

 

Important Notes:

1. This code is for ONE TIME ONLY use. After use the last edit should be undone and the 'global-save' edit changed back to 'save'.

2. This code will enable adding multiple attribute sets to the entire databse of products in one hit.

3. There is no undo or global removal facility at this time - so back up first!

4. Use at your own risk - I just threw this together for those that might be desperate enough to give it a go! - please report on success/failure of using it

 

To Perform a 'Global Attribute Set Add' to all products:

- Navigate to http://example.com/admin and select catalog

- Select any product you like and click the edit button

- A little way down the page (under a list of existing attributes sets if any exist) click the 'Add AS' button

- DEselect all the sets checkboxes listed (this does not delete anything!)

- Now select the sets you wish to have ADDED to ALL PRODUCTS

- Click the Save button

It may take some time to complete if you have a lot of products.

 

Now remove the last edit you made to the file to return functionality to previous state (as in note 1).

If you ever wish to use this again just edit the 'save' to 'global-save' again and proceed as above.

Link to comment
Share on other sites

The logic makes sense and I'm dying to give it a go. However can we make one slight modification, I want to add the attribute set to pieces of my 8500+ item database.

 

Example I want to add the attribute set xyz to products from manufacturer A

I want to add the attribute set abc to products from manufacturer B

I don't want to add any attribute sets to the rest of the products in my database

 

Is this possible? Is it possible to modify the .sql in the attribute sets so that I can just upload straight to sql the products which I want a certain attribute set attached (I dont mind taking the time to have a table which has products id and attribute sets) So when a product ID is queried it will check for the existence of an attached attribute set and display it accordingly. Instead of going through product_attributes and adding 6 instances for each product id. (since one of my product attributes sets has 6 instances or XS, S, M, L, XL, XXL) When I do my sql upload

 

Thanks again for all of your insight,

 

Jon

Link to comment
Share on other sites

The logic makes sense and I'm dying to give it a go. However can we make one slight modification, I want to add the attribute set to pieces of my 8500+ item database.

 

Example I want to add the attribute set xyz to products from manufacturer A

I want to add the attribute set abc to products from manufacturer B

I don't want to add any attribute sets to the rest of the products in my database

 

Is this possible? Is it possible to modify the .sql in the attribute sets so that I can just upload straight to sql the products which I want a certain attribute set attached (I dont mind taking the time to have a table which has products id and attribute sets) So when a product ID is queried it will check for the existence of an attached attribute set and display it accordingly. Instead of going through product_attributes and adding 6 instances for each product id. (since one of my product attributes sets has 6 instances or XS, S, M, L, XL, XXL) When I do my sql upload

 

Thanks again for all of your insight,

 

Jon

 

TO UPDATE SPECIFIC PRODUCT GROUPS:

 

Jon

Regarding your query, you can alter the code I gave you by changing this line:

$productIDs_query = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . " ");

For example to restrict the update to certain manufacturers change it to the line below, but with the manufacturer_id set to the one you want updated (not zero as shown here).

$productIDs_query = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE  manufacturers_id =0");

 

I don't fully undertsand what you mean in your post:, but if you wanted to add a table and do a join this is where to do it so you can achieve your objective.

Another alternative would be to use EasyPopulate and add attributes as the Products are added; but that is another story!

 

Hope that helps

 

Chris.

Link to comment
Share on other sites

Dear All ASP Users - New ASP Release in the offing; your help requested

 

I have just 'hacked' out some new code to integrate the following features to ASP:

1. Adding (AND deleting) Attributes Sets to ALL products in one hit

2. Selecting sub-sets of (1) by manufacturer

3. I will soon add by category also

4. Fixed the bug that did not delete sets using attributes sets edit.

 

The code update is simple:

1. replace admin/attributes_sets_edit.php

2. replace one function in admin/includes/database.php

 

I have briefly tested this on my own system and would like some help with further testing.

If this is of interest please PM me so I can email the files.

 

I would add, this is of no use to me whatsoever but as many have asked for it here it is.

If you have a sizable database it is very powerful and satisfying to use.

 

If interest is shown and help is given I may find time to do one or two other things folk have asked for.

 

Thankyou

 

Chris.

Edited by toasty
Link to comment
Share on other sites

Hi Chris,

 

Thank you for a great contribution and for continuing to update the features and provide support for everyone. I have a small problem similar to some others mentioned but none of the solutions have worked for me. I have reviewed the entire thread and rechecked my install procedures. Not a newbie but not a php pro by any means either. I have an install working with ASP and the Option Type Feature v1.7. Everything functions correctly except when I use the drop down (select) option type. The options are always duplicated for this option type when displayed. Option - value 1, value 2 , value 3 appears as Option - value 1, value 2 , value 3, value 1, value 2 , value 3 (repeated) or Option - value 1, value 2 , value 3, value 3, value 2 , value 1 (mirrored). Any suggestions? Thank you, Rodney

Link to comment
Share on other sites

Hi Chris,

 

Thank you for a great contribution and for continuing to update the features and provide support for everyone. I have a small problem similar to some others mentioned but none of the solutions have worked for me. I have reviewed the entire thread and rechecked my install procedures. Not a newbie but not a php pro by any means either. I have an install working with ASP and the Option Type Feature v1.7. Everything functions correctly except when I use the drop down (select) option type. The options are always duplicated for this option type when displayed. Option - value 1, value 2 , value 3 appears as Option - value 1, value 2 , value 3, value 1, value 2 , value 3 (repeated) or Option - value 1, value 2 , value 3, value 3, value 2 , value 1 (mirrored). Any suggestions? Thank you, Rodney

 

In short - no idea!...but (and you may have read about this) it could be related to an issue with languages. On the assumtpion you use only one laguage, are you sure you have only one entry in the options tables for each attribute? I think of this due to the random nature of the order. The order MAY be related to being orderred by id. Make sure you have removed any other laguage_id rows and ensure osC is set up for one language only.

 

The only other thing I can think of is if you have somehow messed up an sql join in the sql statement for the select type.

 

Hope that helps

 

all the best

 

Chris.

Link to comment
Share on other sites

In short - no idea!...but (and you may have read about this) it could be related to an issue with languages. On the assumtpion you use only one laguage, are you sure you have only one entry in the options tables for each attribute? I think of this due to the random nature of the order. The order MAY be related to being orderred by id. Make sure you have removed any other laguage_id rows and ensure osC is set up for one language only.

 

The only other thing I can think of is if you have somehow messed up an sql join in the sql statement for the select type.

 

Hope that helps

 

all the best

 

Chris.

 

Thank you for replying. I verifed the language issue again. That's not the problem. I am now confident that is has to do with the query on product_info.php. I wasn't sure how to incorporate the changes for both modules and did some guess work (being a php novice). I understand that this may be outside your realm of expertise but I am posting the relevant code in hopes that someone may offer a solution. Thank you in advance for any assistance. Here's the code:

 

<?php

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

$products_attributes = tep_db_fetch_array($products_attributes_query);

if ($products_attributes['total'] > 0) {

?>

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>

</tr>

<?php

//clr 030714 update query to pull option_type

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

//clr 030714 add case statement to check option type

switch ($products_options_name['products_options_type']) {

case PRODUCTS_OPTIONS_TYPE_TEXT:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment'] ;

if ($products_attribs_array['options_values_price'] != '0') {

$tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';

}

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_TEXTAREA:

//CLR 030714 Add logic for text option

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"

wrap="soft"

name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

rows=5

id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"

value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>

<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>

<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //-->

<tr>

<?php

if ($products_attribs_array['options_values_price'] != '0') {

?>

<td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>

<?php } else {

?>

<td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td>

<?php }

?>

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

 

case PRODUCTS_OPTIONS_TYPE_RADIO:

//CLR 030714 Add logic for radio buttons

$tmp_html = '<table>';

$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 = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");

$checked = true;

while ($products_options_array = tep_db_fetch_array($products_options_query)) {

$tmp_html .= '<tr><td class="main">';

$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);

$checked = false;

$tmp_html .= $products_options_array['products_options_values_name'] ;

$tmp_html .=$products_options_name['products_options_comment'] ;

if ($products_options_array['options_values_price'] != '0') {

$tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

$tmp_html .= '</tr></td>';

}

$tmp_html .= '</table>';

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo $tmp_html; ?></td>

</tr>

<?php

break;

case PRODUCTS_OPTIONS_TYPE_CHECKBOX:

//CLR 030714 Add logic for checkboxes

$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);

echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">';

echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);

echo $products_options_name['products_options_comment'] ;

if ($products_attribs_array['options_values_price'] != '0') {

echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

echo '</td></tr>';

break;

default:

//clr 030714 default is select list

//clr 030714 reset selected_attribute variable

$selected_attribute = false;

$products_options_array = array();

$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 . "'");

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

 

// 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");

// >>>>> BOF Linkmatics attributes sets plus patch v1.01

if (tep_db_num_rows($products_options_query)== 0 ) {

$products_options_query = tep_db_query("

SELECT pov.products_options_values_id, pov.products_options_values_name,

pa.options_values_price, pa.price_prefix , pa.options_values_id

FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " .

TABLE_PRODUCTS_OPTIONS_VALUES . " pov

WHERE pa.products_id = '" . (int)$_GET['products_id'] . "'

AND pa.options_id = '" . $products_options_name['products_options_id'] . "'

AND pov.products_options_values_id = pa.options_values_id

AND pov.language_id = '" . $languages_id . "'

ORDER BY pa.options_values_id");

}

// <<<<< EOF Linkmatics attributes sets plus patch v1.01

// EOF Linkmatics attributes sets plus

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

</tr>

<?php

} //clr 030714 end switch

} //clr 030714 end while

?>

</table>

<?php

} //clr 030714 end if

?>

Link to comment
Share on other sites

Thank you for replying. I verifed the language issue again. That's not the problem. I am now confident that is has to do with the query on product_info.php. I wasn't sure how to incorporate the changes for both modules and did some guess work (being a php novice). I understand that this may be outside your realm of expertise but I am posting the relevant code in hopes that someone may offer a solution. Thank you in advance for any assistance. Here's the code:

 

Rod (?)

 

This is not an ASP issue. It is an issue related to using Options Types. As you have spotted you do not have to use ASP specific codeif you don't need the ASP sorting; so get it working with the standard instructions from Options Types and then if you need to think about ASP sorting integration add it later.

 

I would love to help, and I'm sure you are close, but this is not something I can just respond to without taking a specific look at the queries and the flow of your code; and I'm afraid I have to limit my 'free' work to things I know off the top of my head or that are issues with ASP.

 

You are welcome to PM me to discuss further, otherwise, good luck!

 

Chris.

(You could always try the Options Types support thread!)

Link to comment
Share on other sites

Hi Toasty,

 

First of all, thanks for the great contribution! I'm totally new to osCommerce (3 days) and am just figuring out how to install contributions and modules and am really pleased with the results.

 

However, I have a little problem, and I don't know if it's specific to Attribute Sets Plus or if it was just something I did to mess it up. (I've searched the forums several times but have yet to find a solution.)

 

I installed Attribute Sets Plus yesterday and it worked great (it was the first time I ever installed a contribution and I had one false start but got it on the 2nd try).

 

But then last night I installed the Shipping Insurance module http://www.oscommerce.com/community/contri...earch,insurance

 

and today I installed the World Zones shipping module

http://www.oscommerce.com/community/contri...rch,world+zones

 

and after a whole day of not checking my product listings (so I'm not sure when it happened), I discovered tonight that my attributes were gone from the product info page. The drop-down menus are still there, but they're blank and short (because there's no option values in them anymore). The attributes and attribute sets are all still intact in my Admin control panel, they just won't show up in the actual catalog (in any my lanugages - English, German or Spanish).

 

screencapturestorenoattributes.jpg

 

If it wasn't the installation of the new modules, the only thing I can think of that could have messed up my attributes would have been because I went into some of the php files today to edit the size of the option names for the checkout pages because they were so tiny that they were barely legible. I'm quite sure I didn't delete anything other than the font properties, but may have unknowingly done some damage elsewhere. I've tried re-uploading my back-up of the product_info.php with your code in it but it didn't come back.

 

I would so appreciate any help I can get on this. I'm still sort of in that early panicky stage and am losing sleep over this :o ... and I could really use some sleep ...

 

Thanks so much,

Aubrey

Edited by surfbug
Link to comment
Share on other sites

Hi Toasty,

 

First of all, thanks for the great contribution! I'm totally new to osCommerce (3 days) and am just figuring out how to install contributions and modules and am really pleased with the results.

 

However, I have a little problem, and I don't know if it's specific to Attribute Sets Plus or if it was just something I did to mess it up. (I've searched the forums several times but have yet to find a solution.)

 

I installed Attribute Sets Plus yesterday and it worked great (it was the first time I ever installed a contribution and I had one false start but got it on the 2nd try).

 

But then last night I installed the Shipping Insurance module http://www.oscommerce.com/community/contri...earch,insurance

 

and today I installed the World Zones shipping module

http://www.oscommerce.com/community/contri...rch,world+zones

 

and after a whole day of not checking my product listings (so I'm not sure when it happened), I discovered tonight that my attributes were gone from the product info page. The drop-down menus are still there, but they're blank and short (because there's no option values in them anymore). The attributes and attribute sets are all still intact in my Admin control panel, they just won't show up in the actual catalog (in any my lanugages - English, German or Spanish).

 

screencapturestorenoattributes.jpg

 

If it wasn't the installation of the new modules, the only thing I can think of that could have messed up my attributes would have been because I went into some of the php files today to edit the size of the option names for the checkout pages because they were so tiny that they were barely legible. I'm quite sure I didn't delete anything other than the font properties, but may have unknowingly done some damage elsewhere. I've tried re-uploading my back-up of the product_info.php with your code in it but it didn't come back.

 

I would so appreciate any help I can get on this. I'm still sort of in that early panicky stage and am losing sleep over this :o ... and I could really use some sleep ...

 

Thanks so much,

Aubrey

 

 

I have no idea - to trouble shoot remove any ASP specific code from product_info.php (put back the original code). Following doing that you are back to standard osCommerce so you can troubleshoot knowing it is not ASP causing the problem.

 

Also, check the products_attributes table to see if the attributes exist on a specific product. Also check for duplicates (languages issue) in the products_options and products_options_values tables.

 

In a hurry but there are some thoughts.

 

C.

Link to comment
Share on other sites

I have no idea - to trouble shoot remove any ASP specific code from product_info.php (put back the original code). Following doing that you are back to standard osCommerce so you can troubleshoot knowing it is not ASP causing the problem.

 

Also, check the products_attributes table to see if the attributes exist on a specific product. Also check for duplicates (languages issue) in the products_options and products_options_values tables.

 

In a hurry but there are some thoughts.

 

C.

 

Hi Chris,

 

Thanks for the reply. I tried re-installing the backup of the original product_info.php file and the attributes came back, but some of them were in reverse order and some are in normal order, so then I copied in your code again and it's the same. I even went to the Attributes Sets panel and tried to re-order the options in reverse order to see if they would show in normal order in the store, but still no change.

 

attributesorder2.jpgattributesorder1.jpg

 

It's not a huge deal now because I'm just relieved that the attributes came back at all, but it would be nice to get to the bottom of it and restore the continuity of my listings with everything in the same order. I also tried to edit one of my listing - I thought I'd try and remove it and re-install the attribute sets to see if they would come out in order, but even after I check "Remove Set" and update my listing, the listing still keeps coming back with the attribute sets I'd just tried to remove.

 

I realize it's not your problem, you've already done a lot of work on the contribution, but any insights would be greatly appreciated. Oh, and I did check my tables for duplicates, but didn't find any.

 

Thanks for your help and have a nice night,

Aubrey

Link to comment
Share on other sites

Hi Chris,

 

Thanks for the reply. I tried re-installing the backup of the original product_info.php file and the attributes came back, but some of them were in reverse order and some are in normal order, so then I copied in your code again and it's the same. I even went to the Attributes Sets panel and tried to re-order the options in reverse order to see if they would show in normal order in the store, but still no change.

 

attributesorder2.jpgattributesorder1.jpg

 

It's not a huge deal now because I'm just relieved that the attributes came back at all, but it would be nice to get to the bottom of it and restore the continuity of my listings with everything in the same order. I also tried to edit one of my listing - I thought I'd try and remove it and re-install the attribute sets to see if they would come out in order, but even after I check "Remove Set" and update my listing, the listing still keeps coming back with the attribute sets I'd just tried to remove.

 

I realize it's not your problem, you've already done a lot of work on the contribution, but any insights would be greatly appreciated. Oh, and I did check my tables for duplicates, but didn't find any.

 

Thanks for your help and have a nice night,

Aubrey

 

To remove sets edit the product and use the remove facility there. Do not use the attributes_sets_edit.php to remove sets - it does not work; this a known issue. I have it fixed as a part of recent work but no testers appear to be interested so it sits alone and neglected on my pc along with global updates (whcih lets you add and remove sets to the whole database or specific manufacturers. :(

 

Can't help with your sort issue. If they are appearing in 'apparently' random order it is usually because they are showing in order of being added to the database (in id order), which is not what my code intended, but IS what the original osC code will produce in product_info.php. Some people do appear to have a problem with this - it seems to be site specific though; I do not know the cause as the code works as far as I can tell.

 

C.

Link to comment
Share on other sites

To remove sets edit the product and use the remove facility there. Do not use the attributes_sets_edit.php to remove sets - it does not work; this a known issue. I have it fixed as a part of recent work but no testers appear to be interested so it sits alone and neglected on my pc along with global updates (whcih lets you add and remove sets to the whole database or specific manufacturers. :(

 

Can't help with your sort issue. If they are appearing in 'apparently' random order it is usually because they are showing in order of being added to the database (in id order), which is not what my code intended, but IS what the original osC code will produce in product_info.php. Some people do appear to have a problem with this - it seems to be site specific though; I do not know the cause as the code works as far as I can tell.

 

C.

 

Hi Chris,

 

Thank you anyway, I'm just glad I got the options showing again and I love how convenient the Attribute Sets are. I'm sorry about your update and not having testers; I don't know if I'm experienced enough to be of any use - I'm still bumbling my way through this and experimenting with stuff - and getting a lot of parse errors and re-re-installing a lot of files :rolleyes: Maybe when I'm better acquainted with the system I can be of help with the testing.

 

Good luck and thanks again!

Aubrey :)

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