This blog promotes knowledge sharing through experience and collaboration. For more product information, visit our WebSphere Commerce CSE page. For easier navigation, utilize the Categories to find posts that match your interest.
Store Preview: Troubleshooting Basics
Store preview is used to review changes that were made in workspaces or to future promotions, prior to committing them into the base schema or propagating them into production. You may be a system administrator or developer who needs to understand more about what fundamental components are involved in using store preview in Websphere Commerce, to help configure your system to be able to use preview correctly. Since this is a basic summary article, I will not go into details on how more advanced preview functions, like generate url, or 'save and preview' functions work, but these advanced functions are still built on the same basic principles mentioned in this article.
How does it work?
Store preview displays data to business users that is not currently available on the site, whether it is catalog changes that were made in a workspace, or future promotions that are not currently active. In order to do this, a series of markers needs to be created. In store preview, we use a specific context root, port number, and a separate set of cookies to display this altered version of the storefront. Once these three components are created, the preview requests are forwarded to the jsps in Stores.war. This creates a storefront that looks very similar to the currently active store, as though it was viewed using the preview parameters.
Store Preview URL
The store preview uses a different URL to access the store than a normal storefront request. Here is a normal storefront url:
And it's store preview equivalent:
As you can see, there are three fundamentally different parts of these urls. First of all, the preview request is handled over SSL, which is a requirement of store preview to ensure a secure connection. Secondly, the store preview accesses the Appserver using port 8006, which is the defined preview port in wc-server.xml. Finally, store preview uses a different context root, to identify that it is accessing a different web module than a normal storefront request.
Store Preview Cookies
The store preview cookies are used to store context information, with some additions that are used specifically for store preview. Since most of the information is the same as the storefront cookies, store preview cookies use the same names as the regular storefront cookies, but are prefixed by WCP_, rather than the standard WC_. For example, on the regular storefront you would have the WC_GENERIC_ACTIVITYDATA. The store preview equivalent of this cookie is WCP_GENERIC_ACTIVITYDATA. For more information on Websphere Commerce cookies, you can review Websphere Commerce documentation here:
Based on this information, we are able to see the fundamental differences between the store preview requests and normal storefront requests. If you are working with a preview problem, you can check for the cookies and url information, to ensure that your store preview is created correctly, and is displaying a preview version of the storefront. You can also use this information to customize and adjust store preview to fit your business needs.