Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\CommunityEnhancements;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -81,14 +81,34 @@ class _EasyPost
'options' => array( 1 => 'easypost_show_rates_1', 0 => 'easypost_show_rates_0' ),
'toggles' => array( 1 => array( 'easypost_tax', 'easypost_price_adjustment', 'easypost_delivery_adjustment' ) )
), NULL, NULL, NULL, 'easypost_show_rates' ) );
$form->add( new \IPS\Helpers\Form\Node( 'easypost_tax', \IPS\Settings::i()->easypost_tax, FALSE, array( 'class' => '\IPS\nexus\Tax', 'zeroVal' => 'do_not_tax' ), NULL, NULL, NULL, 'easypost_tax' ) );
$taxClass = NULL;
if( \IPS\Settings::i()->easypost_tax )
{
try
{
$taxClass = \IPS\nexus\Tax::load( \IPS\Settings::i()->easypost_tax );
}
catch( \OutOfRangeException $e ){}
}
$form->add( new \IPS\Helpers\Form\Node( 'easypost_tax', $taxClass, FALSE, array( 'class' => '\IPS\nexus\Tax', 'zeroVal' => 'do_not_tax' ), NULL, NULL, NULL, 'easypost_tax' ) );
$form->add( new \IPS\nexus\Form\Money( 'easypost_price_adjustment', \IPS\Settings::i()->easypost_price_adjustment, FALSE, array(), NULL, NULL, NULL, 'easypost_price_adjustment' ) );
$form->add( new \IPS\Helpers\Form\Number( 'easypost_delivery_adjustment', \IPS\Settings::i()->easypost_delivery_adjustment, FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('days'), 'easypost_delivery_adjustment' ) );
$form->add( new \IPS\Helpers\Form\Interval( 'easypost_delivery_adjustment', \IPS\Settings::i()->easypost_delivery_adjustment, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::DAYS, 'min' => NULL ), NULL, NULL, NULL, 'easypost_delivery_adjustment' ) );
if ( $values = $form->values() )
{
$values['easypost_tax'] = $values['easypost_tax'] ? $values['easypost_tax']->_id : 0;
$values['easypost_price_adjustment'] = json_encode( $values['easypost_price_adjustment'] );
$values['easypost_address'] = ( !$haveSiteAddress or $values['easypost_address_select'] ) ? json_encode( $values['easypost_address_custom'] ) : '';
if( $haveSiteAddress )
{
unset( $values['easypost_address_select'] );
}
unset( $values['easypost_address_custom'] );
try
{
if ( $values['easypost_enable'] )