Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -1320,23 +1320,27 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
$canUseAccountCredit = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove any payment methods that can't be used for this transaction */
|
||||
foreach ( $paymentMethods as $gateway )
|
||||
{
|
||||
if ( !$gateway->checkValidity( $amountToPay, $this->invoice->billaddress, \IPS\nexus\Customer::loggedIn()->member_id ? \IPS\nexus\Customer::loggedIn() : \IPS\nexus\Customer::constructFromData( $this->invoice->guest_data['member'] ), $recurrings ) )
|
||||
{
|
||||
unset( $paymentMethods[ $gateway->id ] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Figure out which payment methods are available for card payments */
|
||||
$cardPaymentMethodIds = array_intersect( array_keys( $paymentMethods ), array_keys( \IPS\nexus\Gateway::cardStorageGateways() ) );
|
||||
|
||||
/* If there's something to pay, show a form for it... */
|
||||
$paymentType = NULL;
|
||||
$hiddenValues = array();
|
||||
$showSubmitButton = FALSE;
|
||||
if ( $amountToPay->amount->isGreaterThanZero() )
|
||||
{
|
||||
$paymentType = 'pay';
|
||||
|
||||
/* Remove any payment methods that can't be used for this transaction */
|
||||
foreach ( $paymentMethods as $gateway )
|
||||
{
|
||||
if ( !$gateway->checkValidity( $amountToPay, $this->invoice->billaddress, \IPS\nexus\Customer::loggedIn()->member_id ? \IPS\nexus\Customer::loggedIn() : \IPS\nexus\Customer::constructFromData( $this->invoice->guest_data['member'] ), $recurrings ) )
|
||||
{
|
||||
unset( $paymentMethods[ $gateway->id ] );
|
||||
}
|
||||
}
|
||||
|
||||
/* If we don't have any available payment methods, show an error */
|
||||
if ( \count( $paymentMethods ) === 0 and !$amountToPay->amount->isZero() )
|
||||
{
|
||||
@@ -1346,7 +1350,6 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
/* Build form */
|
||||
$elements = array();
|
||||
$paymentMethodsToggles = array();
|
||||
$showSubmitButton = FALSE;
|
||||
foreach ( $paymentMethods as $gateway )
|
||||
{
|
||||
foreach ( $gateway->paymentScreen( $this->invoice, $amountToPay, NULL, $recurrings ) as $element )
|
||||
@@ -1388,7 +1391,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
/* If there's nothing to pay now, but there will be something to pay later... if we DON'T have any stored payment methods, we may be able to prompt the user to create one */
|
||||
elseif ( $recurrings and array_intersect( array_keys( $paymentMethods ), array_keys( \IPS\nexus\Gateway::cardStorageGateways() ) ) and !\IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_cards', array( 'card_member=?', \IPS\nexus\Customer::loggedIn()->member_id ) )->first() and $elements = \IPS\nexus\Customer\CreditCard::createFormElements( \IPS\nexus\Customer::loggedIn(), FALSE, $showSubmitButton, $hiddenValues ) )
|
||||
elseif ( $recurrings and $cardPaymentMethodIds and !\IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_cards', array( array( 'card_member=?', \IPS\nexus\Customer::loggedIn()->member_id ), array( \IPS\Db::i()->in( 'card_method', $cardPaymentMethodIds ) ) ) )->first() and $elements = \IPS\nexus\Customer\CreditCard::createFormElements( \IPS\nexus\Customer::loggedIn(), FALSE, $showSubmitButton, $hiddenValues, $cardPaymentMethodIds ) )
|
||||
{
|
||||
$paymentType = 'card';
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Do not cache this guest view invoice */
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
\IPS\Output::setCacheTime( false );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=nexus&module=clients&controller=invoices', 'front', 'clientsinvoices' ), \IPS\Member::loggedIn()->language()->addToStack('client_invoices') );
|
||||
|
||||
@@ -42,8 +42,8 @@ class _product extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'store_responsive.css', 'nexus', 'front' ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
|
||||
\IPS\Output::setCacheTime( false );
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class _store extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'store_responsive.css', 'nexus', 'front' ) );
|
||||
}
|
||||
|
||||
|
||||
/* Work out currency */
|
||||
if ( isset( \IPS\Request::i()->currency ) and \in_array( \IPS\Request::i()->currency, \IPS\nexus\Money::currencies() ) )
|
||||
{
|
||||
@@ -63,8 +63,8 @@ class _store extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$this->currency = \IPS\nexus\Customer::loggedIn()->defaultCurrency();
|
||||
}
|
||||
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
|
||||
\IPS\Output::setCacheTime( false );
|
||||
|
||||
/* Pass up */
|
||||
parent::execute();
|
||||
@@ -129,6 +129,7 @@ class _store extends \IPS\Dispatcher\Controller
|
||||
$url = $url->setQueryString( 'filter', \IPS\Request::i()->filter );
|
||||
foreach ( \IPS\Request::i()->filter as $filterId => $allowedValues )
|
||||
{
|
||||
$filterId = (int) $filterId;
|
||||
$where[] = array( \IPS\Db::i()->findInSet( "filter{$filterId}.pfm_values", array_map( 'intval', explode( ',', $allowedValues ) ) ) );
|
||||
$joins[] = array( 'table' => array( 'nexus_package_filters_map', "filter{$filterId}" ), 'on' => array( "filter{$filterId}.pfm_package=p_id AND filter{$filterId}.pfm_filter=?", $filterId ) );
|
||||
}
|
||||
@@ -387,6 +388,7 @@ class _store extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate('store')->categorySidebar( );
|
||||
\IPS\Output::i()->linkTags['canonical'] = (string) \IPS\Http\Url::internal( 'app=nexus&module=store&controller=store', 'front', 'store' );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('store')->index( \IPS\nexus\Customer::loggedIn()->cm_credits[ $this->currency ], $newProducts, $popularProducts );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('module__nexus_store');
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class _subscriptions extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Send no-cache headers for this page, required for guest sign-ups */
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
\IPS\Output::setCacheTime( false );
|
||||
|
||||
/* Create the table */
|
||||
$table = new \IPS\nexus\Subscription\Table( \IPS\Http\Url::internal( 'app=nexus&module=subscriptions&controller=subscriptions', 'front', 'nexus_subscriptions' ) );
|
||||
@@ -94,6 +94,7 @@ class _subscriptions extends \IPS\Dispatcher\Controller
|
||||
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=nexus&module=subscriptions&controller=subscriptions', 'front', 'nexus_subscriptions' ), \IPS\Member::loggedIn()->language()->addToStack('nexus_front_subscriptions') );
|
||||
|
||||
\IPS\Output::i()->linkTags['canonical'] = (string) \IPS\Http\Url::internal( 'app=nexus&module=subscriptions&controller=subscriptions', 'front', 'nexus_subscriptions' );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('nexus_front_subscriptions');
|
||||
\IPS\Output::i()->output = $table;
|
||||
}
|
||||
@@ -188,7 +189,7 @@ class _subscriptions extends \IPS\Dispatcher\Controller
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Send no-cache headers for this page, required for guest sign-ups */
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
\IPS\Output::setCacheTime( false );
|
||||
|
||||
/* Already purchased a subscription */
|
||||
if ( $current = \IPS\nexus\Subscription::loadByMember( \IPS\nexus\Customer::loggedIn(), FALSE ) AND ( $current->purchase AND ( !$current->purchase->cancelled OR $current->purchase->can_reactivate ) ) )
|
||||
|
||||
Reference in new issue
Block a user