The {IF-WISH-LIST-BEGIN} QuickCode Tag may be used in combination with the {IF-WISH-LIST-END} QuickCode Tag within any storefront template to show or hide content based on whether or not a wish list is available for the current shopping session.
A wish list may be available for the current shopping session if either of the following conditions are true:
the website visitor has entered the public access code corresponding to a public wish list
the website visitor is logged into a customer account which has at least one wish list
Content between {IF-WISH-LIST-BEGIN} and {IF-WISH-LIST-END} will be displayed either of the above conditions are true, or hidden if both of the above conditions are false.
If the {ELSE} QuickCode Tag is inserted between {IF-WISH-LIST-BEGIN} and {IF-WISH-LIST-END}, then content between {IF-WISH-LIST-BEGIN} and {ELSE} will be shown if either of the relevant conditions are true, and content between {ELSE} and {IF-WISH-LIST-END} will be shown if both of the relevant conditions are false.
Requirements / Prerequisites
The {IF-WISH-LIST-BEGIN} QuickCode Tag must be used in combination with the {IF-WISH-LIST-END} QuickCode Tag.
The {ELSE} QuickCode Tag may optionally be used between {IF-WISH-LIST-BEGIN} and {IF-WISH-LIST-END}.
It is recommended to always place any content related to wish lists between the {IF-USING-WISH-LISTS-BEGIN} and {IF-USING-WISH-LISTS-END} QuickCode Tags, so that the content will be shown when the store's Wish List Module is enabled, but hidden if the store's Wish List Module is disabled.
Example of Use
Add the following code to a storefront template:
Example Welcome to my store!<br />
<!-- Show the content between IF-USING-WISH-LISTS-BEGIN and IF-USING-WISH-LISTS-END only if the store's Wish List Module is enabled. --> {IF-USING-WISH-LISTS-BEGIN}
<!-- Show the content between IF-CUSTOMER-LOGGED-IN-BEGIN and ELSE only if a customer is currently logged in. --> {IF-CUSTOMER-LOGGED-IN-BEGIN}
<!-- Show the content between IF-WISH-LIST-BEGIN and ELSE only if the customer already has a wish list. --> {IF-WISH-LIST-BEGIN}
<a href="{URL-STORE-HOME}wish_list.php">Click here to view or edit wish lists.</a><br /> <!-- Show the content between ELSE and IF-WISH-LIST-END only if the customer does not yet have a wish list. --> {ELSE}
You do not yet have a wish list. Complete the form below to create a new wish list now...<br /> <form action="{THIS-PAGE}" method="post" name="new_wish_list_form"> Wish list name: {FIELD-WISH-LIST-NAME}<br /> Is this wish list public?: {FIELD-WISH-LIST-IS-PUBLIC}<br /> <input class="SUBMIT-BUTTON" name="submit_new_wish_list" type="submit" value="Create this Wish List" /> </form> <br />
<!-- End of content to show/hide based on whether the customer has a wish list. --> {IF-WISH-LIST-END} <!-- Show the content between ELSE and IF-CUSTOMER-LOGGED-IN-END only if a customer is not currently logged in. --> {ELSE}
<a href="{URL-STORE-HOME}customer_login.php">Login</a> or <a href="{URL-STORE-HOME}customer_register.php">create an account</a> to create and edit wish lists.<br />
<!-- End of content to show/hide based on whether the store's Wish List Module is enabled. --> {IF-USING-WISH-LISTS-END}
Thanks for shopping, please come again soon...
If the store's Wish List Module is not enabled, the corresponding storefront page would display the following:
Example Welcome to my store!
Thanks for shopping, please come again soon...
If the store's Wish List Module is enabled, and a customer is currently logged in, and the customer has a wish list -OR- has entered the public access code of a specific public wish list, the following would display:
Example Welcome to my store! Click here to view or edit wish lists.
Thanks for shopping, please come again soon...
If the store's Wish List Module is enabled, and a customer is currently logged in, but the customer does not have a wish list -AND- has not entered the public access code of a specific public wish list, the following would display:
Example Welcome to my store!
You do not yet have a wish list. Complete the form below to create a new wish list now...
Wish list name:
Is this wish list public?:
Thanks for shopping, please come again soon...
If the store's Wish List Module is enabled, but a customer is not logged in, the following would display:
Example Welcome to my store! Login or create an account to create and edit wish lists.
Thanks for shopping, please come again soon...
Source Code
Source Code Updated:
When a web page using a template that contains this QuickCode Tag is viewed in the storefront, the {IF-WISH-LIST-BEGIN} QuickCode Tag is changed into the source code below prior to the web page being displayed.