Hi,
I propose a few new lines to this module: it allows to choose to display both Standard and Alternative buttons or ONLY the Alternative button :
1) Modify the display:
In function uc_alternative_price_form_alter($form_id, &$form)
if (!empty($alternative_price->standard_button)) {
$form['submit']['#value'] = $alternative_price->standard_button;
}becomes:
if (!empty($alternative_price->standard_button)) {
$form['submit']['#value'] = $alternative_price->standard_button;
}
if (variable_get('uc_alternative_price_one_button', FALSE)) {
$form['submit'] = array();
} 2) Add admin option to deal with it:
In function uc_alternative_price_feature_settings()
$form['uc_alternative_price_unpublish_alternative'] = array (
'#type' => 'checkbox',
'#title' => t('Unpublish "Unique" items only when purchased with an alternative price.'),
'#default_value' => variable_get('uc_alternative_price_unpublish_alternative', FALSE),
'#description' => t('If checked, products marked "Unique" will only become unpublished if they are purchased with an alternative price.'),
);becomes:
$form['uc_alternative_price_unpublish_alternative'] = array (
'#type' => 'checkbox',
'#title' => t('Unpublish "Unique" items only when purchased with an alternative price.'),
'#default_value' => variable_get('uc_alternative_price_unpublish_alternative', FALSE),
'#description' => t('If checked, products marked "Unique" will only become unpublished if they are purchased with an alternative price.'),
);
$form['uc_alternative_price_one_button'] = array (
'#type' => 'checkbox',
'#title' => t('Do not view Standard price button.'),
'#default_value' => variable_get('uc_alternative_price_one_button', FALSE),
'#description' => t('If checked, only the Alternative price button will published on the Product node.'),
);Feedback welcome.
Alexandre
