Guidelines for Editing ProductCart's ASP Source Code
Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.
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.
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 (below) of the page/code you wish to modify.
- 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. - Back Up
Always back-up the original ProductCart files before changing the source code. - 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. - 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. - 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. - 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).
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:
- Save the new copy of header.asp as testheader.asp
- 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 above! It's also 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: