Woocommerce Pre Orders view order link wrong

The link that the pre order module produces in My Account doesn't work. It has to display like this: /my-account/view-order/15977 but how it displays now is: /my-account/?order=15977. How can i change that link to my structure.

This is the piece of code which displays it:

            td class="order-number" width="1%"
                a href="?php echo esc_url( add_query_arg( 'order', $order-id, get_permalink( woocommerce_get_page_id( 'view_order' ) ) ) ); ?"?php echo $order-get_order_number(); ?/a
            /td

i also want it to be update proof ofcourse so how can i make a "child plugin".

thanks in advance,

Topic woocommerce-offtopic pre order Wordpress

Category Web


<td class="order-number" width="1%">
    <a href="<?php echo wc_get_endpoint_url( 'view-order', $order->id, wc_get_page_permalink( 'myaccount' ) ); ?>">
    <?php echo $order->get_order_number(); ?></a>
</td>;

this should solve your problem.

But I am not sure which template your are modifying, but fool proof way is only possible with child theme (functionality plugin will be complex for your needs).

https://support.woothemes.com/hc/en-us/articles/203105897-How-to-set-up-and-use-a-child-theme

http://docs.woothemes.com/document/template-structure/

both of these should help you get started with child theme.

Note: Make sure you permalinks are set to Pretty permalink not default under section

WP Admin -> Settings -> Permalink -> Go to section named "Product permalink base" and make sure of that.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.