fantastichearts Posted November 13, 2012 Share Posted November 13, 2012 I am trying to add the seller rating button into my emails send from the store. I have been sent this so I want to do it the second method as as adding PHP to template files is not good. but not sure where to add and as suggested to identify your template controller script to assign two more variables to your smarty object $smarty->assign('ts_email', urlencode(base64_encode($billing['email']))); $smarty->assign('ts_order_id', urlencode(base64_encode($data['cart_order_id']))); Which I am assumming should be: $GLOBALS['smarty']->assign('ts_email', urlencode(base64_encode($billing['email']))); $GLOBALS['smarty']->assign('ts_order_id', urlencode(base64_encode($data['cart_order_id']))); Any help appreciated as I am sure someone must of done it before. ______________________________________________________________ 1. I assume your email template is using smarty because of the variable notation {$BILLING.email} inside your code snippet. Inside a smarty template you should use a slightly different way to embed PHP functionality http://www.smarty.net/docsv2/en/language.function.php.tpl): {php} $baselink = '<a href="https://www.trustedshops.co.uk/buyerrating/rate_XD42E98E62EFDDF2A58E43A48DE7826F2.html&'; $billingArray = $this->get_template_vars('BILLING'); $ts_email = urlencode(base64_encode($billingArray['email'])); $dataArray = $this->get_template_vars('DATA'); $ts_order_id = urlencode(base64_encode($dataArray['cart_order_id'])); echo $baselink . 'buyerEmail=' . $ts_email . '&shopOrderID=' . $ts_order_id . '"> target="_blank" title="Submit Buyer rating"><img alt="Submit Buyer rating" src="images/source/SiteImages/bewerten_en.gif" /></a></p>'; {/php} 2. Please be aware that using PHP inside smarty is not the pure teaching of smarty. Sometimes systems are configured to actually not allow the {php}-tag. The more sophisticated approach would be to identify your template controller script to assign two more variables to your smarty object, e.g.: $smarty->assign('ts_email', urlencode(base64_encode($billing['email']))); $smarty->assign('ts_order_id', urlencode(base64_encode($data['cart_order_id']))); and output them inside your template: <a href="https://www.trustedshops.co.uk/buyerrating/rate_XD42E98E62EFDDF2A58E43A48DE7826F2.html&buyerEmail={$ts_email}&shopOrderID={$ts_order_id}" target="_blank" title="Submit Buyer rating"><img alt="Submit Buyer rating" src="images/source/SiteImages/bewerten_en.gif" /></a></p> Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 13, 2012 Share Posted November 13, 2012 Let's choose the Order Complete email for this experiment. In admin, go to the Email Templates section. On that screen, click the flag that represents the language of the Cart: Order Complete template we will edit. On the HTML Content tab, locate where you want to have an image and click the Image button on the editor toolbar. Locate the image, add the alt text, and click OK. Highlight the image icon and then click the Link button on the editor toolbar. Select https as the protocol and enter the URL as given, starting with the www part. Substitute {$DATA.email|base64_encode|urlencode} for the given {$ts_email} and {$DATA.cart_order_id|base64_encode|urlencode} for the given {$ts_order_id}. Click OK. Do the same on the Plain Text tab, only you will need to enter the web address, with the image tag wrapped inside, manually. Click Save. Mark an order as complete and examine the email sent. Quote Link to comment Share on other sites More sharing options...
fantastichearts Posted November 13, 2012 Author Share Posted November 13, 2012 :yeahhh: That worked. Thank you so much....it is so simple when you know how!!! 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.