Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!
You are here: The ProductCart Encyclopedia » ProductCart Developers' Corner » Creating custom pages that use header.asp and footer.asp
Creating custom pages that use header.asp and footer.asp
Basic code
Let's say you wanted to create a page that does not rely on ProductCart' Content Pages feature, but still uses the same store interface defined by header.asp, footer.asp, and related files. How can you accomplish this? It's actually quite easy.
- Create a blank, ASP page in your favorite HTML editor
- Save it in the “pc” folder of your store (create a local directory structure on your desktop that mimics your online store)
- Open the file and paste the following code in it
<% response.Buffer=true %> <!--#include file="../includes/settings.asp"--> <!--#include file="../includes/storeconstants.asp"--> <!--#include file="../includes/opendb.asp"--> <!--#include file="../includes/languages.asp"--> <!--#include file="../includes/currencyformatinc.asp"--> <!--#include file="../includes/stringfunctions.asp"--> <!--#include file="pcStartSession.asp"--> <!--#include file="header.asp"--> <div id="pcMain"> </div> <!--#include file="footer.asp"-->
- Add to the page any HTML code you wish within the “pcMain” DIV
- Save the page with whichever name you wish to use for it (e.g. MyNewPage.asp) and upload it to the “pc” folder on your Web server.
Querying the store database
If you need to query the store database, use code that is structured as follows (here the query is just a simple placeholder for what your query will look like, of course).
<div id="pcMain">
<%
Dim rs, connTemp, query
call opendb()
query="SELECT * FROM Customers;"
set rs=server.CreateObject("ADODB.RecordSet")
set rs=connTemp.execute(query)
set rs=nothing
call closedb()
%>
</div>
Trace: • How to have the Order Comments box open by default on One Page Checkout • Setting the number of search results through a link • Adding and Editing Categories • Technical Articles • Saved Shopping Carts • Matrix View Discussion Page • Display Twitter Updates on your ProductCart Storefront • Adding "Welcome <Customer Name>!" message to your store's design • ProductCart Synchronizer - Installing Updates • Creating custom pages that use header.asp and footer.asp