Support » Plugin: Quotes for WooCommerce » More product details in email template

  • Resolved didymos234

    (@didymos234)


    I’m trying to edit the request-new-quote.php email template. Everything looks pretty straight forward, but I don’t know how can i display the category and product link for every single product in the table? Could you help me with this please?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Pinal Shah

    (@pinalshah)

    Hi @didymos234,

    The email templates can be customized the same as any of the WooCommerce email templates.

    Please copy the email template using the WooCommerce->Settings->Emails->Request for New Quote->Copy file to theme button into your theme folder. Once done, you can customize the email template as desired.

    Updating the plugin to future versions will ensure that the customized copy is not overwritten.

    <td style="text-align:left; border: 1px solid #eee;"><?php echo wp_kses_post( $items->get_name() ); ?></td> is the line which displays the Product Name in the request-new-quote.php file. You can add the data that you wish to add to this column and it should be displayed fine.

    I hope this helps.

    Pinal

    Hello Pinal, thank you very much for your reply.

    I know that this line is displaying the product name. How can a make the product’s name – a clickable link to this product?

    Plugin Author Pinal Shah

    (@pinalshah)

    Hi @didymos234,

    You can make it clickable by wrapping it in a <a> tag. Something like:

    <td style="text-align:left; border: 1px solid #eee;"><?php echo wp_kses_post( '<a href="<link to which it needs to redirect to>" target="_blank">$items->get_name()</a>' ); ?></td>

    Please note that this is untested code. Request you to kindly check on a dev/staging site first.

    Pinal

    • This reply was modified 4 months, 2 weeks ago by Pinal Shah.

    Sure, thank you. I was asking for your help about this code: href=”<link to which it needs to redirect to>”

    what’s the function to get the URL so I could put it instead the <link to…> part?

    Plugin Author Pinal Shah

    (@pinalshah)

    Hi @didymos234 ,

    get_permalink( $product_id ) will return the link of the product. Since we’re looping through the items in the order, the product id needs to be picked up from the item object.

    So, $product_id can be found as:

    $product_id = $items->get_product_id();
    $product_link = get_permalink( $product_id );

    I hope this helps.

    Pinal

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