Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

@@ -307,15 +307,16 @@ class _checkout extends \IPS\Dispatcher\Controller
}
$form->add( new \IPS\Helpers\Form\Checkbox( 'reg_admin_mails', $guestData ? $guestData['member']['allow_admin_mails'] : TRUE, FALSE ) );
\IPS\Member::loggedIn()->language()->words[ "reg_agreed_terms" ] = \IPS\Member::loggedIn()->language()->get( 'reg_agreed_terms', FALSE, array( 'sprintf' => array( \IPS\Http\Url::internal( 'app=core&module=system&controller=terms', 'front', 'terms' ) ) ) );
\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(), 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" ] .= \IPS\Member::loggedIn()->language()->get( 'reg_privacy_link', FALSE, array( 'sprintf' => array( \IPS\Http\Url::internal( 'app=core&module=system&controller=privacy', 'front', 'privacy' ), 'data-ipsDialog data-ipsDialog-size="wide" data-ipsDialog-title="' . \IPS\Member::loggedIn()->language()->get("privacy") . '"' ) ) );
\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(), 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" ] .= \IPS\Member::loggedIn()->language()->get( 'reg_privacy_link', FALSE, array( 'sprintf' => array( \IPS\Http\Url::external( \IPS\Settings::i()->privacy_link ), 'target="_blank"' ) ) );
\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"' );
}
$form->add( new \IPS\Helpers\Form\Checkbox( 'reg_agreed_terms', (bool) $guestData, TRUE, array(), function( $val )
{
@@ -552,7 +553,7 @@ class _checkout extends \IPS\Dispatcher\Controller
$shipMethods = array();
foreach ( \IPS\nexus\Shipping\FlatRate::roots() as $rate )
{
if ( $rate->isAvailable( $this->invoice->shipaddress ) )
if ( $rate->isAvailable( $this->invoice->shipaddress, iterator_to_array( $this->invoice->items ), $this->invoice->currency, $this->invoice ) )
{
$shipMethods[ $rate->id ] = $rate;
}
@@ -612,14 +613,18 @@ class _checkout extends \IPS\Dispatcher\Controller
foreach ( $data['items'] as $item )
{
$weightInOz += ( $item->weight->float('oz') * $item->quantity );
foreach ( array( 'length', 'width', 'height' ) as $k )
$heightInInches += ( $item->height->float('in') * $item->quantity );
foreach ( array( 'length', 'width' ) as $k )
{
$v = "{$k}InInches";
$$v += ( $item->$k->float('in') * $item->quantity );
if ( $item->$k->float('in') > $$v )
{
$$v = $item->$k->float('in');
}
}
}
try
{
$easyPost = \IPS\nexus\Shipping\EasyPostRate::getRates( $lengthInInches, $widthInInches, $heightInInches, $weightInOz, $this->invoice->member, $this->invoice->shipaddress, $this->invoice->currency );
@@ -846,6 +851,7 @@ class _checkout extends \IPS\Dispatcher\Controller
public function _pay( $data )
{
/* How much are we paying? */
$this->invoice->recalculateTotal();
$amountToPay = $this->invoice->amountToPay();
if ( isset( \IPS\Request::i()->split ) and \IPS\Request::i()->split < $amountToPay->amount )
{
@@ -943,7 +949,12 @@ class _checkout extends \IPS\Dispatcher\Controller
{
$paymentMethodOptions[0] = \IPS\Member::loggedIn()->language()->addToStack( 'account_credit_with_amount', FALSE, array( 'sprintf' => array( \IPS\nexus\Customer::loggedIn()->cm_credits[ $this->invoice->currency ] ) ) );
}
$form = new \IPS\Helpers\Form( 'select_method', 'checkout_pay', $this->invoice->checkoutUrl() );
if ( isset( \IPS\Request::i()->split ) )
{
$form->hiddenValues['split'] = $amountToPay->amount;
}
$form->class = 'ipsForm_vertical';
if ( count( $paymentMethodOptions ) > 1 )
{
@@ -955,7 +966,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='" . htmlentities( \IPS\Settings::i()->nexus_tac_link, \IPS\HTMLENTITIES, '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, \IPS\HTMLENTITIES, 'UTF-8', FALSE ) . "' target='_blank'>" . \IPS\Member::loggedIn()->language()->addToStack( 'terms_and_conditions' ) . '</a>' ) ), function( $val )
{
if ( !$val )
{