Customer Tags

From Shopp Documentation

Jump to: navigation, search

The customer shopp() tags are used to handle the customer account login and profile management pseudo-pages. The customer account login layout is provided by the login.php template file. It is important to realize that Shopp supports 3 distinct setups for customer order and account management:

  • No accounts - Orders are able to be accessed by correctly providing the order number and email address associated with the order. Order lookup only. No other management capability is available.
  • Shopp accounts - A full account system separate from WordPress with all of the account management support provided when the account is correctly authenticated and logged in.
  • WordPress-integrated accounts - Shopp accounts are tied to WordPress users and information is shared/updated across both systems. Full account management support is available when logged in through Shopp pages or through the WordPress login systems.

Once logged in, the customer will access to the customer account management system which consists of several sub-screens:

  • Account Management Menu - a list of links to the account management sub-pages.
  • My Account - a form to update account profile information such as the customer's name, email address or to change their account password.
  • Downloads - provides a list of all digital goods purchased with links to download them
  • Order History - a list of all the past order receipts
  • Order Status - a list of all the recent order receipts for orders placed within the past 2 weeks
  • Logout - logs the customer out of the store

Contents

Utility Tags

url

Overview

<?php shopp('customer','url'); ?>

Provides the link to the account page (seen as the "Your Orders" page in the default installation)

Options

  • None

process

Overview

<?php shopp('customer','process'); ?>

Shows the current account management sub-page name.

Options

  • None

accounts

Overview

<?php shopp('customer','accounts'); ?>

Shows the account system setting as specified under ShoppSettingsCheckout

Options

  • None

order-lookup

Overview

<?php shopp('customer','order-lookup'); ?>

Shows the order lookup user interface screen.

Options

  • None


Login Fields

loggedin

Overview

<?php if(shopp('customer','loggedin')) {} ?>

Evaluates to either true or false to represent whether the shopper has yet logged in.

Options

  • None

Examples

<?php if(shopp('customer','loggedin')): ?>
	<p>Welcome back!</p>
<?php endif; ?>

notloggedin

Overview

<?php if(shopp('customer','notloggedin')) {} ?>

Evaluates to either true or false to represent whether the shopper has not logged in.

Options

  • None

Examples

<?php if(shopp('customer','notloggedin')): ?>
	<p>Who are you?</p>
<?php endif; ?>

account-login

Overview

<?php shopp('customer','account-login'); ?>

Renders a text field used to take a login (email or login name) for identifying the account of the user during the login process.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

loginname-login

Overview
DEPRECATED: Replaced by shopp('customer','account-login')

<?php shopp('customer','loginname-login'); ?>

Renders a text field used to take a login name (username) for identifying the account of the user during the login process.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

email-login

Overview
DEPRECATED: Replaced by shopp('customer','account-login')

<?php shopp('customer','email-login'); ?>

Renders a text field used to take an e-mail address for identifying the account of the user during the login process.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

password-login

Overview

<?php shopp('customer','password-login'); ?>

Renders a password field used to take the password for authenticating the credentials of a user during the login process.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

login-button

Overview

<?php shopp('customer','login-button'); ?>

Displays a button for submitting the login fields (loginname-login, email-login and password-login) for processing the user's credentials and logging them in. A successful login sends the user to the account management menu page. Any errors that occur during the login attempt will show the login page again with any login errors that occurred using the login-errors tag.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

login-errors

Overview

<?php shopp('customer','login-errors'); ?>

Displays any error messages that occurred during the login attempt.

Options

  • None

login-label

Overview

<?php shopp('customer','login-label'); ?>

Displays 'Email Adress' or 'Login Name', depending on the type of account that has been set in the Shopp settings.

Options

  • label: Default is Email Address or Login Name, depending on the type of account that has been set in the Shopp settings. This option will override that.


Account Management Menu

menu

Overview

<?php while(shopp('customer','menu')) {} ?>

Loops through the account menu options.

Options

  • None

Examples

	<ul>
	<?php while(shopp('customer','menu')): ?>
		<li><a href="<?php shopp('customer','management','url'); ?>"><?php shopp('customer','management'); ?></a></li>
	<?php endwhile; ?>
	</ul>

management

Overview

<?php shopp('customer','management'); ?>

Shows the current account management menu item label.

Options

  • url: Displays the current account management menu item url instead of the label
  • action: Displays the current account management menu process key value

Account Profile

firstname

Overview

<?php shopp('customer','firstname'); ?>

Displays a text field for taking the first name of the customer.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

lastname

Overview

<?php shopp('customer','lastname'); ?>

Displays a text field for taking the last name of the customer.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

email

Overview

<?php shopp('customer','email'); ?>

Displays a text field for taking the first name of the customer.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

loginname

Overview

<?php shopp('customer','loginname'); ?>

Displays a text field for the login name the customer would like to use for their account. Only used when Shopp is set to use accounts integrated with WordPress logins in the Checkout Settings.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

password

Overview

<?php shopp('customer','password'); ?>

Displays a password field for the shopper to create a new password when creating a new account during checkout.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

confirm-password

Overview

<?php shopp('customer','confirm-password'); ?>

Displays a password field for the shopper to confirm that the password they entered in the password field matches to ensure they entered the password they wanted to enter correctly.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

phone

Overview

<?php shopp('customer','phone'); ?>

Displays a text field for the customer's phone number.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.

has-info

Overview

<?php while(shopp('customer','has-info')) {} ?>

Loops through each customer info property so that a custom layout can be specified within the looping block. This is similar to "The Loop" structure in WordPress for displaying a custom layout for WordPress posts.

Options

  • None

Examples

<?php while(shopp('customer','has-info')): ?>
	…content shown for a specific customer info property…
<?php endwhile; ?>

info

Overview

<?php shopp('customer','info','options…'); ?>

Used in the 'has-info' loop to show the individual customer info property.

Options

  • accesskey: Allows you to specify an HTML access key.
  • alt: Useful for providing alternative text for the element.
  • checked: Marks a checkbox field as checked causing it to display toggled on. Be mindful that some shopp() fields will have internal functionality that may override this setting.
  • class: Adds a CSS class to a field.
  • disabled: Disables the field from being changed by the user and prevents its value from being submitted with the form.
  • format:
  • minlength: Specifies a required minimum amount of information that must be entered in the field before the form will submit successfully. If the minimum is not met, an error is displayed that uses the value set for the title option as the description of the field.
  • maxlength: Limits the amount of characters that the user may enter on text and password type fields.
  • readonly: Prevents the user from changing the input or control, but the value is still submitted with the form.
  • required: A boolean value that forces the field to have a non-empty value before the form can be successfully submitted. If the value is left empty when the form is submitted an error message is displayed that uses the value specified in the title option as the description of the field.
  • size: Specifies the width of the field in pixels except when the field is a text or password field. For text and password fields, the value of size specifies the width in number of characters.
  • tabindex: Specifies the position of the element in the tabbing order for the current document.
  • title: Provides advisory information about the element.
  • value: Specifies the initial value for the element. Note that shopp() fields may override your setting in some circumstances.


Downloads

has-downloads

Overview

<?php while(shopp('customer','has-downloads')) {} ?>

Loops through each purchased download so that a custom layout can be specified within the looping block. This is similar to "The Loop" structure in WordPress for displaying a custom layout for WordPress posts.

Options

  • None

Examples

<?php while(shopp('customer','has-downloads')): ?>
	…content shown for a specific download…
<?php endwhile; ?>

download

Overview

<?php shopp('customer','download','options…'); ?>

Used in the 'has-download' loop to show an individual download. Uses the options argument to specify the property of the download to show

Options

  • id: The id of the download asset
  • url: The URL of the purchased download
  • purchase: The id of the order the download was purchased on
  • name: The name of the download file
  • variation: The label of the variation option chosen
  • downloads: The number of times the digital good has been downloaded
  • key: The download key used to access the digital good
  • total: The total cost of the digital good
  • filetype: The MIME-type of the digital good
  • size: The file size of the digital good (in the largest applicable unit)
  • created: The UNIX timestamp of the date the purchase for the digital good was made
  • date: The date of the purchase formatted using the format specified in the WordPress settings

Order History & Status

has-purchases

Overview

<?php if(shopp('customer','has-purchases')) {} ?>

Determines if there are orders for this customer.

Options

  • daysago: Specifies a limit to the orders retrieved based on the number of days from the present

Examples

<?php if(shopp('customer','has-purchases')): ?>
	…content shown if the customer has orders…
<?php endwhile; ?>

purchases

Overview

<?php while(shopp('customer','purchases')) {} ?>

Loops through each order so that a custom layout can be specified within the looping block. This is similar to "The Loop" structure in WordPress for displaying a custom layout for WordPress posts.

Options

  • None

Examples

<?php while(shopp('customer','purchases')): ?>
	…content shown for a specific order…
<?php endwhile; ?>

receipt

Overview

<?php shopp('customer','receipt); ?>

Shows the URL to view the receipt of the current order

Options

  • None