コード例 #1
0
 /**
  * Add custom template form my-account page
  *
  * @return   void
  * @since    2.0.0
  * @author   Francesco Licandro <*****@*****.**>
  */
 function yit_my_account_template()
 {
     if (function_exists('WC') && is_page(get_option('woocommerce_myaccount_page_id'))) {
         global $wp;
         if (is_user_logged_in()) {
             if (!is_rtl()) {
                 echo '<div class="col-sm-3" id="my-account-sidebar">';
                 wc_get_template('/myaccount/my-account-menu.php');
                 echo '</div>';
             }
             echo '<div class="col-sm-9" id="my-account-content">';
             wc_print_notices();
             if (!isset($wp->query_vars['recent-downloads']) && !isset($wp->query_vars['wishlist']) && !isset($wp->query_vars['edit-address']) && !isset($wp->query_vars['edit-account']) && !isset($wp->query_vars['view-order']) && !isset($wp->query_vars['lost-password'])) {
                 wc_get_template('myaccount/my-orders.php', array('order_count' => 15));
             } elseif (isset($wp->query_vars['recent-downloads'])) {
                 wc_get_template('myaccount/my-downloads.php');
             } elseif (isset($wp->query_vars['wishlist'])) {
                 echo do_shortcode('[yith_wcwl_wishlist]');
             } else {
                 yit_content_loop();
             }
             echo '</div>';
             if (is_rtl()) {
                 echo '<div class="col-sm-3" id="my-account-sidebar">';
                 wc_get_template('/myaccount/my-account-menu.php');
                 echo '</div>';
             }
         } else {
             echo '<div class="row" id="my-account-content">';
             if (isset($wp->query_vars['lost-password'])) {
                 WC_Shortcode_My_Account::lost_password();
             } else {
                 wc_get_template('myaccount/form-login.php');
             }
             echo '</div>';
         }
     }
 }
コード例 #2
0
 /**
  * Add custom template form my-account page
  *
  * @return   void
  * @since    2.0.0
  * @author   Francesco Licandro <*****@*****.**>
  */
 function yit_my_account_template()
 {
     if (!function_exists('WC') || !is_page(wc_get_page_id('myaccount'))) {
         return;
     }
     global $wp;
     if (is_user_logged_in()) {
         echo '<div class="row" id="my-account-page">';
         echo '<div class="col-sm-3" id="my-account-sidebar">';
         wc_get_template('/myaccount/my-account-menu.php');
         echo '</div>';
         echo '<div class="col-sm-9" id="my-account-content">';
         wc_print_notices();
         if (isset($wp->query_vars['view-order']) && empty($wp->query_vars['view-order'])) {
             wc_get_template('myaccount/my-orders.php', array('order_count' => -1));
         } elseif (isset($wp->query_vars['recent-downloads'])) {
             wc_get_template('myaccount/my-downloads.php');
         } elseif (isset($wp->query_vars['myaccount-wishlist'])) {
             echo do_shortcode('[yith_wcwl_wishlist]');
         } else {
             yit_content_loop();
         }
         echo '</div>';
         echo '</div>';
     } else {
         echo '<div id="my-account-content">';
         if (isset($wp->query_vars['lost-password'])) {
             WC_Shortcode_My_Account::lost_password();
         } else {
             wc_get_template('myaccount/form-login.php');
         }
         echo '</div>';
     }
 }