-1

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,

closed as off-topic by TheDeadMedic, Robert hue, Howdy_McGee, Brad Dalton, Pieter Goosen Jun 7 '15 at 6:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1
<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.

  • Thanks for the response, I'm copied the file: /woocommerce-pre-orders/templates/myaccount/my-pre-orders.php to my child theme with the same structure and edited the piece of code you put here. But it doesn't change a thing.. Do i need to put a piece of code in functions.php to read the custom code? – Darren Jun 3 '15 at 10:25
  • Did you check permalinks setting on Dashboard? – Syed Jun 3 '15 at 10:27
  • Also make sure, your template is being overridden properly, by visiting Dashboard -> WooCommerce -> System Settings -> Templates Section if not, than you need to rename the folder used for Pre Orders templates. – Syed Jun 3 '15 at 10:35
  • The thing is it's a seperate plugin called: woocommerce-pre-orders so it's not inside the woocommerce folder – Darren Jun 3 '15 at 10:40
  • What I mean't was by default for most extensions files goes into "woocommerce" folder inside themes, but some plugins / extensions might require different path than "woocommerce" folder. To make sure, Dashboard -> WooCommerce -> System Settings -> Templates and it will show you if relevant template is overridden or not. If not than you are using incorrect path. To test the code, you can just put it directly in plugins template for testing purposes whether it works or not. Than you can make sure you are overriding templates properly or not. – Syed Jun 3 '15 at 10:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.