• Resolved kreativamarketing

    (@kreativamarketing)


    Hello,

    I’m editing the email template customer-completed-order.php so I can add a text with a link to the product page. So, if a client buys product ‘Example’, when they receive the email saying their order is complete, a small text with a link to product Example will appear alongside the default text, which will take the user to the product page so they can leave a review.

    But I can’t manage to make the link to the product page work. This is the code I have so far:

    <p><?php 
    $product_obj = new WC_Product( $product["product_id"] );
    $link = $product_obj->get_permalink();
    echo '<strong>'.'No olvides dejar tu valoración - sirve de guía para que otros usuarios puedan decidir si realizar un pedido a este blog.<br/>'.'</strong>'.'<a href="'.$link.'">'.'Deja tu valoracion'.'</a>'; ?></p>

    When I use that code, it generates a link like this:
    https://prueba.hellopubli.com/?post_type=shop_order&p=1709

    I’ve tried different ways of doing it, but they all get me the same link.

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

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get product link’ is closed to new replies.