This question is about my woocommerce shop. I am trying to add new tab in my-account page (ticket tab). Eeverything going right, but when I hit the "ticket" tab I getting "404 not found" error!
I thought it should be work, but its no working.
Here is changes log:
add ticket code to woocommerce/includes/wc-template-functions.php
if ( ! function_exists( 'woocommerce_account_ticket' ) ) {
/**
* My Account > Ticket template.
*/
function woocommerce_account_ticket() {
wc_get_template( 'myaccount/ticket.php' );
}
}
add ticket code to woocommerce/includes/wc-template-hooks.php
add_action( 'woocommerce_account_ticket_endpoint', 'woocommerce_account_ticket' );
add ticket code to woocommerce/includes/admin/settings/class-wc-settings-accounts.php
array(
'title' => __( 'Ticket', 'woocommerce' ),
'desc' => __( 'Endpoint for the "My account → ticket" page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_ticket_endpoint',
'type' => 'text',
'default' => 'ticket',
'desc_tip' => true,
),
add ticket code to woocommerce/includes/wc-account-functions.php
function wc_get_account_menu_items() {
$endpoints = array(
'ticket' => get_option( 'woocommerce_myaccount_ticket_endpoint', 'ticket' ),
);
$items = array(
'ticket' => __( 'Ticket', 'woocommerce' ),
);
add ticket code to woocommerce/includes/class-wc-query.php
'ticket' => get_option( 'woocommerce_myaccount_ticket_endpoint', 'ticket' ),
I don't want to update my woocommerce plugin, so there is no problem about playing with main plugin codes.