Forum Replies Created
-
AuthorPosts
-
moyer
ParticipantI see. Thanks!
moyer
ParticipantThank you for kind reply. Unfortunately, it is not. I wrote what i want to combine two or more than two conditions again:
Currently, i set like these:
1.
[swpm_protected for=“2” custom_msg=’this is custom msg’]
content message
[adinserter block=”1″]
[/swpm_protected]2.
[swpm_protected visible_to=“not_logged_in_users_only” custom_msg=’this is custom msg’]
content message
[adinserter block=”1″]
[/swpm_protected]However, I hope to combine two into one short codes like this:
[swpm_protected for=“2” & visible_to=“not_logged_in_users_only” custom_msg=’this is custom msg’]
content message
[adinserter block=”1″]
[/swpm_protected]Unfortunately, the combined order what i tried does not work. Could you give me an solution?
Thanks.moyer
ParticipantThank you for kind reply. I got it.
November 13, 2023 at 2:56 am in reply to: Updating failed when save [swpm_show_member_info column=”expiry_date”] #27388moyer
ParticipantHi,
Thank you for quick reply. I cleared the issue with ‘WebTask With Hassan’ youtube channel as well as chatGPT’s hands.1. remove the profile page including the shortcode
2. create custom tab in my account of woocommerce.
3. insert the profile info shortcodesHere is the code from GPT:
// 1. Register new endpoint (URL) for My Account page
// Note: Re-save Permalinks or it will give 404 error
function wtwh_add_custom_tab_endpoint() {
add_rewrite_endpoint( ‘membership’, EP_ROOT | EP_PAGES );
}add_action( ‘init’, ‘wtwh_add_custom_tab_endpoint’ );
// 2. Add new query var
function wtwh_add_custom_tab_query_vars( $vars ) {
$vars[] = ‘membership’;
return $vars;
}add_filter( ‘query_vars’, ‘wtwh_add_custom_tab_query_vars’, 0 );
// 3. Insert the new endpoint into the My Account menu
function wtwh_add_custom_tab_link_my_account( $items ) {
$items[‘membership’] = ‘멤버십’; // 한글 타이틀
return $items;
}add_filter( ‘woocommerce_account_menu_items’, ‘wtwh_add_custom_tab_link_my_account’ );
// 4. Add content to the new tab
function wtwh_add_custom_tab_content() {
echo ‘<h3>멤버십</h3>’;
echo ‘<p>사용자명: ‘ . do_shortcode(‘[swpm_show_member_info column=”user_name”]’) . ‘</p>’;
echo ‘<p>성: ‘ . do_shortcode(‘[swpm_show_member_info column=”last_name”]’) . ‘</p>’;
echo ‘<p>이름: ‘ . do_shortcode(‘[swpm_show_member_info column=”first_name”]’) . ‘</p>’;
echo ‘<p>이메일주소: ‘ . do_shortcode(‘[swpm_show_member_info column=”email”]’) . ‘</p>’;
echo ‘<p>멤버십 그룹명: ‘ . do_shortcode(‘[swpm_show_member_info column=”membership_level_name”]’) . ‘</p>’;
echo ‘<p>멤버십 현황: ‘ . do_shortcode(‘[swpm_show_member_info column=”account_state”]’) . ‘</p>’;
echo ‘<p>멤버십 시작일: ‘ . do_shortcode(‘[swpm_show_member_info column=”member_since”]’) . ‘</p>’;
echo ‘<p>멤버십 종료일: ‘ . do_shortcode(‘[swpm_show_member_info column=”expiry_date”]’) . ‘</p>’;
}add_action( ‘woocommerce_account_membership_endpoint’, ‘wtwh_add_custom_tab_content’ );
-
AuthorPosts