Index: mp_products.module =================================================================== --- mp_products.module (revision 576) +++ mp_products.module (revision 591) @@ -162,10 +162,12 @@ } else { $form['base']['prices']['cost']['#access'] = user_access('administer products'); + $form['base']['prices']['cost']['#description'] = t('The amount seller will be paid.'); if(!variable_get('mp_products_admin_override', FALSE)) { $form['base']['prices']['cost']['#attributes'] = array('readonly' => 'readonly'); + $commission_rate = mp_products_get_commission_rate($node->type); + $form['base']['prices']['cost']['#description'] = t('The amount seller will be paid (%percent%).', array('%percent' => $commission_rate * 100)); } - $form['base']['prices']['cost']['#description'] = t('The amount seller will be paid.'); // determine if list_price should be required if (variable_get('mp_products_auto_calc_field', 'sell_price') == 'list_price') { $form['base']['prices']['list_price']['#required'] = TRUE; @@ -225,7 +227,8 @@ module_invoke_all('list_product', $node); break; case 'prepare': - if (!variable_get('mp_products_auto_calc', FALSE) && variable_get('mp_products_insert_js', FALSE)) { + //if (!variable_get('mp_products_auto_calc', FALSE) && variable_get('mp_products_insert_js', FALSE)) { + if (variable_get('mp_products_insert_js', FALSE)) { $commission_rate = mp_products_get_commission_rate($node->type); $fieldid = variable_get('mp_products_auto_calc_field', 'sell_price') == 'list_price' ? 'list-price' : 'sell-price'; drupal_add_js("$(document).ready(function(){ $('#edit-". $fieldid ."').blur(function(){ $('#edit-cost').val(Math.floor($('#edit-". $fieldid ."').val() * ". drupal_to_js($commission_rate)* 100 .")/100);});});", 'inline');