Announcement:Materials and articles for ProductCart 5 can be found at our brand new support center.

Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!

Guidelines for Editing ProductCart's ASP Source Code

Overview

ProductCart is written in ASP (Active Server Pages), one of the most popular and easiest to learn programming languages for Web applications. Since the ASP source code is not compiled, ProductCart can be fully customized. The ASP source code is provided to you when you purchase a ProductCart license and can be accessed and edited with any HTML editor (or even Notepad!). The ASP language used within ProductCart is VBScript. There are lots of resources on the web and in books to help in learning VBScript including : http://www.w3schools.com/Vbscript/default.asp

Recommendations

You should document the code changes as much as possible in order to maintain a clear picture of what has been changed, why, and where. This will also help you integrate the changes with new ProductCart source code when you decide to update the store to a new version of ProductCart. For all but the simplest changes you should create a test copy of the page/code you wish to modify.

  1. File List
    Maintain a list of files that have been changed, with comments on why they were changed. You could do so in a simple spreadsheet.
  2. Back Up
    Always back-up the original ProductCart files before changing the source code.
  3. File Changes Summary
    Inside any file that you modify, add some comments at the top of the ASP code indicating what was modified. Among the comments, add a “tag” such as “COMPANY XYZ EDIT” that you can always use in a global “Find” to quickly gather a list of all edited files.
  4. Code Block Comments
    If you are adding (or substantially modifying) an entire block of code, add a “COMPANY XYZ EDITS - START” at the beginning and “COMPANY XYZ EDITS - END” at the end of the code. Add additional comments describing what the edited code does.
  5. Line Item Comments
    If you are editing specific lines (e.g. adding fields to an existing SQL query), add comments at the end of the line indicating why it was edited.
  6. Database Changes
    If your customizations require changes to the database, we recommend that you always add new Tables and/or Fields to accommodate your customizations, rather than use default (existing) Fields (so that your changes will never interfere with or be affected by updates to ProductCart).

For the non-programmers: in ASP, you can add a comment to the code by simply placing an apostrophe at any point in a line: what's on the right of the apostrophe will be ignored when the page is parsed by the server. If you place it at the beginning of a line, the entire line is “commented out”.

Test Copies

For all but the simplest of changes it's recommended that, as well as backing up the original, you first work on a copy of the page. This allows you to try things out with minimal or no impact on the live site. For example, if you want to try a new header.asp you could :-

  1. Save the new copy of header.asp as testheader.asp
  2. Take a copy of viewprd.asp and call it testviewprd.asp and amend the include statement within it to point to testheader.asp.

To try out your new version of the page you can go to the original version of the page on your website and then edit the url in the browser address bar to your test version. Once you are happy with the changes you can either update your live pages or rename the test pages as appropriate. Don't forget to follow the recommendations and it's best to delete any test files once you have finished so as not to cause any confusion when you or someone else comes across you test files years later!

Challenges

Please note the following before you decide to customize ProductCart's source code:

Technical support

ProductCart does not provide technical support on modifications made to the ProductCart source code. It would be impossible for ProductCart to support all ProductCart users in their custom programming efforts. Therefore, ProductCart's technical support policy indicates that support is limited to ProductCart's existing features and functionality.

More difficult updates

When you update your installation of ProductCart to a newer version, files that you have modified might be overwritten by files that have been updated by ProductCart. Unfortunately there is no way around this issue. It's the trade-off between having access to the source code and modify it, and having to spend a bit more time to update ProductCart when an update is available.

File comparisons and synchronizations

Following the recommendations above can help you greatly reduce the time it takes to update the customized code. However, you will always have to budget additional time (and cost if it's someone else doing the update). That's because you will have to review and synchronize any code changes that affect what you had customized.

Making small changes and finding your way around the ASP files

If you find that you need to make changes that are minor then understanding how to find what you are looking for in the code is important. For small changes, the following points should help you find the element you are looking to amend.

  • Most of the text that is not related to a specific product/category on customer facing pages is held in the includes/languages.asp file and referred to in the code by it's variable name. There are several other language files in the same directory which are also referenced.
  • The url of the page points to the file which is used to dynamically build that page.
    • Each page is built up from that file, using a mixture of “includes” of other files.
    • Most pages are a mixture of VBScript, HTML, SQL and Javascript.

To find the point in the source code you are interested in amending, it's often useful to look at the web page in a browser and also to “view source” from the browser. You can then examine the actual asp source code to gain an understanding of how the page is structured. The variables from the includes/languages.asp file can be a useful “cross-reference” to assist in understanding where you are in the code in relation to the displayed page.

There are lots of tools that allow you to search through all the source code files in directories and sub-directories to find which files contain strings you are searching for. Among these applications:

Hiring a developer

If you don't have access to ASP programming skills on your staff, and you still need to customize ProductCart, we encourage you to contact a Certified ProductCart Developer for a quote. We recommend that you:

  1. Write a spec
    Take a few minutes to write a specification document for what you are trying to accomplish. The document should be short and to-the-point, but should also leave no room for misunderstandings on what you need. It should include:
    1. Objective: a short description of what you need
    2. Issue: a description of what's missing in ProductCart, relative to your needs
    3. Budget: it's better to be up front with what your budget is
    4. Deadline: clarify how quickly you need the changes done
  2. Multiple quotes
    Contact more than one company and provide the same specification document to all of them. You need to make sure that when you get multiple quotes, you are not comparing apples to oranges.

QR Code
QR Code Guidelines for Editing ProductCart's ASP Source Code (generated for current page)