{"id":7464,"date":"2023-10-14T18:46:38","date_gmt":"2023-10-14T22:46:38","guid":{"rendered":"https:\/\/themespress.ca\/?p=7464"},"modified":"2023-10-14T18:46:38","modified_gmt":"2023-10-14T22:46:38","slug":"memberpress-subscriptions-woocommerce-customer-account","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/memberpress-subscriptions-woocommerce-customer-account\/","title":{"rendered":"MemberPress Subscriptions &#8211; WooCommerce customer account"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>With this tutorial, we will add a new tab that will allow you to access MemberPress subs for each customer in their respective WooCommerce profiles.<\/p>\n<p>We&#8217;re looking to add a new tab in the customer&#8217;s WooCommerce account.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-4103181\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-4103181\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"standard\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">\/\/New Tab Woocommerce\nadd_filter ( &#039;woocommerce_account_menu_items&#039;, &#039;subscriptions_woocommerce_link&#039;, 40 );\nfunction subscriptions_woocommerce_link( $menu_links ){\n\t$menu_links = array_slice( $menu_links, 0, 5, true )\n\t+ array( &#039;subscriptions&#039; =&gt; &#039;Adh&eacute;sions Memberpress&#039; )\n\t+ array_slice( $menu_links, 5, NULL, true );\n\treturn $menu_links;\n}\n\n\/\/Register permalink endpoint\nadd_action( &#039;init&#039;, &#039;subscriptions_woocommerce_link_add_endpoint&#039; );\nfunction subscriptions_woocommerce_link_add_endpoint() {\n    add_rewrite_endpoint( &#039;subscriptions&#039;, EP_PAGES );\n}\n\n\/\/Content for the new page in My Account, woocommerce_account_{ENDPOINT NAME}_endpoint\nadd_action( &#039;woocommerce_account_subscriptions_endpoint&#039;, &#039;subscriptions_endpoint_content&#039; );\nfunction subscriptions_endpoint_content() {\n\techo &#039;&lt;h2&gt;Adh&eacute;sions&lt;\/h2&gt;&#039;;\n\techo do_shortcode(&#039;[mepr-account-form]&#039;);\n}<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>Once you&#8217;ve added the code in your functions.php file, you will need to go in your WordPress configurations and re-save your permalinks without changing the configurations.<strong>Simply click on Update.<\/strong><\/p>\n\n\t\t<\/div>\n\t<\/div>\n\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>Now, we will rewrite the display layout of the MemberPress template.<\/p>\n<p>In order to proceed, you&#8217;ll need a WordPress theme or child theme. In the enabled theme, you&#8217;ll need to add a new <strong>MemberPress<\/strong> folder in the root folder of your theme and then add the <strong>mpca-manage-account-template.php<\/strong> file in the newly created folder.<\/p>\n<p>You will also need the <strong>memberpress-corporate\/app\/views\/mpca-manage-account-template.php<\/strong> file in the same MemberPress folder.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"With this tutorial, we will add a new tab that will allow you to access MemberPress subs for each customer in their respective WooCommerce profiles. We're looking to add a<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/memberpress-subscriptions-woocommerce-customer-account\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":7465,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[],"class_list":["post-7464","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/7464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=7464"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/7464\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/7465"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=7464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=7464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=7464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}