Jump to content

Adding product link to customers completed email


mg3ddesign

Recommended Posts

Hi There

I have recently added the product names through the macros to the completed email. I would like to add the product link so that customers can link back to leave reviews on those products.

I can not find the corect macro to link the products. Does anyone know what that macro is?

Thanks

Link to comment
Share on other sites

Once I was shown what to do it seemed to easy, they are not really Macro's so it was just a case of having the correct search code. I did this and it all works great:


<table border="0" cellpadding="3" cellspacing="0" width="100%">

<tbody>

  <tr>

   <td>

    <p>

	 <strong>Items to review</strong></p>

   </td>

  </tr>

  <!--{foreach from=$PRODUCTS item=product}-->

  <tr>

   <td>

    <a href="http://yourshop.com/index.php?_a=product&amp;product_id={$product.product_id}">{$product.name}</a></td>

  </tr>

  <!--{/foreach}-->

</tbody>

</table>

Link to comment
Share on other sites

It didn't work for me. I thought it might be product&amp;product_id causing the problem and changed it to product.product_id, then product&product_id, but those didn't work, either.

But I really wanted the name of at least one item in the subject, so it wouldn't end up in their spam folder. I added a link to subscribe to our newsletter and gave a shipping time reference that most probably never see.

I have this as the Subject of the Order Confirmed email:

Order Complete {foreach from=$PRODUCTS item=product} {/foreach} {$product.name}

But there's no code to connect the order number to the product name.

Link to comment
Share on other sites

  • 4 months later...

I'm revisiting this since upgrading to 5.1.1. I still haven't figured out how to get the link to review the items they bought to properly show in the Order Complete email they receive. I added


'{$product.name}'   => $lang['email']['macro_product_name'],

'{$product.product_code}' => $lang['email']['macro_product_code'],





to the Macros in documents.include.inc.php, but I still can't get these to show in the email. I've played around with where to put the /foreach section, so hopefully that's what I've done wrong, and it will be an easy fix for someone to suggest.



I currently have this Source Code:



<table border="0" cellpadding="3" cellspacing="0" width="100%">

<tbody>

  <tr>

   <td>

	<p>

	 <strong>Items to review</strong></p>

   </td>

  </tr>

  <tr>

   <td>

	<p>

	 {foreach from=$PRODUCTS item=product} {/foreach}</p>

	<a href="http://dirtybutter.com/plushcatalog/index.php?_a=product&amp;product_code={$product.product_code}">{$product.name}</a></td>

  </tr>

</tbody>

</table>

Link to comment
Share on other sites

Let's get the programming flow control logic straight:

<p>{foreach from=$PRODUCTS item=product} {/foreach}</p>

<a href="http://dirtybutter.com/plushcatalog/index.php?_a=product&amp;product_code={$product.product_code}">{$product.name}</a>




[Mostly] In programming languages, a foreach loop executes things inside it and any looping variables may or may not be available outside the loop. The code above has a loop, but nothing inside it.



Try:


{foreach from=$PRODUCTS item=product}

<p><a href="http://dirtybutter.com/plushcatalog/index.php?_a=product&amp;product_code={$product.product_code}">{$product.name}</a></p>

{/foreach}

This way, $product is within the scope of the loop and what is between the loop boundaries gets executed the loop number of times.

Link to comment
Share on other sites

Thanks! That makes sense. So now it looks like this:


<table border="0" cellpadding="3" cellspacing="0" width="100%">

<tbody>

  <tr>

   <td>

    <p>

	 <strong>Items to review</strong></p>

   </td>

  </tr>

  <tr>

   <td>

    {foreach from=$PRODUCTS item=product}

    <p>

	 <a href="http://dirtybutter.com/plushcatalog/index.php?_a=product&amp;product_code={$product.product_code}">{$product.name}</a> {/foreach}</p>

   </td>

  </tr>

</tbody>

</table>

Rebuilt all choices on Maintenance, but still doesn't show on email.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...