when set to total price and there are more then 1 attribute
graper - October 13, 2008 - 20:01
| Project: | Ubercart Ajax Attribute Calculations |
| Version: | 5.x-1.4 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I have an item that has 1 attribute that is a radio button and another attribute that is a text field. It seems that the prices first come out properly, but then switch to what each attribute would increase the base.
While I know that if the product has more then one attribute that it has to work in this manner as each attribute option may change the price of the product, it should be able to detect if the other attributes will not affect the price, like a text attribute that has no options.
should be as easy as changing the select statement looking for the number of attributes to exclude the text field type attribute.
granville

#1
Oddly enough I addressed this a couple months ago here: http://drupal.org/node/275367 but then never came back to uc_aac and applied the fix. I'll take care of that and possibly make a release if I can find any other clean-up that needs done.
#2
In the meantime, you could make the following replacement if you want to test this out. Support for uc_attribute_priced_attributes() is only available in Ubercart 1.1 or later.
<?phpfunction _uc_aac_markup($form_id, $nid) {
$result = db_query('SELECT sell_price FROM {uc_products} WHERE nid=%d AND vid=(SELECT vid FROM {node} WHERE nid=%d)', $nid, $nid);
$priced_attributes = count(uc_attribute_priced_attributes($nid));
$price = 0;
if ($product = db_fetch_object($result)) {
$price = $product->sell_price;
}
$update_attributes = 0;
if (variable_get('uc_aac_attribute_reprice', '1') == 1 && (variable_get('uc_attribute_option_price_format', 'adjustment') == 'adjustment' || $priced_attributes > 1) && (variable_get('uc_attribute_option_price_format', 'adjustment') != 'none')) {
$update_attributes = 1;
}
return theme('uc_aac_js', $nid, $price, $update_attributes);
}
?>
#3
This is fixed in the latest dev release by commit: http://drupal.org/cvs?commit=146425
#4
Automatically closed -- issue fixed for two weeks with no activity.