Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -151,6 +151,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
try
|
||||
{
|
||||
$this->invoice->billaddress = \IPS\nexus\Customer\Address::constructFromData( \IPS\Db::i()->select( '*', 'nexus_customer_addresses', array( 'member=? AND primary_billing=1', \IPS\Member::loggedIn()->member_id ) )->first() )->address;
|
||||
$this->invoice->recalculateTotal();
|
||||
$this->invoice->save();
|
||||
$_SESSION[ 'wizard-' . md5( $checkoutUrl ) . '-step' ] = isset( $steps['checkout_shipping'] ) ? 'checkout_shipping' : 'checkout_pay';
|
||||
}
|
||||
@@ -418,17 +419,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Misc */
|
||||
$form->add( new \IPS\Helpers\Form\Checkbox( 'reg_admin_mails', $guestData ? $guestData['member']['allow_admin_mails'] : \IPS\Settings::i()->updates_consent_default == 'enabled' ? TRUE : FALSE, FALSE ) );
|
||||
\IPS\Member::loggedIn()->language()->words[ "reg_agreed_terms" ] = sprintf( \IPS\Member::loggedIn()->language()->get("reg_agreed_terms"), \IPS\Http\Url::internal( 'app=core&module=system&controller=terms', 'front', 'terms', array(), \IPS\Http\Url::PROTOCOL_RELATIVE ) );
|
||||
|
||||
/* Build the appropriate links for registration terms & privacy policy */
|
||||
if ( \IPS\Settings::i()->privacy_type == "internal" )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words[ "reg_agreed_terms" ] .= sprintf( \IPS\Member::loggedIn()->language()->get("reg_privacy_link"), \IPS\Http\Url::internal( 'app=core&module=system&controller=privacy', 'front', 'privacy', array(), \IPS\Http\Url::PROTOCOL_RELATIVE ), 'data-ipsDialog data-ipsDialog-size="wide" data-ipsDialog-title="' . \IPS\Member::loggedIn()->language()->get("privacy") . '"' );
|
||||
}
|
||||
else if ( \IPS\Settings::i()->privacy_type == "external" )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words[ "reg_agreed_terms" ] .= sprintf( \IPS\Member::loggedIn()->language()->get("reg_privacy_link"), \IPS\Http\Url::external( \IPS\Settings::i()->privacy_link ), 'target="_blank"' );
|
||||
}
|
||||
\IPS\core\modules\front\system\register::buildRegistrationTerm();
|
||||
$form->add( new \IPS\Helpers\Form\Checkbox( 'reg_agreed_terms', (bool) $guestData, TRUE, array(), function( $val )
|
||||
{
|
||||
if ( !$val )
|
||||
@@ -479,7 +470,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if ( isset( $securityQuestionAnswers[ $v ] ) )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack('security_questions_unique');
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'security_questions_unique', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->security_questions_number ?: 3 ) ) );
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -646,6 +637,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Save */
|
||||
$this->invoice->recalculateTotal();
|
||||
$this->invoice->save();
|
||||
return array();
|
||||
}
|
||||
@@ -1243,6 +1235,11 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
foreach ( $paymentMethods as $k => $v )
|
||||
{
|
||||
if ( in_array( '*', $item->paymentMethodIds ) ) // This looks odd but in older versions IPS\nexus\extensions\nexus\Item\Subscription::renewalPaymentMethodIds() was mistakenly returning array('*') and since the value is stored in the invoice we have to keep this for compatibility with invoices created at that time
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !in_array( $k, $item->paymentMethodIds ) )
|
||||
{
|
||||
unset( $paymentMethods[ $k ] );
|
||||
@@ -1312,7 +1309,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
if ( \IPS\Settings::i()->nexus_tac === 'checkbox' )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Checkbox( 'i_agree_to_tac', FALSE, TRUE, array( 'labelHtmlSprintf' => array( "<a href='" . htmlspecialchars( \IPS\Settings::i()->nexus_tac_link, ENT_DISALLOWED, 'UTF-8', FALSE ) . "' target='_blank'>" . \IPS\Member::loggedIn()->language()->addToStack( 'terms_and_conditions' ) . '</a>' ) ), function( $val )
|
||||
$form->add( new \IPS\Helpers\Form\Checkbox( 'i_agree_to_tac', FALSE, TRUE, array( 'labelHtmlSprintf' => array( "<a href='" . htmlspecialchars( \IPS\Settings::i()->nexus_tac_link, ENT_DISALLOWED, 'UTF-8', FALSE ) . "' target='_blank' rel='noopener'>" . \IPS\Member::loggedIn()->language()->addToStack( 'terms_and_conditions' ) . '</a>' ) ), function( $val )
|
||||
{
|
||||
if ( !$val )
|
||||
{
|
||||
@@ -1512,7 +1509,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$invoice->addItem( $values['coupon_code'] );
|
||||
$invoice->save();
|
||||
\IPS\Output::i()->redirect( $invoice->checkoutUrl() );
|
||||
\IPS\Output::i()->redirect( $invoice->checkoutUrl()->setQueryString( '_step', 'checkout_pay' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user