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 » ProductCart and jQuery
ProductCart and jQuery
Overview
ProductCart leverages the popular jQuery JavaScript library (http://jquery.com/) to perform client-side tasks such as displaying information in a modal window, handling the user experience on One Page Checkout, and more.
How it is loaded
jQuery is loaded in the ProductCart storefront as follows:
- the file ”header.asp” in the pc folder includes ”inc_header.asp”
- the file ”inc_header” includes ”inc_jquery.asp”
- ”inc_jquery.asp” loads the CSS and JavaScript as follows (as of January, 2011)
<!--INCLUDE JQUERY - START -->
<%
private const scJQuery="1"
%>
<link type="text/css" href="../includes/jquery/themes/redmond/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<%
user_agent = request.servervariables("HTTP_USER_AGENT")
if Instr(ucase(user_agent),"CHROME")>0 then
%>
<link type="text/css" rel="stylesheet" href="onepagecheckout.css" />
<link type="text/css" rel="stylesheet" href="onepagecheckoutGoogle.css" />
<% else %>
<link type="text/css" rel="stylesheet" href="onepagecheckout.css" />
<% end if %>
<script type="text/javascript" src="../includes/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../includes/jquery/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="../includes/jquery/jquery.validate.min.OPC.js"></script>
<script type="text/javascript" src="../includes/jquery/jquery.bgiframe.pack.js"></script>
<script type="text/javascript" src="../includes/jquery/jquery.form.js"></script>
<!--INCLUDE JQUERY - END -->
Potential conflicts
If you load jQuery independently of ProductCart (e.g. you load it in header.asp as part of your Web site interface), there could be some conflicts that result in JavaScript errors.
For example, some customers have reported problems on One Page Checkout (cannot move passed Billing panel).
We strongly recommend that you do not load 2 instances of jQuery. You should be able to safely remove the additional include statements in your Web site design and just rely on the fact that ProductCart loads jQuery already.
Related Articles
Trace: • BTO Tips: Taking advantage of hidden categories • BTO Tips: using CSS to style the BTO configuration pages • Increasing the maximum number of products in the cart array • Understanding How Categories Are Displayed • Creating custom Store Map page that uses your store's true (dynamic) header and footer • Database Structure - How Build To Order Prices are stored • When E-mails are Sent and How • Finding the Location of a Text String in the Source Code • Successfully adding a Flash animation to the product description • ProductCart and jQuery