- This topic has 10 replies, 2 voices, and was last updated 3 years, 2 months ago by
David.
-
AuthorPosts
-
February 24, 2023 at 2:14 am #2545128
Jusung
When it is a certain link, can I change the opened tab link?
by default, I open the first tap, but when It is from other link, I want to open the second tab.
February 24, 2023 at 3:26 am #2545235David
StaffCustomer SupportHi there,
if you select the Tab Item, and in Advanced add a unique HTML Anchor. For example
tab-2Then when you can use that Jump Link, eg.
https://mywebsite.com/page-slug/#tab-2and that link will jump to and open that tab.February 24, 2023 at 4:11 am #2545291Jusung
Hello.
I can’t understand.
I tried to add it as you said, but nothing happened.When the link is from those, I want to open third tap.
Then what can I add?
Is it possible to add 2 html anchor?
I tried to add billing, but nothing happened.maybe I can use “edit-address” this one??
February 24, 2023 at 5:17 am #2545366David
StaffCustomer SupportThose URLs are for an account page, i would need a login for them
February 24, 2023 at 5:51 am #2545409Jusung
I added the ID and PW.
On third tap, when I click edit, the link includes “edit-address” this one.
February 24, 2023 at 6:39 am #2545464David
StaffCustomer SupportSee here:
In the Tab Item -> Advanced –> HTML Anchor i add my anchor:
my-anchorNow i got to:
https://mysite.com/page-name/#my-anchorAnd that URL will take me to and open that Tab.
You will need to just the Jumplink methods instead of the standard Woocomerce URLs as you have relaced their tabs with your own
February 24, 2023 at 8:35 am #2545723Jusung
I understand now.
So, I added the html anchor like test111
and after that, I have to add #test111 at the end of the link.For woocommerce, I need to change the end point using php code..
Is this right?February 24, 2023 at 9:55 pm #2546125Jusung
// Change the edit billing address link add_filter( 'woocommerce_billing_fields', 'my_custom_billing_fields' ); function my_custom_billing_fields( $fields ) { $fields['billing_address_1']['custom_link'] = wc_get_account_endpoint_url( 'edit-address', 'billing' ) . 'https://abc/my-account/edit-address/billing/#address-tab'; return $fields; } // Change the edit shipping address link add_filter( 'woocommerce_shipping_fields', 'my_custom_shipping_fields' ); function my_custom_shipping_fields( $fields ) { $fields['shipping_address_1']['custom_link'] = wc_get_account_endpoint_url( 'edit-address', 'shipping' ) . 'https://abc/my-account/edit-address/shipping/#address-tab'; return $fields; } // Replace the link in the billing address template add_filter( 'woocommerce_my_account_edit_address_url', 'my_custom_edit_billing_address_link', 10, 3 ); function my_custom_edit_billing_address_link( $url, $type, $id ) { if ( $type == 'billing' ) { $url = wc_get_account_endpoint_url( 'edit-address', 'billing' ) . 'https://abc.com/my-account/edit-address/billing/#address-tab'; } return $url; } // Replace the link in the shipping address template add_filter( 'woocommerce_my_account_my_address_formatted_address', 'my_custom_shipping_address_link', 10, 3 ); function my_custom_shipping_address_link( $address, $customer_id, $address_id ) { $address['edit']['url'] = wc_get_account_endpoint_url( 'edit-address', 'shipping' ) . 'https://abc.com/my-account/edit-address/shipping/#address-tab'; return $address; }These are the link I used, but doen’s make any change.
February 25, 2023 at 6:00 am #2546448David
StaffCustomer SupportTry URL:
https://abc.com/my-account/edit-address/#address-tabAs all endpoints are simply a query var.
But you’re hacking the way Woocommerce works, so i cannot really advise on this, as you could make bigger problems doing this, and we cannot support Woocommrce custom developmentFebruary 25, 2023 at 7:23 am #2546533Jusung
Thank you for help !!
February 26, 2023 at 4:07 am #2547243David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.
