#661 changing woocommerce URLs in top bar menu
-
AuthorPosts
-
-
May 29, 2024 at 5:19 PM #978398
ADAGE
ParticipantHi,
Since I changed my woocommerce URLs, my orders is not /orders anymore but /commandes.
But in the top bar menu used by the theme, it’s still the old URLs, which return 404.
How and where I can edit those?
Thanks. -
May 29, 2024 at 5:20 PM #978399
ADAGE
ParticipantThis reply has been marked as private. -
May 30, 2024 at 10:25 AM #978557
Alice
ModeratorHi ADAGE,
We are checking your site. Please be patient, I’ll come back soon.
Yours Sincerely,
———-
Best Regards,
Alice -
May 30, 2024 at 10:31 AM #978561
Alice
ModeratorHi ADAGE,
We have fixed your issue on your website. Please check again.
If your issue is resolved, please tell us so that we can close this topic.
Sincerely
==============
Thimpress Support
Alice
-
May 30, 2024 at 5:35 PM #978664
ADAGE
ParticipantSame issue with “my profile” menu element…
Where can I edit this myself? -
May 31, 2024 at 11:26 AM #978805
Alice
ModeratorThis reply has been marked as private. -
May 31, 2024 at 4:15 PM #978900
ADAGE
ParticipantPlease confirm the code won’t be overwritten after an update.
-
June 1, 2024 at 9:46 AM #979026
Alice
ModeratorDear ADAGE,
Don’t worry, if there is any problem please tell me. I will support you.
Best regards,
Alice
-
June 1, 2024 at 4:59 PM #979125
ADAGE
ParticipantThat was not my question.
I need to build proper, good solutions to my clients.
You didn’t say what you did, so either you explain, either you hereby confirm the changes will not be affected by updates.
-
June 3, 2024 at 8:36 AM #979246
Alice
ModeratorDear ADAGE,
Our developer has responded. The URLs we edit for you on the topbar will not disappear or be overwritten if updated. Don’t worry.
Best regards,
Alice
-
June 4, 2024 at 12:05 AM #979423
ADAGE
ParticipantHi,
Just updated to last version of the theme, and… OF COURSE, your developpers were wrong and the menu is broken again…
Where and how may I change those?
Thank you. -
June 4, 2024 at 11:50 AM #979519
Alice
ModeratorThis reply has been marked as private. -
June 4, 2024 at 2:36 PM #979558
ADAGE
ParticipantNo I will no longer provide admin account since last time I did you crashed my design by restoring default settings.
You can provide screenshots, loom video, detailed instructions, documentation…
There are severals ways you can assist.Thank you.
-
June 4, 2024 at 3:30 PM #979572
Johnson
KeymasterDear ADAGE,
Sorry, I checked your problem, and found it was a theme error. Our dev has corrected the code but he hasn’t notified me yet to update. I apologize for this problem. You can edit the code in the file
wp-content/themes/course-builder/inc/widgets/login/login.php
lines 75, and 76 and change to$view_endpoint_orders = isset( $view_endpoint['orders'] ) ? $view_endpoint['orders'] : ''; $view_endpoint_settings = isset( $view_endpoint['settings'] ) ? $view_endpoint['settings'] : '';
– I will update it to the next version, then your update will not be lost
Best regards,Johnson
-
June 4, 2024 at 3:34 PM #979574
Johnson
Keymaster -
June 4, 2024 at 5:26 PM #979607
ADAGE
ParticipantHello and thank you,
Indeed this makes the trick, thank you.
Still, it didn’t work for the orders tab, as there is a conflict between WooCommerce and LearnPress /orders/ slug.In my profile, I can see:
– the default WooCommerce /orders/ tab, which is empty;
– the custom LearnPress /orders_woocommerce/ tab, which actually stores the orders.Currently the login shortcut redirects to the default WooCommerce /orders/ tab, which is useless since I paid and installed the LearnPress WooCommerce addon.
So with this addon installed, we should:
1. have only the orders_woocommerce tab displayed;
2. be able to rename this tab to the slug set under the LearnPress permalinks settings;
3. make the login shortcut to actually redirects to this tab.Thank you.
-
June 5, 2024 at 2:36 PM #979743
Johnson
KeymasterDear ADAGE,
You can use child theme and add custom code bellow to file functions.php of child theme
add_filter( 'learn-press/get-profile-tabs', 'course_builder_remove_lp_orders_page_profile', 10, 1 ); function course_builder_remove_lp_orders_page_profile( $tabs ) { unset( $tabs['orders'] ); return $tabs; } add_filter( 'thim_menu_profile_items_extend', 'course_builder_custom_menu_profile_items_extend', 10, 1 ); function course_builder_custom_menu_profile_items_extend( $html ) { $items = get_theme_mod( 'profile_menu_items' ); $profile = LP_Profile::instance(); if ( $profile ) { $sub_menu = ''; for ( $index = 0; $index < count( $items ); $index ++ ) { switch ( $items[$index] ) { case 'courses': $sub_menu .= '<li class="menu-item menu-item-courses"><a href="' . esc_url( learn_press_user_profile_link( get_current_user_id(), 'courses' ) ) . '">' . esc_html__( 'My Courses', 'course-builder' ) . '</a></li>'; break; case 'orders': $sub_menu .= '<li class="menu-item menu-item-orders"><a href="' . esc_url( learn_press_user_profile_link( get_current_user_id(), 'orders_woocommerce' ) ) . '">' . esc_html__( 'My Orders', 'course-builder' ) . '</a></li>'; break; case 'become_a_teacher': $sub_menu .= '<li class="menu-item menu-item-become-a-teacher"><a href="' . learn_press_get_page_link( 'become_a_teacher' ) . '">' . esc_html__( 'Become An Instructor', 'course-builder' ) . '</a></li>'; break; case 'certificates': if ( ! class_exists( 'LP_Addon_Certificates' ) ) { break; } $sub_menu .= '<li class="menu-item menu-item-certificates"><a href="' . esc_url( learn_press_user_profile_link( get_current_user_id(), 'certificates' ) ) . '">' . esc_html__( 'My Certificates', 'course-builder' ) . '</a></li>'; break; case 'settings': $sub_menu .= '<li class="menu-item menu-item-settings"><a href="' . esc_url( $profile->get_tab_link( 'settings', true ) ) . '">' . esc_html__( 'Edit Profile', 'course-builder' ) . '</a></li>'; break; default: break; } } return $sub_menu; } }
Best regards,
Johnson
-
June 5, 2024 at 4:26 PM #979770
ADAGE
ParticipantHello and thank you,
Indeed this works great now.
Still, the slug orders_woocommerce doesn’t seem to be translatable.
As per this other ticket, could you please confirm it will be with next release?
https://thimpress.com/forums/topic/661-duplicate-order-tab-in-client-orders_woocommerce/#post-979731
Thank you. -
June 5, 2024 at 5:00 PM #979773
Johnson
KeymasterDear ADAGE,
You can change the code above to
define( 'CUSTOM_LP_ORDER_WOO_SLUG', 'lp-woo-test' ); add_filter( 'learn-press/get-profile-tabs', 'course_builder_remove_lp_orders_page_profile', 10, 1 ); function course_builder_remove_lp_orders_page_profile( $tabs ) { unset( $tabs['orders'] ); $tabs['lp_orders_woocommerce']['slug'] = CUSTOM_LP_ORDER_WOO_SLUG; return $tabs; } add_filter( 'thim_menu_profile_items_extend', 'course_builder_custom_menu_profile_items_extend', 10, 1 ); function course_builder_custom_menu_profile_items_extend( $html ) { $items = get_theme_mod( 'profile_menu_items' ); $profile = LP_Profile::instance(); if ( $profile ) { $url_settings = learn_press_user_profile_link( get_current_user_id(), LP_Settings::instance()->get( 'profile_endpoints.settings', 'settings' ) ); $menu_items_output = ''; for ( $index = 0; $index < count( $items ); $index ++ ) { switch ( $items[$index] ) { case 'courses': $menu_items_output .= '<li class="menu-item menu-item-courses"><a href="' . esc_url( learn_press_user_profile_link( get_current_user_id(), LP_Settings::instance()->get( 'profile_endpoints.courses', 'courses' ) ) ) . '">' . esc_html__( 'My Courses', 'course-builder' ) . '</a></li>'; break; case 'orders': $menu_items_output .= '<li class="menu-item menu-item-orders"><a href="' . esc_url( learn_press_user_profile_link( get_current_user_id(), CUSTOM_LP_ORDER_WOO_SLUG ) ) . '">' . esc_html__( 'My Orders', 'course-builder' ) . '</a></li>'; break; case 'become_a_teacher': $menu_items_output .= '<li class="menu-item menu-item-become-a-teacher"><a href="' . learn_press_get_page_link( 'become_a_teacher' ) . '">' . esc_html__( 'Become An Instructor', 'course-builder' ) . '</a></li>'; break; case 'certificates': if ( ! class_exists( 'LP_Addon_Certificates' ) ) { break; } $menu_items_output .= '<li class="menu-item menu-item-certificates"><a href="' . esc_url( learn_press_user_profile_link( get_current_user_id(), LearnPress::instance()->settings()->get( 'lp_cert_slug', 'certificates' ) ) ) . '">' . esc_html__( 'My Certificates', 'course-builder' ) . '</a></li>'; break; case 'settings': $menu_items_output .= '<li class="menu-item menu-item-settings"><a href="' . esc_url( $url_settings ) . '">' . esc_html__( 'Edit Profile', 'course-builder' ) . '</a></li>'; break; default: break; } } return $menu_items_output; } }
– you need change ‘lp-woo-test’ in
define( 'CUSTOM_LP_ORDER_WOO_SLUG', 'lp-woo-test' );
to the slug you want
Best regards,
Johnson
-
June 5, 2024 at 5:19 PM #979777
ADAGE
ParticipantThis new code changes the slugs in both profile tabs and profile menu, but:
– if slug is /commandes/ (same as defined in woocommerce > settings > advanced and learnpress > settings > permalinks), then the page displays empty : https://prnt.sc/lHGY9feEmVWO
– if slug is /any-other-not-used-slug/ then returns 404.
Thank you. -
June 5, 2024 at 5:25 PM #979780
Johnson
KeymasterDear ADAGE,
You change
add_filter( 'learn-press/get-profile-tabs', 'course_builder_remove_lp_orders_page_profile', 10, 1 )
to
add_filter( 'learn-press/profile-tabs', 'course_builder_remove_lp_orders_page_profile', 10, 1 );
Best regards,
Johnson
-
June 5, 2024 at 5:36 PM #979784
ADAGE
ParticipantDone and /commandes/ still displays empty. Whatever values are set in both settings, always got empty page: https://prnt.sc/Xo23QUpT1SAh
Code is:
define(‘CUSTOM_LP_ORDER_WOO_SLUG’, ‘commandes’);
add_filter( ‘learn-press/profile-tabs’, ‘course_builder_remove_lp_orders_page_profile’, 10, 1 );
function course_builder_remove_lp_orders_page_profile($tabs) {
unset($tabs[‘orders’]);
$tabs[‘lp_orders_woocommerce’][‘slug’] = CUSTOM_LP_ORDER_WOO_SLUG;
return $tabs;
}add_filter(‘thim_menu_profile_items_extend’, ‘course_builder_custom_menu_profile_items_extend’, 10, 1);
function course_builder_custom_menu_profile_items_extend($html) {
$items = get_theme_mod(‘profile_menu_items’);
$profile = LP_Profile::instance();
if ($profile) {
$url_settings = learn_press_user_profile_link(get_current_user_id(), LP_Settings::instance()->get(‘profile_endpoints.settings’, ‘settings’));
$menu_items_output = ”;
for ($index = 0; $index < count($items); $index++) {
switch ($items[$index]) {
case ‘courses’:
$menu_items_output .= ‘<li class=”menu-item menu-item-courses”>get(‘profile_endpoints.courses’, ‘courses’))) . ‘”>’ . esc_html__(‘My Courses’, ‘course-builder’) . ‘‘;
break;
case ‘orders’:
$menu_items_output .= ‘<li class=”menu-item menu-item-orders”>‘ . esc_html__(‘My Orders’, ‘course-builder’) . ‘‘;
break;
case ‘become_a_teacher’:
$menu_items_output .= ‘<li class=”menu-item menu-item-become-a-teacher”>‘ . esc_html__(‘Become An Instructor’, ‘course-builder’) . ‘‘;
break;
case ‘certificates’:
if (!class_exists(‘LP_Addon_Certificates’)) {
break;
}
$menu_items_output .= ‘<li class=”menu-item menu-item-certificates”>settings()->get(‘lp_cert_slug’, ‘certificates’))) . ‘”>’ . esc_html__(‘My Certificates’, ‘course-builder’) . ‘‘;
break;
case ‘settings’:
$menu_items_output .= ‘<li class=”menu-item menu-item-settings”>‘ . esc_html__(‘Edit Profile’, ‘course-builder’) . ‘‘;
break;
default:
break;
}
}
return $menu_items_output;
}
} -
June 6, 2024 at 8:38 AM #979857
Johnson
KeymasterDear ADAGE,
Code in child theme woking ok, You need edit code in plugin learnpress-woo-payment/incs/class-lp-wc-hooks.php line 625 and change
$paged = end( $parts ) === 'orders_woocommerce' ? 1 : end( $parts );
to$paged = end( $parts ) === 'commandes' ? 1 : end( $parts );
I checked and there is no other way but to edit the code in the plugin. So you need to pay attention before updating the plugin
Best regards,
Johnson
-
June 7, 2024 at 12:11 AM #980016
ADAGE
ParticipantHello and thank you,
This doesn’t suit me as it will cause trouble when updating.
Will the theme or plugin be updated to allow to change the slug without editing the plugin?
Thank you. -
June 7, 2024 at 11:19 AM #980095
Johnson
KeymasterDear ADAGE,
We will note and update the plugin in the future to allow slug editing
Best regards,
Johnson
-
-
AuthorPosts
You must be logged in to reply to this topic. You can click here