@extends('layouts.app') @section('title', __('Affiliate Account')) @php /* * Use the currency selected in Payment Settings for all * affiliate earnings. */ $displayCurrency = currency_code( $displayCurrency ?? $currency ?? default_currency() ); $affiliateEnabled = (bool) ( $affiliateEnabled ?? false ); $applicationStatus = strtolower( trim( (string) ( $applicationStatus ?? $user->affiliate_application_status ?? '' ) ) ); $stats = is_array($stats ?? null) ? $stats : []; $statCards = [ [ 'key' => 'links', 'label' => __('Links'), 'icon' => 'fa-link', 'color' => 'primary', 'decimals' => 0, 'suffix' => '', ], [ 'key' => 'clicks', 'label' => __('Clicks'), 'icon' => 'fa-mouse-pointer', 'color' => 'info', 'decimals' => 0, 'suffix' => '', ], [ 'key' => 'unique_visitors', 'label' => __('Visitors'), 'icon' => 'fa-users', 'color' => 'success', 'decimals' => 0, 'suffix' => '', ], [ 'key' => 'conversions', 'label' => __('Conversions'), 'icon' => 'fa-shopping-cart', 'color' => 'warning', 'decimals' => 0, 'suffix' => '', ], [ 'key' => 'conversion_rate', 'label' => __('Conversion Rate'), 'icon' => 'fa-percentage', 'color' => 'danger', 'decimals' => 2, 'suffix' => '%', ], ]; $isAffiliate = (bool) ( $user->is_affiliate ?? false ); $exportRouteExists = \Illuminate\Support\Facades\Route::has( 'account.affiliate.export' ); $joinRouteExists = \Illuminate\Support\Facades\Route::has( 'account.affiliate.join' ); $redirectRouteExists = \Illuminate\Support\Facades\Route::has( 'affiliate.redirect' ); @endphp @section('content')
{{ __( 'Promote eligible products and earn commission from confirmed sales.' ) }}
{{ __( 'Create referral links, share products, and earn commission when referred customers complete payment.' ) }}
@if($joinRouteExists) @else| {{ __('Product') }} | {{ __('Seller') }} | {{ __('Clicks') }} | {{ __('Referral URL') }} |
|---|---|---|---|
|
{{ $productTitle }}
|
{{ $sellerName }} | {{ number_format( max( 0, (int) ( $link ->clicks_count ?? 0 ) ) ) }} |
@if(filled($referralUrl))
|
| {{ __('Order') }} | {{ __('Product') }} | {{ __('Status') }} | {{ __('Rate') }} | {{ __('Amount') }} | {{ __('Date') }} |
|---|---|---|---|---|---|
| #{{ $earningOrderNumber }} |
{{ $earningProductTitle }}
|
{{ $earningLabel }} | {{ number_format( $commissionRate, 2 ) }}% | {{ money( $earningAmount, $displayCurrency ) }} |
@if($earningDate)
{{
$earningDate->format(
'M d, Y'
)
}}
{{
$earningDate
->diffForHumans()
}}
@else
{{ __('N/A') }}
@endif
|