diff --git a/include/library/Crunchbutton/Reward.php b/include/library/Crunchbutton/Reward.php index 4c53865f6..aa4bed6cc 100644 --- a/include/library/Crunchbutton/Reward.php +++ b/include/library/Crunchbutton/Reward.php @@ -185,8 +185,14 @@ class Crunchbutton_Reward extends Cana_Table{ public function getReferredDiscountAmount(){ if( $this->code ){ $admin = Crunchbutton_Admin::byInviteCode( $this->code )->get( 0 ); - if( $admin->referral_customer_credit ){ - return floatval( $admin->referral_customer_credit ); + if( $admin->id_admin ){ + if( $admin->referral_customer_credit ){ + return floatval( $admin->referral_customer_credit ); + } else { + $settings = $this->loadSettings(); + return floatval( $settings[ Crunchbutton_Reward::CONFIG_KEY_GET_REFERRED_DISCOUNT_AMOUNT ] ); + } + } else { $user = Crunchbutton_User::byInviteCode( $this->code ); if( $user->id_user ){