This adds the strings to what the processor can determin, allowing us to stop checkign contributeMode
if ($this->_mode) {
// process credit card
- $this->assign('contributeMode', 'direct');
$this->processCreditCard();
}
}
return ts('Make Contribution');
+ case 'eventContinueText':
+ // This use of the ts function uses the legacy interpolation of the button name to avoid translations having to be re-done.
+ if ((int) $this->_paymentProcessor['billing_mode'] === self::BILLING_MODE_NOTIFY) {
+ return ts('Click <strong>%1</strong> to checkout with %2.', [1 => ts('Register'), 2 => $this->_paymentProcessor['frontend_title']]);
+ }
+ return ts('Click <strong>%1</strong> to complete your registration.', [1 => ts('Register')]);
+
+ case 'eventConfirmText':
+ if ((int) $this->_paymentProcessor['billing_mode'] === self::BILLING_MODE_NOTIFY) {
+ return ts('Your registration payment has been submitted to %1 for processing', [1 => $this->_paymentProcessor['frontend_title']]);
+ }
+ return '';
+
+ case 'eventConfirmEmailText':
+ return ts('A registration confirmation email will be sent to %1 once the transaction is processed successfully.', [1 => $params['email']]);
+
case 'cancelRecurDetailText':
if ($params['mode'] === 'auto_renew') {
return ts('Click the button below if you want to cancel the auto-renewal option for your %1 membership. This will not cancel your membership. However you will need to arrange payment for renewal when your membership expires.',
}
// The concept of contributeMode is deprecated.
$this->_contributeMode = $this->get('contributeMode');
- $this->assign('contributeMode', $this->_contributeMode);
-
- $this->assign('paidEvent', $this->_values['event']['is_monetary']);
+ $this->assign('paidEvent', $this->getEventValue('is_monetary'));
// we do not want to display recently viewed items on Registration pages
$this->assign('displayRecent', FALSE);
$this->assign('amounts', $this->_amount);
$this->assign('totalAmount', $this->_totalAmount);
$this->set('totalAmount', $this->_totalAmount);
+ // This use of the ts function uses the legacy interpolation of the button name to avoid translations having to be re-done.
+ $this->assign('verifyText', !$this->_totalAmount ? ts('Click <strong>%1</strong> to complete your registration.', [1 => ts('Register')]) : $this->getPaymentProcessorObject()->getText('eventContinueText', []));
$showPaymentOnConfirm = (in_array($this->_eventId, \Civi::settings()->get('event_show_payment_on_confirm')) || in_array('all', \Civi::settings()->get('event_show_payment_on_confirm')));
$this->assign('showPaymentOnConfirm', $showPaymentOnConfirm);
public function buildQuickForm() {
// Assign the email address from a contact id lookup as in CRM_Event_BAO_Event->sendMail()
$primaryContactId = $this->get('primaryContactId');
+ $email = NULL;
if ($primaryContactId) {
$email = CRM_Utils_Array::valueByRegexKey('/^email-/', current($this->_params));
if (!$email) {
$email = CRM_Contact_BAO_Contact::getPrimaryEmail($primaryContactId);
}
- $this->assign('email', $email);
}
+ $this->assign('email', $email ?? NULL);
+ $this->assign('eventConfirmText', $this->getEventValue('is_monetary') ? $this->getPaymentProcessorObject()->getText('eventConfirmText', []) : '');
+ $this->assign('eventConfirmEmailText', ($email && $this->getEventValue('is_monetary')) ? $this->getPaymentProcessorObject()->getText('eventConfirmEmailText', ['email' => $email]) : '');
+
$this->assignToTemplate();
$invoicing = CRM_Invoicing_Utils::isInvoicingEnabled();
{ts 1=$register}Click <strong>%1</strong> to submit your registration for approval.{/ts}
{else}
{ts}Please verify your information.{/ts}
- {if $contributeMode EQ 'notify' and !$is_pay_later and !$isAmountzero}
- {ts 1=$register 2=$paymentProcessor.frontend_title}Click <strong>%1</strong> to checkout with %2.{/ts}
- {else}
- {ts 1=$register}Click <strong>%1</strong> to complete your registration.{/ts}
- {/if}
+ {$verifyText}
{/if}
</p></div>
{if $is_pay_later and !$isAmountzero and !$isOnWaitlist and !$isRequireApproval}
{if $is_email_confirm}
<p>{ts 1=$email}An email with event details has been sent to %1.{/ts}</p>
{/if}
- {* PayPal_Standard sets contribution_mode to 'notify'. We don't know if transaction is successful until we receive the IPN (payment notification) *}
- {elseif $contributeMode EQ 'notify' and $paidEvent}
- <p>{ts 1=$paymentProcessor.name}Your registration payment has been submitted to %1 for processing.{/ts}</p>
+ {* This text is determined by the payment processor *}
+ {elseif $eventConfirmText}
+ <p>{$eventConfirmText}</p>
{if $is_email_confirm}
- <p>{ts 1=$email}A registration confirmation email will be sent to %1 once the transaction is processed successfully.{/ts}</p>
+ <p>{$eventEmailConfirmText}</p>
{/if}
{else}
<p>{ts}Your registration has been processed successfully.{/ts}</p>