WP e-Commerce Visitor Profiles

/* * About WPEC customer profiles. * * WPEC customer profiles are nothing more than WordPress users created and used to hold information * related to a visitors experience on a WPEC site. Using WordPress users rather than a special purpose * database table makes all of the existing WordPress user functionality available when working with * customer profiles. * * Additionally, WordPress user functionality makes use of the built in caching capabilities within WordPress, * this makes user profile access quick. All of this comes without the costs of additional code to maintain. * * WPEC, themes and plug-ins can add information to a customer profile at any time. The functions making up the * API are in the wpsc-meta-customer.php. You’ll notice that the API for working with customer profiles mirrors * the WordPress API used to work with other types of meta data. Customer meta can be manipulated just as * you would manipulate user meta, post meta, or any of the other types of meta available with a WordPress site. * * There are a few specifics about customer profiles that you may want to be aware of, but you shouldn’t need * to know unless you are contributing to the WPEC meta functionality. * * Customer profile users when created are prefixed with ‘wpsc‘. Don’t rely on this when creating database queries * because other plug-ins, or even administrators, can change user names. * * If you properly use the WPEC meta API, any meta you add to a customer profile will be prefixed with a * standard, multi-site safe, prefix. This prefix is automatically removed when you retrieve meta values using * the WPEC meta API. * * Customer profiles have added to them a meta value ‘last_active’ immediately upon creation. This meta value * contains the UNIX timestamp (see PHP time() function) of the last meaningful change to the profile. * whatever end purposes you might want, but it’s core purposes are two-fold. (1) This value makes it possible to detect * abandoned carts and return cart stock, (2) and it makes it possible to detect temporary profiles that are no longer needed. * This value can also be used to implement advanced features like email reminders to customers that they have items in * their carts, or haven’t visited a store for a period of time. * * Customer profiles when created have added to them a role of Anonymous. This makes it possible to distinguish which users * are created from WPEC operations from the users that are created by typical WordPress blog actions and other plug-ins. * * Customer profiles when automatically created have added to them a wpsc meta value “temporary_profile”. The presence of this * value indicates a WordPress user that will likely be deleted if the visitor doesn’t take any future actions. * Because the above values (profile name, roles, etc.) can be altered by user interface or other plug-ins, having this * dedicated meta value gives us a safe and fast way of finding temporary profiles. * * If present, the value of the “temporary_profile” meta is automatically adjusted when the last_active time * is adjusted. The value will be the unix time stamp after which the profile can be marked for deletion. When * the meta is first added to the newly created user profile the “safe to delete time” is set to the current time * plus 2 hours. Using this method, visitor profiles that are created by mechanisms like aggregator framing web site pages * for user preview rather than browsing are more quickly deleted. * * Subsequent updates to last active move the safe to delete time to the last active time plus 48 * hours. This also means that customer profiles create for visitors that only do a single page view will * quickly be purged from the WordPress user table. On the other hand visitors that view more than a single * page of a site will have profiles available for a longer time. * */

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.