{if isset($newsletter) && $newsletter}
<div class="checkbox">
<label for="newsletter">
<input type="checkbox" name="newsletter" id="newsletter" value="1" checked="checked" autocomplete="off"/>
{l s='Sign up for our newsletter!'}</label>
{if array_key_exists('newsletter', $field_required)}
<sup> *</sup>
{/if}
</div>
{/if}
{if isset($optin) && $optin}
<div class="checkbox">
<label for="optin">
<input type="checkbox" name="optin" id="optin" value="1" checked="checked" autocomplete="off"/>
{l s='Receive special offers from our partners!'}</label>
{if array_key_exists('optin', $field_required)}
<sup> *</sup>
{/if}
</div>
{/if}
you can try to use this code.