Support » Plugin: WooCommerce » Remove Product Link in Order Emails to prevent confusion

  • Resolved someka

    (@someka)


    This question has been asked a few times before but still there is not a good answer.

    This OP has explained the situation very well here:
    https://wordpress.org/support/topic/remove-product-link-in-completed-order-emails/

    In summary: both product link and download link are confusing to the user (we receive lots of complaints about not being able to download because they click on the wrong link)

    At the moment, I go here:
    woocommerce/templates/emails/email-downloads.php (active)
    And delete this part:
    <a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"></a>
    (leaving the name in between a tags)

    But there should be an easy filter/hook/whatever to remove this (or re-echo the line?) I am not a developer, so cannot find the solution.

    Any help will be appreciated

    • This topic was modified 9 months ago by someka. Reason: formatting
    • This topic was modified 9 months ago by someka.
    • This topic was modified 9 months ago by someka.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    At the moment there’s no acciont hook/filter for that specifically although you can override the template as a whole in a custom child theme. To do that, you’ll want to make use of the following resources:

    If you’re getting stuck on the code required, we recommend getting in touch with a web developer or one of the customisation experts listed at https://woocommerce.com/customizations/.

    Thread Starter someka

    (@someka)

    Ok thank you for the explanation.
    At least it is clear now that we don’t have a hook for that section.
    And overriding the whole template just for this minor thing is an overkill.
    So I will try to think some other solutions. (maybe I continue to edit the original template after each update until you guys publish a hook for that 🙂 )

    • This reply was modified 8 months, 3 weeks ago by someka.

    No simple fix yet? Overriding templet is the only way?

    Thread Starter someka

    (@someka)

    @biologix I went ahead and modified the Woocommerce delivery emails. And removed the product from the table.
    Now our emails look like this:

    Just fyi..

    How did you achieve this? I would still like to keep the table and remove the product name hyperlink so if someone buying multiple downloadable products then they are all properly visible in the table view.

    Thread Starter someka

    (@someka)

    Hello,

    We have simply edited the HTML of Woocommerce default Email template for “Completed Orders”

    It is easy to edit. There is already a button to copy the template into your own theme. You copy and make your own changes.

    Hope that helps!

    • This reply was modified 3 months, 1 week ago by someka.

    Here is the solution that I just implemented.

    You can do this quite easily by copying the email-downloads.php template to yourtheme/woocommerce/emails/email-downloads.php, and changing this line:

    Replace line 44
    <a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo wp_kses_post( $download['product_name'] ); ?></a>

    to this one

    <?php echo wp_kses_post( $download['product_name'] ); ?>

    It keeps the download table as is and removes the product title hyperlink.

    • This reply was modified 3 months, 1 week ago by biologix.
    • This reply was modified 3 months, 1 week ago by biologix.
    • This reply was modified 3 months, 1 week ago by biologix.
    • This reply was modified 3 months, 1 week ago by biologix.

    @someka If you could tell what lines of code did you exactly remove it would really help me.

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @shreyas68,

    Looking at the most recent reply from @biologix they referenced the email template fils and also the lines of code they changed within that. I’d suggest following those steps to perform this customisation.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.