| Project: | Ubercart Contributions |
| Component: | Code |
| Category: | |
| Priority: | critical |
| Assigned: | japerry@drupal.org |
| Status: | patch (needs review) |
Jump to:
Our shipping manager realized today that when he creates orders from the admin menu that attributes don't work. Basically it comes down to this code in the uc_order.js:
Line 274:
$('#uc-order-add-product-form :input').each(
function() {
if ($(this).attr('name').substr(0, 10) == 'attributes') {
post_vars[$(this).attr('name')] = $(this).val();
}
}
);
I ran a debug on this, basically the array is being iterated through, resetting the post_vars attributes value to be the last one to iterate through. A simple addition to make sure the attribute is 'checked' will fix this bug:
$('#uc-order-add-product-form :input').each(
function() {
if ($(this).attr('name').substr(0, 10) == 'attributes' && $(this).attr('checked')) {
post_vars[$(this).attr('name')] = $(this).val();
}
}
);


