3 replies [Last post]
selinav's picture
Offline
Joined: 08/17/2009
Juice: 148
Was this information Helpful?

Hello,

I have an attribute "packaging" which have a lot of options.
When I create a new product and add this attribute, when I want to select the options, all of the options are default checked. So, it is long to uncheck all the case before to choose 2 or 3 options only.

Is it possible to uncheck all the case by default?

thanks in advance

Danny_Joris's picture
Offline
Joined: 05/09/2009
Juice: 199
_

I think the project needs alot more finetuning like this. There's more places in UC that needs this kind of functionality. I hope the devellopers will consider this.

SchwebDesign's picture
Offline
Joined: 09/30/2009
Juice: 46
Re: how to uncheck all options of attributes

I am very interested in a solution for this as well. Are ther any patches for this anyone could recomment?

-Cameron N. Hess
Web Designer and Developer
Schweb Design, LLC
www.schwebdesign.com

selinav's picture
Offline
Joined: 08/17/2009
Juice: 148
uncheck all options of attributes

Hello,

I've created a module to uncheck all options when you add an attribute.

<?php
function uc_attr_form_uc_object_attributes_form_alter(&$form, &$form_state) {
$form["#submit"][]='uc_attr_action';
}

function

uc_attr_action($form, &$form_state){
    if(
$form_state['values']['view'] == 'add'){
       
$attribute = uc_attribute_load($aid);
         
        foreach (
$form_state['values']['add_attributes'] as $aid) {
           
$attribute = uc_attribute_load($aid);
            foreach (
$attribute->options as $option) {
               
db_query("DELETE FROM {uc_product_options} WHERE nid=%d AND oid=%d", $form_state['values']['id'], $option->oid);
          }
        }
    }
}
?>
AttachmentSize
uc_attr.zip 653 bytes