Fix public new member form use adh type amount
This commit is contained in:
parent
e791f9b863
commit
82bf9cd3e9
@ -543,6 +543,10 @@ jQuery(document).ready(function () {
|
|||||||
document.newmember.action.value="create";
|
document.newmember.action.value="create";
|
||||||
document.newmember.submit();
|
document.newmember.submit();
|
||||||
});
|
});
|
||||||
|
jQuery("#typeid").change(function() {
|
||||||
|
document.newmember.action.value="create";
|
||||||
|
document.newmember.submit();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
@ -561,7 +565,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
|
|||||||
$isempty = 0;
|
$isempty = 0;
|
||||||
}
|
}
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>';
|
||||||
print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
|
print $form->selectarray("typeid", $adht->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
} else {
|
} else {
|
||||||
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
|
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
|
||||||
@ -704,7 +708,8 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER
|
|||||||
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount
|
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount
|
||||||
|
|
||||||
// Set amount for the subscription
|
// Set amount for the subscription
|
||||||
$amount = isset($amount) ? $amount : 0;
|
$amountbytype = adht->amountByType(1);
|
||||||
|
$amount = !empty($amountbytype[GETPOST('typeid',int)]) ? $amountbytype[GETPOST('typeid',int)] : (isset ($amount) ? $amount : 0);
|
||||||
|
|
||||||
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
|
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
|
||||||
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
|
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
|
||||||
@ -713,6 +718,9 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER
|
|||||||
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
|
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
|
||||||
$amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT);
|
$amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$amount = price2num($amount);
|
||||||
|
|
||||||
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
|
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
|
||||||
print '<tr><td>'.$langs->trans("Subscription").'</td><td class="nowrap">';
|
print '<tr><td>'.$langs->trans("Subscription").'</td><td class="nowrap">';
|
||||||
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
|
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user