function selectAction(id){
  var action = $(id).find('option:selected').val();
  var type = $(id).closest('fieldset').find('select[role="event-item-type"]').find('option:selected').attr('data-type');
  var sel = $(id).closest('fieldset').find('select[role="event-item-type"]');
  if(action == 'Update Cart' || action == 'Purchase'){ 
    $(id).closest('fieldset').find('select[role="event-item-type"]').find('option[data-type="p"]').prop('selected',true); 
    $(id).closest('fieldset').find('select[role="event-item-type"]').find('option[data-type="a"]').attr('disabled', true);
    $(id).closest('fieldset').find('select[role="event-item-type"]').find('option[data-type="b"]').attr('disabled', true); 
    if(type!= 'p'){
      selectType(sel)
    }
  }
  if(action == 'View Item'){$(id).parents('fieldset').find('select[role="event-item-type"]').find('option').attr('disabled', false); }
}
// Functions to bind product selectors together
Functions to bind product selectors together
Functions to bind product selectors together
function selectAction(id){
  var action = $(id).find('option:selected').val();
  var type = $(id).closest('fieldset').find('select[role="event-item-type"]').find('option:selected').attr('data-type');
  var sel = $(id).closest('fieldset').find('select[role="event-item-type"]');
  if(action == 'Update Cart' || action == 'Purchase'){ 
    $(id).closest('fieldset').find('select[role="event-item-type"]').find('option[data-type="p"]').prop('selected',true); 
    $(id).closest('fieldset').find('select[role="event-item-type"]').find('option[data-type="a"]').attr('disabled', true);
    $(id).closest('fieldset').find('select[role="event-item-type"]').find('option[data-type="b"]').attr('disabled', true); 
    if(type!= 'p'){
      selectType(sel)
    }
  }
  if(action == 'View Item'){$(id).parents('fieldset').find('select[role="event-item-type"]').find('option').attr('disabled', false); }
}
function selectAction ( id ) { var action = $ ( id ) . find ( 'option:selected' ) . val ( ) ; var type = $ ( id ) . closest ( 'fieldset' ) . find ( 'select[role="event-item-type"]' ) . find ( 'option:selected' ) . attr ( 'data-type' ) ; var sel = $ ( id ) . closest ( 'fieldset' ) . find ( 'select[role="event-item-type"]' ) ; if ( action == 'Update Cart' || action == 'Purchase' ) { $ ( id ) . closest ( 'fieldset' ) . find ( 'select[role="event-item-type"]' ) . find ( 'option[data-type="p"]' ) . prop ( 'selected' , true ) ; $ ( id ) . closest ( 'fieldset' ) . find ( 'select[role="event-item-type"]' ) . find ( 'option[data-type="a"]' ) . attr ( 'disabled' , true ) ; $ ( id ) . closest ( 'fieldset' ) . find ( 'select[role="event-item-type"]' ) . find ( 'option[data-type="b"]' ) . attr ( 'disabled' , true ) ; if ( type != 'p' ) { selectType ( sel ) } } if ( action == 'View Item' ) { $ ( id ) . parents ( 'fieldset' ) . find ( 'select[role="event-item-type"]' ) . find ( 'option' ) . attr ( 'disabled' , false ) ; } }
Functions to bind product selectors together
Functions to bind product selectors together