<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
global $az_data;
?>
<?php
if (is_user_logged_in()) {
$user = wp_get_current_user();
$user_id = get_current_user_id(); }

if (class_exists('WeDevs_Dokan')){
$user_seller = dokan_is_user_seller($user_id);
if ( user_can( $user, 'dokandar' ) ) {
        $seller_dashboard = dokan_get_option( 'dashboard', 'dokan_pages' );
        if ( $seller_dashboard != -1 ) {
            $seller_page = get_permalink( $seller_dashboard );
        }
    }
}
?>

<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>"><span class="fas fa-tachometer-alt"></span><?php echo $az_data['text_uac']; ?></a></li>
<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>orders/"><span class="fas fa-history"></span><?php echo $az_data['text_uhi']; ?></a></li>
<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>downloads/"><span class="fas fa-download"></span><?php echo $az_data['text_udl']; ?></a></li>
<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>edit-address/"><span class="fas fa-pen-square"></span><?php echo $az_data['text_uadd']; ?></a></li>
<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>edit-account/"><span class="fas fa-user"></span><?php echo $az_data['text_ueac']; ?></a></li>
<?php
if (class_exists('WooWallet'))
{ ?>
<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>woo-wallet/"><span class="fas fa-credit-card"></span><?php echo $az_data['text_uwa']; ?></a></li>
<?php
} ?>
<li><a href="<?php 
echo wc_get_cart_url(); ?>"><span class="fas fa-shopping-basket"></span><?php echo $az_data['text_ush']; ?></a></li>
<?php if( class_exists( 'Awesome_Support' ) ) { ?>
<li><a href="<?php echo wpas_get_submission_page_url(); ?>"><span class="fas fa-paper-plane"></span>ارسال تیکت</a></li>
<?php } ?>
<?php if( class_exists( 'Awesome_Support' ) ) { ?>
<li><a href="<?php echo wpas_get_tickets_list_page_url(); ?>"><span class="fas fa-list"></span>تیکت ها</a></li>
<?php } ?>

<?php
if (class_exists('WAST_Support_Ticket'))
{ 
if(!$user_seller) {
  $ticket_page = wc_get_page_permalink( 'myaccount' ) . 'tickets/';
}
else {
  $ticket_page = $seller_page . 'tickets/';
}
  ?>
<li><a href="
<?php
echo $ticket_page; ?>"><span class="fas fa-ticket"></span>تیکت پشتیبانی</a></li>
<?php
} ?>

<?php
if(!$user_seller){
if (class_exists('WeDevs_Dokan') && class_exists('Dokan_Pro')) { ?>
<li><a href="<?php
echo wc_get_page_permalink( 'myaccount' ) ?>account-migration/seller/" class="fes-bav"><span class="fas fa-star"></span><?php echo $az_data['text_bav']; ?></a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan')) { ?>
<li><a href="<?php
echo $seller_page ?>products/"><span class="fas fa-briefcase"></span>محصولات</a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan')) { ?>
<li><a href="<?php
echo $seller_page ?>orders/"><span class="fas fa-shopping-cart"></span>سفارشات</a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan') && class_exists('Dokan_Pro')) { ?>
<li><a href="<?php
echo $seller_page ?>coupons/"><span class="fas fa-gift"></span>کوپن‌ها</a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan') && class_exists('Dokan_Pro')) { ?>
<li><a href="<?php
echo $seller_page ?>reports/"><span class="fas fa-line-chart"></span>گزارشات</a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan') && class_exists('Dokan_Pro')) { ?>
<li><a href="<?php
echo $seller_page ?>reviews/"><span class="fas fa-comments"></span>نظرات</a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan')) { ?>
<li><a href="<?php
echo $seller_page ?>withdraw/"><span class="fas fa-upload"></span>برداشت</a></li>
<?php
 }} ?>

<?php
if($user_seller){
if (class_exists('WeDevs_Dokan')) { ?>
<li><a href="<?php
echo $seller_page ?>settings/store/"><span class="fas fa-cog"></span>تنظیمات</a></li>
<?php
 }} ?>

<?php if( class_exists( 'Affiliate_WP' ) ) { ?>
<li><a href="<?php echo esc_url( affwp_get_affiliate_area_page_url() ); ?>"><span class="fas fa-handshake"></span>همکاری در فروش</a></li>
<?php } ?>
<li><a href="<?php
echo wc_logout_url( wc_get_page_permalink( "myaccount" ) ); ?>"><span class="fas fa-power-off"></span><?php echo $az_data['text_ucl']; ?></a></li>