The payment selector is added in hook_form_alter with a "weight" of -1. This seems to make the forms interface place the selector right up the top of the product page.
Our client wanted the payment selector repositioned below product attribute selection / option entry but still above the quantity field and "Add To Cart" button.
I have added the following field to the configuration menu in uc_downpayment.admin.inc, function uc_downpayment_admin
$form['downpayment_select_weight'] = array(
'#type' => 'textfield',
'#title' => t('Weight of downpayment mode selector'),
'#description' => t('Controls the positioning of the downpayment mode select control on the product display.'),
'#default_value' => variable_get('downpayment_select_weight', -1),
);
and changed the line
'#weight' => -1,
in uc_downpayment_form_alter to
'#weight' =>variable_get('downpayment_select_weight', -1),
This allows the placement of the payment selector to be modified slightly, hopefully to the client's taste. -1 (the default) leaves it at the top of the product page, 0 puts it nicely between attributes & options and the quantity field, and 1 puts it below the Add button.
Comments
Comment #1
sokrplare commentedYes, this is a great idea, thank you. We have added the weight selector in the downpayment settings page (with '#type' => 'weight').
Also, when this is not set the default value is now 0, between attributes and the quantity field.
Many thanks.