View Decrypted String
view_decrypted_string decrypts a token produced by view_encrypted_string.
Use this on pages that receive encrypted URL values (for example invoice/order routes) and need the original plain value.
See also:
Parameters
string
Required. Encrypted token to decrypt (commonly from a URL segment).
If string is empty, the tag returns an empty string.
string="{segment_3}"
key
Optional decryption key.
If a custom key was used during encryption, the same key must be used here.
key="10asl15bajkls8bb"
Output
Returns the decrypted plain value by applying:
base64_decode(string)rawurldecode(...)Encrypt::decode(decoded, key)
Behavior and Constraints
stringis required for decryption; empty input returns empty output.- Input is expected to be the URL-safe token from
view_encrypted_string. - If a custom key is used, encryption/decryption keys must match.
- Decryption result is returned directly from the encryption service decode call.
Examples
Basic usage with a known encrypted value:
{exp:cartthrob:view_decrypted_string string="ZE83M2FBVndWanhSVitkRWxsckNBbko1Qm81Rzh0RUpnNE1hUG1Qak14STlZY20wSy9OdHhUQ1QwYVhhNG1RSm5ZYkVCL2l3MGQ3SFBJV3l1MHdhQWc9PQ%3D%3D" key="10asl15bajkls8bb"}
Invoice page pattern from installer templates:
{if "{exp:cartthrob:view_decrypted_string string='{segment_3}' parse_inward='yes'}" != ""}
{embed="store/_invoice" entry_id="{exp:cartthrob:view_decrypted_string string='{segment_3}' parse_inward='yes'}"}
{/if}
Twig pattern from installer templates:
{% set decrypted_string = exp.cartthrob.view_decrypted_string({string:segment_3}) %}