• Resolved svtmontagna

    (@montino)


    I’m trying to insert a button on the “view order” page to redirect the user to a page on my site. As you can see in the screenshot, I tried to add this button with the a plugin, but I can only insert downloadable files and not URLs. I’m going crazy and can’t find a solution. Some advice?

    Screenshot: https://i.stack.imgur.com/uWAaJ.png

    I tried this code but just a label appears:

    add_action( 'woocommerce_order_details_after_order_table', 'custom_order_details_after_order_table', 10, 1 );
    function custom_order_details_after_order_table( $order ) {
    
        $user_link = get_post_meta( $order->id, '_user_link', true );
    
        echo '<p><a class="author-link" href="'. $user_link .'">'. __( 'User Link: ' ) . '</a><p>';
    
    }
    

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello

    As you can see in the screenshot, I tried to add this button with the a plugin, but I can only insert downloadable files and not URLs.

    I understand the button is not working as expected. Can you please clarify what plugin are you referring to?

    To clarify, is the button going to the payment gateway (As it says Paga subito), correct?

    To get a better idea of your site’s setup could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.?

    Thanks.

    Thread Starter svtmontagna

    (@montino)

    Hello,
    thanks for your answer. I’m referring to “Attach me!” plugin. The author of that plugin already told me that is not a feature that they will implement so I was trying to find another solution.

    To clarify, is the button going to the payment gateway (As it says Paga subito), correct

    Not really. I’m using woocommerce like a price quotation, so when a user order something is not buying anything and the payment is bypassed. When I have processed the quote, the user will give me a confirmation and pay via a paypal form within a page of my site (the page that that “Paga subito” button should open).

    Hi @montino

    Thank you for the clarification. I understand your request.

    As a simpler alternative to creating an action hook like you did, you can try adding your button directly to the “View Order” page template. You can find the template here:

    wp-content/plugins/woocommerce/templates/order/order-details.php

    Important: It is recommended to edit files in an upgrade-safe way using overrides. So, to override the “View Order” template, copy it to wp-content/themes/yourtheme/woocommerce/templates/order/order-details.php and edit there.

    Best,

    Thread Starter svtmontagna

    (@montino)

    Hello and thanks for your answer,
    I edited that plugin PHP and JS files to solve the problem. Thanks!

    Glad to hear that it’s all sorted out!

    Feel free to open a new topic if you have any other questions.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add a clickable button on my account view order page’ is closed to new replies.