Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\nexus;
|
||||
|
||||
/* 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;
|
||||
@@ -156,8 +156,8 @@ class _Coupon extends \IPS\Node\Model
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'c_limit_discount', $this->limit_discount, FALSE, array( 'options' => array( 0 => 'c_limit_discount_no', 1 => 'c_limit_discount_yes' ) ), NULL, NULL, NULL, 'c_limit_discount' ) );
|
||||
|
||||
$form->addHeader( 'coupon_dates' );
|
||||
$form->add( new \IPS\Helpers\Form\Date( 'c_start', $this->id ? $this->start : \IPS\DateTime::ts( time() ), TRUE, array( 'time' => TRUE ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Date( 'c_end', $this->id ? $this->end : 0, FALSE, array( 'time' => TRUE, 'unlimited' => 0, 'unlimitedLang' => 'no_end_date' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Date( 'c_start', $this->id ? \IPS\DateTime::ts( $this->start ) : \IPS\DateTime::ts( time() ), TRUE, array( 'time' => TRUE ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Date( 'c_end', ( $this->id and $this->end ) ? \IPS\DateTime::ts( $this->end ) : 0, TRUE, array( 'time' => TRUE, 'unlimited' => 0, 'unlimitedLang' => 'no_end_date' ) ) );
|
||||
|
||||
$form->addHeader( 'coupon_restrictions' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'c_combine', $this->combine ) );
|
||||
@@ -212,7 +212,7 @@ class _Coupon extends \IPS\Node\Model
|
||||
|
||||
if( isset( $values['c_groups'] ) )
|
||||
{
|
||||
$values['c_groups'] = is_array( $values['c_groups'] ) ? implode( ',', $values['c_groups'] ) : '*';
|
||||
$values['c_groups'] = \is_array( $values['c_groups'] ) ? implode( ',', $values['c_groups'] ) : '*';
|
||||
}
|
||||
|
||||
return $values;
|
||||
@@ -346,7 +346,7 @@ class _Coupon extends \IPS\Node\Model
|
||||
|
||||
foreach ( $invoice->items as $k => $item )
|
||||
{
|
||||
if ( $item instanceof \IPS\nexus\extensions\nexus\Item\Package and in_array( $item->id, $allowedProductIds ) )
|
||||
if ( $item instanceof \IPS\nexus\extensions\nexus\Item\Package and \in_array( $item->id, $allowedProductIds ) )
|
||||
{
|
||||
$hasAllowedProduct = TRUE;
|
||||
$productTotal = $productTotal->add( $item->price->amount->multiply( new \IPS\Math\Number("{$item->quantity}") ) );
|
||||
@@ -358,7 +358,7 @@ class _Coupon extends \IPS\Node\Model
|
||||
try
|
||||
{
|
||||
$purchase = \IPS\nexus\Purchase::load( $item->id );
|
||||
if ( $purchase->app == 'nexus' and $purchase->type == 'package' and in_array( $purchase->item_id, $allowedProductIds ) )
|
||||
if ( $purchase->app == 'nexus' and $purchase->type == 'package' and \in_array( $purchase->item_id, $allowedProductIds ) )
|
||||
{
|
||||
$hasAllowedProduct = TRUE;
|
||||
$productTotal = $productTotal->add( $item->price->amount );
|
||||
|
||||
Reference in new issue
Block a user