Académique Documents
Professionnel Documents
Culture Documents
Cartweaver 3 PHP End User License Agreement Single Developer License8 Section 1: Welcome to Cartweaver.......................................................... 10 The Cartweaver Shopping Cart ................................................................. 10 Easy Integration! ................................................................................... 10 Separating Form from Function................................................................. 11 Completely Customizable......................................................................... 11 The Administration Area .......................................................................... 11 The Cartweaver 3 Database ..................................................................... 11 The Cartweaver Customer Area ................................................................ 11 Conventions Used in this Manual............................................................... 12 Section 2: Definition of Terms................................................................. 14 Section 3: Directory Structure and Cart Flow Map.................................... 18 Directory Structure................................................................................. 18 Cart Flow Map........................................................................................ 18 Cart Flow Map........................................................................................ 19 Section 4: Cartweaver Step-By-Step ....................................................... 20 Preparation ........................................................................................... 20 Step 1: Install a PHP Application Server and Web Server ........................... 20 Step 2: Install the Cartweaver 3 PHP Extension Suite ................................ 21 The Cartweaver 3 Toolbar ..................................................................... 22 Step 3: Create a PHP Site ..................................................................... 23 Installation and Setup ............................................................................. 23 Step 1: Install Cartweaver .................................................................... 23 Step 2: Create the Database ................................................................. 25 Step 3: Create a Database Connection in Dreamweaver............................. 25 Step 4: Complete the Cartweaver 3 Setup ............................................... 25 The Presentation Files ............................................................................. 31 Step 1: Add a Search Form or Search Links ............................................. 32 Step 2: Add Search Results Include ........................................................ 34 Step 3: Add Product Details Include........................................................ 35 Step 4: Add Show Cart Include .............................................................. 35 Step 5: Add Order Form Include ............................................................ 35 Step 6: Add Confirmation Include........................................................... 36 Step 7: Add View Cart Link ................................................................... 36 Step 8: Add Login Form........................................................................ 36 Completing your Store ............................................................................ 37 Changing the Administrator Login .......................................................... 37 Changing Company Information............................................................. 37 Defining Shipping Settings .................................................................... 37 Creating Store Categories ..................................................................... 37 Secondary Categories .......................................................................... 38 Configuring Taxes................................................................................ 38
Cartweaver 3 PHP
Table Of Contents
Working with Products.......................................................................... 40 Managing Products .............................................................................. 41 Discounts ........................................................................................... 43 Section 5: Cart Files................................................................................ 46 application.php ...................................................................................... 46 Objects Declared:................................................................................ 46 CWIncGlobalSettings.php Global Application Settings ................................ 47 Properties: ......................................................................................... 47 CWIncSetup.php Setting up Cartweaver .................................................. 50 Session Variables ................................................................................ 50 CWIncFunctions.php Cartweaver Functions .............................................. 51 arrayFind ........................................................................................... 51 arrayKeyToArray ................................................................................. 52 arrayRemove ...................................................................................... 52 arrayValueList..................................................................................... 53 cartweaverMoney ................................................................................ 54 cwAltRow ........................................................................................... 54 cwDateFormat .................................................................................... 55 expandPath ........................................................................................ 55 getPageName ..................................................................................... 56 localPath ............................................................................................ 56 mySQLDate ........................................................................................ 57 sendEmail .......................................................................................... 57 Include Files .......................................................................................... 58 CWIncResults.php ............................................................................... 58 CWIncDetails.php ................................................................................ 58 CWIncShowCart.php ............................................................................ 58 CWIncOrderForm.php........................................................................... 59 CWIncLoginForm.php ........................................................................... 59 CWIncConfirmation.php........................................................................ 59 Classes ................................................................................................. 59 DB Database functionality .................................................................. 59 CWCart.............................................................................................. 64 Public Methods .................................................................................... 65 CWCart.............................................................................................. 65 add Add an item to the cart ................................................................ 65 update Update the cart item ............................................................... 65 getCartQty get the total cart quantity................................................... 66 multiOption add a multi-option item to the cart ..................................... 66 CWMail Mail ..................................................................................... 70 CWSearch Search/Navigation.............................................................. 71 Function Files and Functional Include Files.................................................. 74 CWDebugger.php Debugger ............................................................... 74 CWError Cartweaver error handling ..................................................... 75 CWFunCustomerAction Customer Action ............................................... 76 CWFunFindPassword Find Password ..................................................... 79
Cartweaver by Application Dynamics Inc. 2003-2005. All rights reserved.
Cartweaver 3 PHP
Table of Contents
CWFunOrderConfirmEmails Order Confirmation Email ............................. CWFunPriceList Price List.................................................................... CWIncProcessOrder Process Order....................................................... CWFunProductOptions Product Options................................................. CWFunSearchAction Search Action....................................................... CWFunShipping Shipping ................................................................... CWIncValidateOrderForm Validate Order Form....................................... Payment Processing Include Files .............................................................. CWIncAuthorizeNet.php........................................................................ CWIncPayflowPro.php .......................................................................... CWIncPayPal.php ................................................................................ CWIncWorldPay.php............................................................................. Supporting Files ..................................................................................... index.php........................................................................................... cartweaver.css.................................................................................... CWRequirementChecker Check requirements ........................................ Cartweaver MySQL Database.................................................................
80 82 82 83 85 86 87 89 89 90 91 92 94 94 94 95 95
Section 6: Administration Files ............................................................... 98 AdminHome.php .................................................................................... 98 application.php ...................................................................................... 98 Config.asp............................................................................................. 98 ConfigGroup.asp .................................................................................... 98 ConfigItem.asp ...................................................................................... 99 CustomerDetails.php............................................................................... 99 Customers.php ...................................................................................... 99 CWIncNav.php....................................................................................... 99 CWProductAction.php.............................................................................. 99 CWIncProductSearch.php ........................................................................ 99 CWValidateProduct.php ........................................................................... 99 DatePopUp.php ...................................................................................... 99 DiscountDetails.asp ................................................................................ 99 DiscountProdutList.asp ...........................................................................100 Error.php .............................................................................................100 index.php.............................................................................................100 ListAdminUsers.php ...............................................................................100 ListCategories.php.................................................................................100 ListConfigGroups.asp .............................................................................100 ListCountry.php ....................................................................................100 ListCreditCard.php.................................................................................100 ListDiscounts.asp ..................................................................................100 ListScndCategories.php ..........................................................................101 ListShipStatus.php ................................................................................101 ListTaxGroups.asp .................................................................................101 ListTaxRegions.asp ................................................................................101 Options.php .........................................................................................101 OrderDetails.php ...................................................................................101
4
Cartweaver by Application Dynamics Inc. 2003-2005. All rights reserved.
Cartweaver 3 PHP
Table Of Contents
Orders.php...........................................................................................101 ProductActive.php .................................................................................101 ProductArchive.php................................................................................101 ProductForm.php...................................................................................102 ProductImageUpload.php........................................................................102 Settings.php.........................................................................................102 ShipMethods.php...................................................................................102 ShipRange.asp......................................................................................102 ShipSettings.php...................................................................................102 ShipStateProv.php.................................................................................102 TaxGroup.asp .......................................................................................102 TaxGroupProducts.asp ...........................................................................102 TaxRegion.asp ......................................................................................103 Section 7: Database.............................................................................. 104 Overview and Relationships ....................................................................104 Table-By-Table Database Summary..........................................................104 tbl_adminusers ..................................................................................105 tbl_cart.............................................................................................105 tbl_config..........................................................................................105 tbl_configgroup ..................................................................................106 tbl_customers ....................................................................................106 tbl_custstate......................................................................................106 tbl_custtype ......................................................................................107 tbl_discount_amounts .........................................................................107 tbl_discount_apply_types ....................................................................107 tbl_discount_types .............................................................................107 tbl_discount_usage.............................................................................107 tbl_discounts .....................................................................................108 tbl_discounts_products_rel ..................................................................108 tbl_discounts_skus_rel ........................................................................108 tbl_list_ccards....................................................................................109 tbl_list_countries ................................................................................109 tbl_list_imagetypes.............................................................................109 tbl_list_optiontypes ............................................................................109 tbl_list_shipstatus ..............................................................................109 tbl_orders .........................................................................................110 tbl_orderskus.....................................................................................111 tbl_prdtcategories ..............................................................................111 tbl_prdtimages...................................................................................111 tbl_prdtscndcats.................................................................................111 tbl_prdtoption_rel...............................................................................112 tbl_prdtscndcat_rel.............................................................................112 tbl_products ......................................................................................112 tbl_shipmethcntry_rel .........................................................................112 tbl_shipmethod ..................................................................................113 tbl_shipweights ..................................................................................113
Cartweaver by Application Dynamics Inc. 2003-2005. All rights reserved.
Cartweaver 3 PHP
Table of Contents
tbl_skuoptions ...................................................................................113 tbl_skuoption_rel ...............................................................................113 tbl_skus............................................................................................114 tbl_stateprov .....................................................................................114 tbl_taxgroups ....................................................................................114 tbl_taxrates.......................................................................................114 tbl_taxregions....................................................................................115 Section 8: How things Work.................................................................. 116 Globally declaring variables in the application.php file .................................116 How Cartweaver Works ..........................................................................116 Typical Cart Flow...................................................................................117 Step 1: The Search.............................................................................117 Step 2: View Details ...........................................................................117 Step 3: View Cart ...............................................................................118 Step 4: Order Form ............................................................................118 Step 5: Final Checkout ........................................................................118 Step 6: Order Confirmation ..................................................................119 How Shipping is Calculated .....................................................................119 Charge Range Based On ......................................................................119 Enable Shipping .................................................................................120 Charge Base ......................................................................................120 Location Extension..............................................................................120 Sample Calculation .............................................................................120 Dialing in your Shipping Grid..............................................................121 Why not just use UPS or FedEx online? ..................................................121 Processing Credit Card Payments .............................................................122 Gateway or Processor..........................................................................122 How Real-Time Gateways Work ............................................................122 How Non-Real-Time Payment Processors Work........................................122 Section 9: Resources ............................................................................ 124 Recommended Reading ..........................................................................124 Recommended Web Sites .......................................................................124 Dreamweaver, MySQL, and PHP Resources .............................................124 SSL Certificates..................................................................................124 Payment Gateways .............................................................................124 Payment Processors ............................................................................125 Section 10: Support .............................................................................. 126 What is supported?................................................................................126 Support Newsgroup (NNTP Forum)...........................................................126 What is a newsgroup? .........................................................................126 Outlook Express Newsreader Setup .......................................................126 Appendix A: Updating Cartweaver Stores .............................................. 128 Updating Scenarios................................................................................129
6
Cartweaver 3 PHP
Table Of Contents
Scenario 1.........................................................................................129 Scenario 2.........................................................................................130 Scenario 3.........................................................................................130 Scenario 4.........................................................................................130 Update Solutions ...................................................................................130 Solution 1 .........................................................................................130 Solution 2 .........................................................................................132 Solution 3 .........................................................................................135 Solution 4 .........................................................................................136 Dealing with Numerous Changes..............................................................136 Appendix B: Updating Cartweaver Extensions ....................................... 138 Rename the Cartweaver Snippets Folder ...................................................138 Uninstall Cartweaver Extensions ..............................................................139 Install the Latest Version of Cartweaver ....................................................140 Appendix C: Folder Permissions for File Uploading ................................ 144 Windows ..............................................................................................144 Linux/Unix ...........................................................................................147
This is an agreement by and between Application Dynamics Inc. ("Licensor"), parent company of Cartweaver and Cartweaver.com, and the End User ("Licensee"), who is being licensed as a one developer, ("Single Developer License", "License", "License Agreement") to use Cartweaver 3 PHP ("Software"). Licensee acknowledges that this is only a limited nonexclusive license. Licensor is and remains the owner of all titles, rights, and interests in the Software. This License permits Licensee to install the Software on more than one computer system for use solely by Licensee, as long as the Software will not be used on more than one computer system simultaneously. Licensee will not make copies of the Software or allow copies of the Software to be made by others, unless authorized by this License Agreement. Licensee may make copies of the Software for backup purposes only. Licensee is permitted to develop as many websites as the Licensee wishes using the Software. The Software may be used for the development of websites on behalf of the website owner/merchant, be that the Licensee or client(s) thereof. The Software, in whole or in part, may NOT be used for the development of applications for resale or distribution without the express written permission of the Licensor. Unless otherwise expressly authorized in a separate written agreement between, and executed by, you and Application Dynamics Inc., the following license restrictions apply: You may not rent, lease, sublicense, use and/or permit the use of the Software on a timeshare or service basis. In addition, you may not provide the Software as part of a hosting service, whether as a subscription basis or otherwise. This Software is subject to a limited warranty. Licensor warrants to Licensee that the Software will perform according to its printed documentation, and to the best of Licensor's knowledge Licensee's use of this Software according to the printed documentation is not an infringement of any third party's intellectual property rights. To the extent permitted by law, THE ABOVESTATED LIMITED WARRANTY REPLACES ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, AND LICENSOR DISCLAIMS ALL IMPLIED WARRANTIES INCLUDING ANY IMPLIED WARRANTY OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, OR OF FITNESS FOR A PARTICULAR PURPOSE. No agent of Licensor is authorized to make any other warranties or to modify this limited warranty. Licensee has specific legal rights pursuant to this warranty and, depending on Licensee's jurisdiction, may have additional rights.
II.
III.
IV.
V.
VI.
Notwithstanding the foregoing, LICENSOR IS NOT LIABLE TO LICENSEE FOR ANY DAMAGES, INCLUDING COMPENSATORY, SPECIAL, INCIDENTAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL DAMAGES, CONNECTED WITH OR RESULTING FROM THIS LICENSE AGREEMENT OR LICENSEE'S USE OF THIS SOFTWARE, whether based on lost revenue or otherwise, regardless of whether LICENSEE was advised of the possibility of such losses in advance. In no event shall LICENSOR's liability hereunder exceed the amount of license fees paid by Licensee, regardless of whether Licensee's claim is based on contract, tort, strict liability, product liability or otherwise. Licensee's jurisdiction may not allow such a limitation of damages, so this limitation may not apply. Licensee agrees to defend and indemnify Licensor and hold Licensor harmless from all claims, losses, damages, complaints, or expenses connected with or resulting from Licensee's business operations. Licensor has the right to terminate this License Agreement and Licensee's right to use this Software upon any material breach by Licensee. Licensee agrees to return to Licensor or to destroy all copies of the Software upon termination of the License. This License Agreement is the entire and exclusive agreement between Licensor and Licensee regarding this Software. This License Agreement replaces and supersedes all prior negotiations, dealings, and agreements between Licensor and Licensee regarding this Software. This license is subject to change without notice. This License Agreement is valid without Licensor's signature. It becomes effective upon the earlier of Licensee's signature, Licensee's use of the Software, or purchase of the Software. Cartweaver is copyright of Application Dynamics Inc. and its licensors. Macromedia, Dreamweaver, and/or Fireworks, are either registered trademarks, trademarks, or copyrights of Macromedia, Inc. in the United States of America and/or other countries. This License Agreement shall be governed by the laws of the State of Washington.
VIII.
IX. X. XI.
XII.
XIII.
XIV.
If you have any questions concerning this Agreement, or otherwise wish to contact a support person, write to: Application Dynamics Inc. support@cartweaver.com 1560 NE 10th East Wenatchee, WA 98802
Easy Integration!
If you're new to dynamically developed sites or just new to e-commerce, Cartweaver won't hold you back. Many of our customers have reported no previous development experience and have found that they have learned much about the dynamic development process by using Cartweaver. We've done our very best to make things easy for you. If you're a Dreamweaver MX or Dreamweaver MX 2004 user, you'll be able to take advantage of the Cartweaver 3 PHP extension suite. The Step-By-Step section of this manual provides you with everything you need to do to get your Cartweaver site up and going. Tip
Cartweaver is fully documented and the code is extensively commented, so any time you want to know what is going on or how something works just switch to Code view and read the Comment Lines.
Cartweaver 3 PHP
Welcome to Cartweaver
If you're not using Dreamweaver, a copy of the entire Cartweaver 3 PHP application is provided in Cartweaver3PHP.zip. Everything you need to know is either in this documentation and/or commented in the code.
Completely Customizable
Even though Cartweaver is developed to be easy to integrate, it is still completely customizable. Should the need arise you can customize the application files to suit your needs. We believe Cartweaver is the best marriage of ease-of-use and customizability ever offered in an e-commerce application.
11
Cartweaver 3 PHP
Welcome to Cartweaver
Notes are provided throughout the document. Notes contain important information about the application. Notes appear like this: Note
Note text.
Tips are helpful hints about the application. Tips appear like this: Tip
Tip text.
12
Cartweaver 3 PHP
Definition of Terms
Payment Gateway: A payment gateway is a third party that processes credit card information for you in real time. The transaction is processed in-line and the page will not be completed until a response is received from the gateway. This allows the rest of the code on the page to be processed based on the results of the gateway transaction. This transaction is invisible to the shopper. Common examples of payment gateways are Verisigns Payflow Pro and Authorize Net. Payment Processor: When interacting with a payment processor, the transaction takes place non-real-time. The order is written to the Cartweaver database, and then the customer enters their payment information on the processors website. The results will be sent separately to the merchant or to your application via email or to a different file that the processors server is pointed to. In this situation some sort of order verification and validation system must be put in place to update the order records to show when the credit card transaction has been completed and the payment is valid, or not. Common examples of this type of system are PayPal, 2Checkout and WorldPay. Presentation Files: Presentation files contain your design and user interface. You will be adding Cartweaver functionality to your presentation files via the Cartweaver 3 PHP extension suite, or if you are hand coding in Dreamweavers Code view or in HomeSite+ or other text editors you will be adding Cartweaver functionality via <?php include("pagename.php");?> calls. Separating form from function this way makes your application easy to design, customize and maintain. Product: A product ID is a unique ID for a particular product. Product IDs must be unique within the database. See the Cartweaver Step-By-Step section for information on how product IDs are used inside the Cartweaver application. SKU (also referred to as Product SKU): SKU stands for Stock Keeping Unit. This is the industry standard way to refer to a specific product item. Consult the Cartweaver Step-By-Step section for more explanation on how SKUs function in Cartweaver. Supporting Files: Supporting files refers to the additional files installed with Cartweaver 3, which do not qualify as admin files, application files, functional includes, or presentation files. Supporting files include all assets, cartweaver.css, images and the Cartweaver Access database file. Target Page: The go-to page for a Cartweaver functional include is called a target page. For example, when you click View Cart (in the Cart Links class) the target page will be the presentation page that contains the CWIncShowCart.php functional include. showcart.php is the default, but the target page can be customized to fit your naming scheme. The target page variables are set by the Setup server behavior in the application.php file and are defined when you install Cartweaver into an existing site for the first time.
15
Cartweaver 3 PHP
Welcome to Cartweaver
Tax Group: Tax Groups define a collection of products that are similarly taxed. Examples of tax groups might include Electronics, Books, or Food Items. Each Tax Group should uniquely identify a single collection of products that should be taxed. Tax Region: A Tax Region is the physical location that taxes will be based upon. Tax Regions can either be entire countries, or individual states or provinces within a country. Each Tax Region can have its own Tax Rates for each Tax Group defined. Tax Rate: A Tax Rate is a percentage to be charged on an item in a particular Tax Group and Tax Region. Tax Rates can differ between groups and between regions. For example, the Tax Rate for Books (the Tax Group) in the United Kingdom (the Tax Region) can be different than the Tax Rate for Books in the United States: Texas (the Tax Region).
16
Cartweaver Presentation Files, Error Files and application.php Cartweaver Application Directory Administration Area Admin CSS and JavaScript Files Administration Graphics Administration Help Files Cartweaver Store Assets Credit Cart Images CSS Files Expand (popup) Product Images Full Size Product Images Small Product Images Thumbnail Product Images Shared JavaScript Files Cartweaver functions Payment Processing functions Database and Locale Setup Files MySQL Database Setup Files UNIX/Linux Locale Files
Cartweaver 3 PHP
results.php - CWIncResults.php
details..php - CWIncDetails.php
showcart.php - CWIncShowCart.php
orderform.php - CWIncOrderForm.php
confirmation.php - CWIncConfirmation.php
19
Preparation
The following three steps describe everything you need to do before you get started building your Cartweaver site. You'll only need to complete steps 1 and 2 once. For each Cartweaver site you develop, you'll need to complete step 3.
Cartweaver 3 PHP
Cartweaver Step-by-Step
http://www.cartweaver.com/go/IIS5Support. Once IIS is installed, PHP can be installed with the install package located at http://www.php.net/downloads.php. Double-click the installer and follow the instructions. Information on downloading, configuring, and installing Apache web server is located at http://www.apache.org. Apache and PHP can also be installed locally on Macintosh computers. An article on installing the servers can be found on the Macromedia site at http://www.cartweaver.com/go/PHPMac. Additionally, you should be aware that most PHP hosting companies use Unix or Linux servers, and PHP code is not fully compatible across servers. The standard out-of-the-box Cartweaver code will run equally well on both servers, however. There are many distributions of Linux available, and installation/configuration will vary for each. Information on installing and configuring Apache, PHP, and MySQL can be found online or in the installation packages for the Linux distribution that you are running.
21
Cartweaver 3 PHP
Cartweaver Step-by-Step
Because the toolbar works with all versions of Cartweaver, you only need to install Cartweaver3Toolbar.mxp once even if you have more than one version of Cartweaver installed.
22
Cartweaver 3 PHP
Cartweaver Step-by-Step
23
Cartweaver 3 PHP
Cartweaver Step-by-Step
The Install Cartweaver 3 dialog will open with your currently selected site selected:
The options are as follows: Select Site: This is the site that you wish to install Cartweaver into. Application Folder: This is the folder where all of the Cartweaver files will be placed, including the application.php file, all presentation files, supporting files and admin files. You can click the browse icon to choose the folder you want to install into or leave the field blank to install into the root of your site. This field must contain a path to a folder that already exists inside the selected site, and the folder may not already contain an instance of the Cartweaver 3 application. Select Installed Files in Site?: Check this box to have all of the installed Cartweaver files selected in the Files panel once the installation is complete. This makes it easy to quickly upload all of the installed files. This checkbox will remember your last choice the next time you install Cartweaver. Once Cartweaver has been successfully installed you will see the following alert:
24
Cartweaver 3 PHP
Cartweaver Step-by-Step
Note
If there were any problems during the installation, such as a file that could not be created or overwritten, then you will receive an alert to check the cw3ErrorLog.txt file located in your Cartweaver installation directory. This will tell you exactly which files were not created or overwritten.
2.
Cartweaver 3 PHP
Cartweaver Step-by-Step
button and menu are not only there to help guide you, but also to apply new instances to an application.php if you did not allow it to be created at the time of installation. Note
If application.php was not created during installation, you will need to apply the Cartweaver 3 Setup to your application.php file.
Double clicking the Cartweaver 3 Setup server behavior will open the Setup dialog. Note
If you see a red exclamation point next to the Cartweaver 3 Setup server behavior in the Server Behaviors panel, you will not be able to double-click the server behavior to modify it. If you attempt to do so you will see the following message:
Connection Information
The Connection category contains all of the information for connecting to your Cartweaver database. Choose a connection type and complete the necessary fields.
26
Cartweaver 3 PHP
Cartweaver Step-by-Step
Hostname: This field should contain the IP address, domain name or machine name to the MySQL Server which holds your database. This may or may not be the same as the address for your sites web server. If you are working on a remote server contact your host in order to determine the address for your MySQL Server. If you are testing locally, you should use 127.0.0.1. Database Name: This field should contain the name of your database on the MySQL Server specified in the Hostname field. The Database Name should be the same name specified during the database creation using generateDatabase.php. If youre unsure what this value should be, contact your host in order to determine the name of your MySQL Server database. Username: This field should contain the Username to access your database. The Username should be the same Username specified during the database creation using generateDatabase.php. If youre unsure what this value should be, contact your host in order to determine the Username of your MySQL Server database. Password: This field should contain the Password for the Username to access your database. The Password should be the same password specified during the database creation using generateDatabase.php. If youre unsure what this value should be, contact your host in order to determine the password of your MySQL Server database.
Website Information
The Website category contains information pertaining to the URL of your store.
27
Cartweaver 3 PHP
Cartweaver Step-by-Step
URL: Determines the base URL for your Cartweaver store. This value is optional, but should be used if you are using an SSL certificate for your store. If this field is left blank then all links in the Cartweaver store will be document relative based on the location of your presentation files. This URL should be the absolute path to your stores presentation files under your nonSSL enabled domain name, such as http://www.yoursite.com/. The trailing slash is required. SSL URL: Determines the secure URL to use for payment processing for your Cartweaver store. Leave this value blank if you are not using a payment gateway or processor that requires you to collect credit cards information. If you are accepting credit cards this value should be the https:// version of your domain, or the location of a shared SSL provided by your host, such as https://www.yoursite.com/ or https://www.sharedssl.com/yoursite/. You should only use this setting when you have a valid secure site available. The trailing slash is required.
Presentation Information
The Presentation category contains all of the settings for your page names and display settings. The names for each page in your site are defined here, along with how many items to display in search results, and what to do when a user adds an item to their cart.
28
Cartweaver 3 PHP
Cartweaver Step-by-Step
Add to Cart Action: Determines whether to confirm the Add to Cart action on the Current Page or to send the user to the View/Show Cart Page. (See the onSubmitAction description for CWIncGlobalSettings.php in the Section 5: Cart Files section for more information.) Results Page: The page that users will be sent to for default search actions. See the results description for CWIncGlobalSettings.php in the Cart Files section for more information. Check the adjacent Create? checkbox in order to have this file created for you with the CWIncResults.php already included in the file. The default value is results.php. Details Page: The page that users will be sent to when they click a link to show order details, whether through search results or an Upsell link on another products detail page. See the details description for CWIncGlobalSettings.php in the Cart Files section for more information. Check the adjacent Create? checkbox in order to have this file created for you with the CWIncDetails.php already included in the file. The default value is details.php. Details Display Type: Determines the method in which product options will be displayed on the Details Page. See the detailsDisplay description for CWIncGlobalSettings.php in the Cart Files section for more information. The default value is Advanced JavaScript. View/Show Cart Page: The page that users will be sent to when they click a View Cart link or if the Add to Cart Action is set to View/Show Cart Page, the page a user will be sent to when they add an item to their cart. See the goToCart description for CWIncGlobalSettings.php in the Cart Files section for more information. Check the adjacent Create? Checkbox in order to have
29
Cartweaver 3 PHP
Cartweaver Step-by-Step
this file created for you with the CWIncShowCart.php already included in the file. The default value is showcart.php. Checkout/Order Form Page: The page that users will be sent to when they click the Checkout button. See the orderForm description for CWIncGlobalSettings.php in the Cart Files section for more information. Check the adjacent Create? checkbox in order to have this file created for you with the CWIncOrderForm.php already included in the file. The default value is orderform.php. Confirmation Page: The page that users will be sent to once they have successfully completed an order. See the confirmation description for CWIncGlobalSettings.php in the Cart Files section for more information. Check the adjacent Create? checkbox in order to have this file created for you with the CWIncConfirmation.php already included in the file. The default value is confirmation.php.
Miscellaneous Information
The Miscellaneous category contains those settings that dont fit into the other categories, such as component selections, locale settings and payment processor information.
Locale: Select the operating system for the server hosting your site in order to determine the locale for date and currency formatting. If you are using a Unix or Linux server upload and browse to /setup/CWGetLocales.php in order to determine the locales supported by the server hosting the site. If the locale you need is not in the list provided, type the value in manually. If you are using a Windows server, choose the locale from the list provided.
30
Cartweaver 3 PHP
Cartweaver Step-by-Step
Payment Processor: Choose the appropriate payment processor or gateway for your store. The appropriate processor file will be copied to the /cw3/CWLibrary/ProcessPayment folder. See the descriptions for each payment processor in the Cart Files section of this document for more information on configuring your payment processor once the Cartweaver Setup is complete. Debug Password: The debug password is used to enable debugging on live sites. Add the querystring variable debug=[debug password] to the end of any URL in the site in order to show the Cartweaver debugging information. For example, on the sites index.php page, you would use http://yoursite.com/index.php?debug=myPassword to show the debugging output. The debug password should be alphanumeric with no special characters or spaces. Once youve completed the dialog click OK to set all of the values in the application.php file. Tip
All of the Create? checkboxes are sticky. This means that the dialog will remember your previous choice checked or unchecked and use that preference the next time you invoke the dialog.
Cartweaver 3 PHP
Cartweaver Step-by-Step
the appropriate command from either the Cartweaver 3 toolbar or the Cartweaver > Cartweaver 3 PHP submenu. Note
It is critical that the presentation files are located in your Cartweaver store root folder. Moving these files outside the Cartweaver store root will cause errors, and is not supported.
The Cartweaver Search/Navigation server behavior is used to add either a search form, or a set of text links to each of the categories in the site. You may add a Search/Navigation server behavior to any PHP file that is in your Cartweaver store root folder. Tip
You'll find examples of various search forms and text navigation links in index.php located in your Cartweaver store root folder.
With any PHP file open, choose Cartweaver> Cartweaver 3 CF> Search/Navigation or click the Search/Navigation icon in the Cartweaver toolbar to add a Cartweaver Search/Navigation object to the page.
32
Cartweaver 3 PHP
Cartweaver Step-by-Step
Type: Determines which type of search to display to the user. The default value is Search Form. The possible values are: Search Form: Displays a search form with the requested form fields passed through the Form related Arguments. Text Navigation Links: Displays a list of links for each category formatted with the Links related Arguments. Action Page (Optional): The page to submit the search criteria to. If you leave this field blank then targetResults will be used as the action page, as defined in application.php. Search Form Options The Search Form Options will be enabled if the Type is set to Search Form. Keywords: Check this box to include a search text field. The Keywords Label field will be enabled if this option is chosen. Category: Check this box to include a category <select> menu. The Category Label field will be enabled if this option is chosen. Secondary: Check this box to include a secondary category <select> menu. The Secondary Label field will be enabled if this option is chosen. Form Name/ID: The form name and ID to be applied to the <form> tag. This value is also used as a prefix to the preset IDs for other search form elements. For each Search/Navigation server behavior applied, this value should be unique. The default value is Search. Button Label: The text to be used for the submit button of the search form. The default value is Search. Keywords Label: The default text to be entered into the keyword search field. The default value is Enter Keyword(s). Category Label: The text to use for the All Categories entry of the select field. The default value is Select Category. Secondary Label: The text to use for the All Secondary Categories entry of the select field. The default value is Select Secondary Category. Text Navigation Links Options The Text Navigation Links Search Options will be enabled if the Search Type is set to Links.
33
Cartweaver 3 PHP
Cartweaver Step-by-Step
All Categories Label: The label used for the All Categories link. The default value is All. Separator: Determines the string to be placed between each link. If you want to display links vertically you can pass HTML code, such as the <br /> tag, through this attribute. The select menu includes several predefined options: |, ::, <br> and <br />. You may type any separator into the field. Code Before Selected Link: Determines the string to be placed before a selected link. You can pass HTML code through this attribute. Code After Selected Link: Determines the string to be placed after a selected link. You can pass HTML code through this attribute. After completing the dialog, click OK to add the Search to your page. Dreamweaver will render your selected options in Design view so that you can see how the search will fit into your overall design. Note
Be careful if you decide to hand-code any of the properties of the CWSearch object added by the Search/Navigation server behavior. Some of the Arguments require that you escape any double quotes, such as <span class=\"mysearch\">. It is best to always use the Search/Navigation interface to apply changes as the extension handles all quote escaping automatically.
Tip
If you need to modify an existing Search/Navigation server behavior, doubleclick on Search/Navigation in the Server Behaviors panel. This will allow you to make the changes and ensures that the Arguments are properly encoded.
Figure 4.12 Cartweaver 3 Search/Navigation server behavior in the Server Behaviors panel
34
Cartweaver 3 PHP
Cartweaver Step-by-Step
If you chose not to have the Results Page created for you in the Cartweaver 3 Setup, open your Results Page and place the insertion point where you want your search results to be displayed and choose Cartweaver> Cartweaver 3 CF> Results or click the Results button in the Cartweaver toolbar. The CWIncResults.php file will be included at the insertion point. Tip
The toolbar buttons which do not require a dialog for input are tied to their relevant snippets in the Snippets panel. If you change a snippet that is inserted by the Cartweaver toolbar, it will reflect your changes. This allows you to modify the code that is inserted based on your own needs. Please be sure to review the Updating Cartweaver Extensions appendix if you customize any of the Cartweaver snippets. If you rename or delete any of the snippets that are inserted by the toolbar, the default code will be inserted for you.
If you chose not to have the Details Page created for you in the Cartweaver 3 Setup, open your Details Page and place the insertion point where you want the product details to be displayed and choose Cartweaver> Cartweaver 3 CF> Details or click the Details button in the Cartweaver toolbar. The CWIncDetails.php file will be included at the insertion point.
If you chose not to have the Show Cart Page created for you in the Cartweaver 3 Setup, open your Show Cart Page and place the insertion point where you want the cart details and checkout information to be displayed and choose Cartweaver> Cartweaver 3 CF> Show Cart or click the Show Cart button in the Cartweaver toolbar. The CWIncShowCart.php file will be included at the insertion point.
35
Cartweaver 3 PHP
Cartweaver Step-by-Step
If you chose not to have the Order Form Page created for you in the Cartweaver 3 Setup, open your Order Form Page and place the insertion point where you want the order form to be displayed and choose Cartweaver> Cartweaver 3 CF> Order Form or click the Order Form button in the Cartweaver toolbar. The CWIncOrderForm.php file will be included at the insertion point.
If you chose not to have the Confirmation Page created for you in the Cartweaver 3 Setup, open your Confirmation Page and place the insertion point where you want the customers order confirmation to be displayed and choose Cartweaver> Cartweaver 3 CF> Confirmation or click the Confirmation button in the Cartweaver toolbar. The CWIncOrderForm.php file will be included at the insertion point.
A View Cart text link may be added to any PHP file in your Cartweaver store root folder. You can place a link to the View Cart page anywhere in your application by using the View Cart include. To place the View Cart include, place the insertion point where you want the link to be displayed and choose Cartweaver> Cartweaver 3 CF> View Cart Link or click the View Cart Link button in the Cartweaver toolbar. The <?php echo($cartweaver->cartLinks());?> include file call will be added at the insertion point.
A Login form may be added to any PHP file in your Cartweaver store root folder. You can place the login anywhere in your application by using the Login Form include. To place the Login Form include, place the insertion point where you want the form to be displayed and choose Cartweaver> Cartweaver 3 CF> Login Form or click the Login Form button in the Cartweaver toolbar. The <?php include("cw3/CWIncLoginForm.php");?> include file call will be added at the insertion point.
36
Cartweaver 3 PHP
Cartweaver Step-by-Step
Cartweaver 3 PHP
Cartweaver Step-by-Step
should be broad enough to cover everything associated with it. Department stores are a good example of this, for example: house wares, clothing, jewelry and so forth. It is, however, possible to assign a product to multiple categories. The sort order field for each category allows you to force the order in which the categories are sorted, rather than relying on alphabetical sorting. Categories are first sorted by the Sort Order value, and then alphabetically. Note
Categories that are associated with products cannot be deleted. Doing so would make the products in that category unavailable. If you want to no longer use one of these categories you can "archive" it, which will remove it from view on the web and in the Product Admin area.
Secondary Categories
Secondary categories act as subcategories, but they can be searched on directly without an associated category. A product can be related to an unlimited number of secondary categories.
Sorting
The sort order field for each secondary category allows you to force the order in which the secondary categories are sorted, rather than relying on alphabetical sorting. Secondary categories are first sorted by the Sort Order value, and then alphabetically.
Configuring Taxes
Before you begin entering products into the database, you should define as much of your stores tax information as possible. This will make it easier to complete the product data entry, as there will be no need to return to the products to assign tax values later. The recommended procedure for configuring your stores tax information is to first define all of the appropriate Tax Regions, and then the Tax Groups. Once these two
38
Cartweaver 3 PHP
Cartweaver Step-by-Step
steps are complete you can begin configuring all of the Tax Rates for each Group and Region. Note
How you configure taxes depends local laws and regulations. It is your responsibility to determine the configuration necessary to satisfy legal tax requirements. The following tax configuration related information is intended as an overview only. Additional help is provided on each page in the Cartweaver admin.
39
Cartweaver 3 PHP
Cartweaver Step-by-Step
The Product ID is how merchandise is grouped and identified. When adding items to a cart, it is SKUs that are counted for tracking inventory. Tip
One method used to help ensure that SKUs are unique is to use the product ID followed by a dash then the SKU. Once your company and shipping settings are complete you can then begin creating product options, categories and the actual products themselves.
Cartweaver 3 PHP
Cartweaver Step-by-Step
Adding Option Groups To add an Option Group you click the Add New link under the Option tab on the Cartweaver Admin menu. This will take you to a simple form that will allow you to add the Option Name. Adding Options Once you have added an Option Group, click on the group name in the Options tab of the Admin menu to open the Options Administration page. Here you can add and administer options to be listed under this particular option group. Administering Options If there are products associated with a given option you will not be able to delete the option. Instead, you can Archive the option so it will no longer appear on the web or in the selection fields on the Product Admin page. Archiving options that have already been used allows you to keep historical data accurate, while providing a means to exclude items from view without permanently deleting them.
Managing Products
Begin adding new products by choosing Products> Add Product. When you click the Add Product link you will see that product configuration starts with three tabs: General Info, Descriptions, and Photos. Additional tabs for SKUs and Up-Sell products appear once you have created a base product. Note
Remember that every product in the database must have at least one SKU in order for it to be displayed on your store. You must first establish a product before adding its SKUs.
General Info
Basic product information is configured in the General Info tab. The product ID and name are required fields. If you need to add a product but are not ready for it to appear on the web, set the On Web setting to No. (This will hide the product and all its related SKUs from the web until you are ready for it to be shown online.)
41
Cartweaver 3 PHP
Cartweaver Step-by-Step
Descriptions
The short description (used in the search results page) and the long description (used in the product details page) are configurable in the Descriptions tab. Both the short and long description fields are required.
Photos
In the Photos tab, you can select the type of product image you wish to upload, from among the different image options in Cartweaver, and you can browse to the image file on your system and select it to be uploaded. The image upload will only allow web compatible image files (.gif, .jpg, .jpeg or .png) to be uploaded. Once the image is selected and uploaded the appropriate image name field will be updated with the name of the image file that was uploaded. You should not include any path information in the store image names, as Cartweaver handles the paths automatically. See the Directory Structure and Cart Flow Map section for more information on where images are stored. There are four image sizes available: Thumbnail Displayed on the search results page Large Displayed on the product detail page Expanded Displayed in a popup window when you click on the Large image, this option can be disabled on the Display Settings page Extra small Displayed with Up-Sell products and in the shopping cart, the option to display in the shopping cart can be disabled on the Display Settings page
After you complete the General Info, Descriptions and Photos tabs, click Finish to add the initial product data to the database. The Product Admin page will reload with the newly added product, and two additional tabs: SKUs and Upsell.
SKUs
Once the product has been created, the Add SKUs form will be available in the SKUs tab. You can add as many SKUs as you would like. If you wish to add more SKUs at any time simply click the SKUs tab to show the Add SKU form again. When adding SKUs be sure to complete all fields. If weight is unimportant for your SKU enter 0; all fields must be complete. Deleting Products and SKUs If you delete a product, all SKUs will be deleted too. If there are orders related to a SKU, you cannot delete the product, but you can choose to archive it. This will remove it from the web and remove it from the Active products list.
42
Cartweaver 3 PHP
Cartweaver Step-by-Step
Delete SKUs by clicking the trashcan next to the SKU's ID. You may not delete SKUs that have orders associated with them. If you cannot delete the SKU and wish to make it unavailable for sale you can set the On Web setting to No.
Up-Sell
Up-Sell products are products that the buyer of the current product may find of interest. You can add as many of these as you wish. If Show Up-Sell is set to Yes on the Display Settings page, links to the Up-Sell products will appear on the Details Page in your Cart. Adjacent to the Up-Sell link is the optional extra small image, whose setting can be disabled in the Display Settings page.
Discounts
Discounts can be configured for individual products, individual skus, or for a global discount on all products. Additionally, discounts can be tied into a promotional code, which can be set up by a store administrator. All discount functionality starts in the Cartweaver admin area, from the Discounts menu in the left column. Discounted prices show in the cart on the results page, on the details page, and in the cart. If a promotional code is required to enable a particular discount, it will show up only after the promotional code is entered when checking out.
Configuring Discounts
Before adding discounts, you can configure the overall appearance of discounts in the cart using Store Settings > Discount Settings. There are three settings to be concerned with: Enable Discounts Turns discounts on and off for the entire store. Display Line Item Discount Gives you the ability to show discounts on each item as a separate column in the cart. If this is turned off, discounts are shown next to the regular price. The regular price will have a strike-through if line item discounts are not used. The strike-through style (.oldprice) can be set up or changed in the cartweaver.css and can be modified to your liking. Display Discount Notes on Cart Gives you the option to show the notes that are set up with each individual discount. If this option is checked, an asterisk will be displayed next to the price, and a note shown at the bottom of the page on all pages that show discounts.
Adding Discounts
To add a new discount, click the Add Discount link in the Discounts menu. The Discount Details form will be shown, allowing you to configure the new discount.
43
Cartweaver 3 PHP
Cartweaver Step-by-Step
The discount requires a Reference ID, a User Friendly Name, a start date, an end date, and an amount/percentage of discount. Be careful when creating discounts using amounts. Amount-driven discounts should not be greater than the price of the product that they can be applied to. Dates can be chosen using the date popup. An optional promotional code can be defined that will be required to be entered by the user in order to receive the discount. If no promotional code is given, the discount applies to the store showing in the results and details page. After adding the discount, you can choose to limit the discount to specific products/SKUs or to allow the discount to be applied to everything. Discounts are applied to all products by default. If you choose to apply the discount to specific products, click the Add Products link to bring up the product form. Here you can search for products and SKUs and add them to your discount. Finally, a checkbox marked Active allows you to turn a particular discount on and off.
44