mg3ddesign Posted February 20, 2012 Share Posted February 20, 2012 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 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 25, 2012 Share Posted February 25, 2012 This sounds like a great idea! At one time I found where to edit the Macro's, but I've forgotten what I did. What file has the macro's stored in it? Quote Link to comment Share on other sites More sharing options...
jdmdecals Posted February 25, 2012 Share Posted February 25, 2012 This is a great idea!!! Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted March 2, 2012 Author Share Posted March 2, 2012 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&product_id={$product.product_id}">{$product.name}</a></td> </tr> <!--{/foreach}--> </tbody> </table> Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 2, 2012 Share Posted March 2, 2012 It didn't work for me. I thought it might be product&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. Quote Link to comment Share on other sites More sharing options...
mg3ddesign Posted March 9, 2012 Author Share Posted March 9, 2012 Try the following <td><a href="http://{$STORE_URL}/index.php?_a=product&product_id={$product.product_id}>{$product.name}</a></td> Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 28, 2012 Share Posted July 28, 2012 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&product_code={$product.product_code}">{$product.name}</a></td> </tr> </tbody> </table> Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 28, 2012 Share Posted July 28, 2012 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&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&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. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 28, 2012 Share Posted July 28, 2012 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&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. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 29, 2012 Share Posted July 29, 2012 Notice the closing </p> tag still needs to go inside the foreach loop. And exactly what file are you editing? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 29, 2012 Share Posted July 29, 2012 That's fixed. I'm trying to get Review products links to work properly in the Cart:Order Complete email. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.