Jump to content

Resolved - Trusted Shops - Seller Rating Button Added to email


fantastichearts

Recommended Posts

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}

$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>

Link to comment
Share on other sites

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.

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...