Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Adding Track Order Under Account Dropdown
New Landing › How can we help? › Atelier › Adding Track Order Under Account Dropdown
- This topic has 11 replies, 3 voices, and was last updated 7 years by Rui Guerreiro – SUPPORT.
-
Posted in: Atelier
-
December 24, 2016 at 11:21 pm #307980
Hey,
I’d like to add track order (http://retrozade.com/siparis-takibi/) to the drop down under the account icon on the top right of header as highlighted on attached screenshot.
Can you please let me know how to add this page to the dropdown?
Cheers,
AybarsAttachments:
You must be logged in to view attached files.December 27, 2016 at 7:24 pm #308125Hi,
I added this line of code into our sf_get_account() function.
$account_output .= '<li class="menu-item"><a href="http://retrozade.com/siparis-takibi/" class="admin-link">' . __( "Siparis Takib", "swiftframework" ) . '</a></li>' . "\n";
Try to copy the function below to your functions.php of your child theme.
/* ACCOUNT ================================================== */ if ( ! function_exists( 'sf_get_account' ) ) { function sf_get_account( $aux = "" ) { // VARIABLES $login_url = wp_login_url(); $logout_url = wp_logout_url( home_url() ); $my_account_link = get_admin_url(); $myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' ); if ( $myaccount_page_id ) { $my_account_link = get_permalink( $myaccount_page_id ); $logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) ); $login_url = get_permalink( $myaccount_page_id ); if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) { $logout_url = str_replace( 'http:', 'https:', $logout_url ); $login_url = str_replace( 'http:', 'https:', $login_url ); } } $login_url = apply_filters( 'sf_header_login_url', $login_url ); $register_url = apply_filters( 'sf_header_register_url', wp_registration_url() ); $my_account_link = apply_filters( 'sf_header_myaccount_url', $my_account_link ); if ( get_option( 'woocommerce_enable_myaccount_registration' ) && $myaccount_page_id ) { $register_url = apply_filters( 'sf_header_register_url', $my_account_link ); } global $sf_options; $show_sub = $sf_options['show_sub']; $show_translation = false; if ( isset($sf_options['show_translation']) ) { $show_translation = $sf_options['show_translation']; } $sub_code = __( $sf_options['sub_code'], 'swiftframework' ); $account_output = ""; // LINKS + SEARCH OUTPUT $account_output .= '<nav class="std-menu">' . "\n"; $account_output .= '<ul class="menu">' . "\n"; $account_output .= '<li class="parent account-item">' . "\n"; if ( $aux == "aux-text" ) { $account_output .= '<a href="#">' . __( "My Account", "swiftframework" ) . '</a>' . "\n"; } else { $account_output .= '<a href="#"><i class="sf-icon-account"></i></a>' . "\n"; } $account_output .= '<ul class="sub-menu">' . "\n"; $account_output .= '<li class="menu-item"><a href="http://retrozade.com/siparis-takibi/" class="admin-link">' . __( "Siparis Takib", "swiftframework" ) . '</a></li>' . "\n"; if ( is_user_logged_in() ) { $account_output .= '<li class="menu-item"><a href="' . $my_account_link . '" class="admin-link">' . __( "My Account", "swiftframework" ) . '</a></li>' . "\n"; $account_output .= '<li class="menu-item"><a href="' . $logout_url . '">' . __( "Sign Out", "swiftframework" ) . '</a></li>' . "\n"; } else { $account_output .= '<li class="menu-item"><a href="' . $login_url . '">' . __( "Login", "swiftframework" ) . '</a></li>' . "\n"; $account_output .= '<li class="menu-item"><a href="' . $register_url . '">' . __( "Sign Up", "swiftframework" ) . '</a></li>' . "\n"; } if ( $show_sub && $sub_code != "" ) { $account_output .= '<li class="parent"><a href="#">' . __( "Subscribe", "swiftframework" ) . '</a>' . "\n"; $account_output .= '<ul class="sub-menu">' . "\n"; $account_output .= '<li><div class="header-subscribe clearfix">' . "\n"; $account_output .= do_shortcode( $sub_code ) . "\n"; $account_output .= '</div></li>' . "\n"; $account_output .= '</ul>' . "\n"; $account_output .= '</li>' . "\n"; } if ( $show_translation ) { $account_output .= '<li class="parent aux-languages"><a href="#">' . __( "Language", "swiftframework" ) . '</a>' . "\n"; $account_output .= '<ul class="header-languages sub-menu">' . "\n"; if ( function_exists( 'sf_language_flags' ) ) { $account_output .= sf_language_flags(); } $account_output .= '</ul>' . "\n"; $account_output .= '</li>' . "\n"; } $account_output .= '</ul>' . "\n"; $account_output .= '</li>' . "\n"; $account_output .= '</ul>' . "\n"; $account_output .= '</nav>' . "\n"; // RETURN return $account_output; } }
Let me know if it worked.
-Rui
December 29, 2016 at 1:23 pm #308341Hey,
I haven’t install the child theme on the first hand.
Would it break anything with my site if I install it now and activate it with all the required plugins?Cheers,
AybarsDecember 29, 2016 at 1:30 pm #308343Ok now I have installed the child theme and pasted the code you’ve provided. However, it does not seem to work.
Cheers,
AybarsDecember 29, 2016 at 1:34 pm #308344Your child theme is not activated.
December 29, 2016 at 3:13 pm #308355I have activated the child theme and this happened as attached screenshot.
I also attached the edited functions.php file. So I deactivated the childtheme for now.Attachments:
You must be logged in to view attached files.December 29, 2016 at 3:16 pm #308357I can’t add php file so I add the screenshot now.
Attachments:
You must be logged in to view attached files.December 29, 2016 at 3:41 pm #308361In can’t close the php in line 7. Delete that line.
https://www.dropbox.com/s/lv6dghl99eqcicd/Screenshot%202016-12-29%2014.40.20.png?dl=0-Rui
December 29, 2016 at 4:44 pm #308369Hey,
That worked. Thanks!
However, after I activated the child theme instead of the main one, my global banner content was gone in the widgets. So, I had to copy from the main theme that content and paste to the child theme.
That’s not a problem. However, I now wonder if any of my theme settings is gone after I activated the child theme.Should I check and compare all my settings in between the main and the child theme? Does activating child theme change my theme options?
December 29, 2016 at 5:22 pm #308375When you activate a child theme, you often need to set the widgets/menu areas again. Theme Options and page content are fine though.
December 29, 2016 at 6:06 pm #308384Thanks, so we can assume this is resolved.
December 29, 2016 at 6:07 pm #308385great.
-Rui -
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.