LemonStand Documentation

Cms_VisitorPreferences

The Cms_VisitorPreferences is a multi-purpose class which allows to save visitor preferences into the server session storage and load them when it is needed. Please remember that the values saved using this class are stored in the session object, and not bound to a specific customer. The server distinguishes visitors using cookies, so visitor preferences should be considered as temporary. This data storing method is reliable during a visitor browsing session, but you should not rely on it for storing important or sensitive data. Use this class for storing non critical data, for example preferred product sorting modes.

Class methods

  • set($parameter_name, $value) - saves a value to the session. The $parameter_value parameter should be a string identifying the saving value. The $value parameter could be any value - a string, number or array. 
  • get($parameter_name[, $default = null]) - returns a value, previously saved to the session. The $parameter_value parameter should be a string identifying the saved value. You can specify a default value in the second parameter. This value will be used in case if the value with the specified name doesn't exist in the session. By default the default value is NULL.

Next: shop:payment_receipt
Previous: Phpr_Response
Return to Reference