Convert simpleCart email template placeholder "Agree" checkbox #order.agree# to the word YES

2 posts by 2 authors in: Forums > CMS Builder
Last Post: February 23, 2016   (RSS)

By Mikey - February 22, 2016

Anyone have any suggestions on how to convert simpleCart placeholder for the email template "Agree" checkbox #order.agree# to the word YES?

Presently the email template placeholder reads as:

Agreed to Terms & Conditions: #order.agree#

And produces a results of 1 on submit in the email message delivered:

Agreed to Terms & Conditions: 1

However I'd like for it to read as Yes on submit in the email message delivered:

Agreed to Terms & Conditions: Yes

Thanks for any tips and guidance,

Zicky

By gregThomas - February 23, 2016

Hey Zicky, 

You'll need to add a custom placeholder that adds Yes or No depending on if the user agreed. It would look something like this:

  if($order['agree']){
    $placeholders['order.agreed_text'] = 'Yes';
  }else{
    $placeholders['order.agreed_text'] = 'No';
  }

You'll need to add this code to the function _sc_getEmailPlaceholders. Then you can the placeholder to your email like this:

Agreed to Terms & Conditions: #order.agreed_text#

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com