--------------------------------------------------------------------------------- Chapter 1 Installing DHCart --------------------------------------------------------------------------------- Installing DHCart Incorporating DHCart with your site is simply a matter of adding 2 lines to the required page. However, first of all we need to setup a few variables with information about the domain extensions you support, prices and registration periods, any hosting options etc. Domain Registration: Open config.php in any text editor such as notepad.exe. First of all if you don't know anything about PHP then don't get scared! We will walk you though this and support is just an email away if required. Near the top of the file you will see a list of domain extensions each one looking something like this. $register[]=".com,1:2:5:10,14.99:28.99:64.99:119.99"; This list of domain extensions is a subset of the over 400 domain extensions supported by Whois that you wish to sell. Each domain extension is on a separate line. You can add or delete to this list as described later. You will notice that each line is separated into three sections by commas as the example above and we will now describe each section. .com This is the domain extension. 1:2:5:10 These are the periods in years that you wish to register this domain extension for. In this case 1, 2, 5 & 10 years. You can have as many registration periods as you wish (at least 1 though). Notice that each registration period is separated by a colon ( : ). 14.99:28.99:64.99:119.99 These are the prices for each registration period listed in the previous section again separated by colons. i.e. one year is charged at 14.99 and ten years at 119.99. You can have any number of prices but it must match with the number of registration periods as above. You can remove any domain extensions you do not wish to support simply by deleting the relevant lines. To add domains simply open up the domains.txt file included and copy and paste into the list. Don't forget to adjust the registration periods and prices though. Domain Transfers: As well as registering domain names you can optionally also transfer existing domains to your registrar. You can set the transfer periods and prices as you wish separately to the registration values. This is done exactly as described above for registration except each entry looks like this: $transfer[]=".com,1:2:5:10,14.99:28.99:64.99:119.99"; If you do not wish to support domain transfers simply comment out or delete each entry. Hosting Plans: Optionally you can allow a user to select a hosting plan for each domain that they choose. You can have as many different plans as you wish covering different options and contract periods etc. Recurring billing is supported by paypal.com and stormpay.com but not currently by 2checkout.com, Moneybookers.com and Nochex.com. To setup hosting plans find the following lines $hosting[]="Basic 1 year,0,19,S"; $hosting[]="Standard 1 year,0,39,S"; $hosting[]="Standard monthly,10,3.25,R"; $hosting[]="Professional 1 year,0,129,S"; $hosting[]="Professional monthly,15,10.75,R"; Here we have setup 5 hosting plans. Each plan is setup in sections separated by commas. The first section is the plan description which you should keep as short as possible. The second section is the setup cost. The third section is the price (single charge or monthly). The fourth and final section determines whether the plan is single charge or monthly recurring (S or R). Leave out any currency symbols etc. If you do not wish to support hosting plans then simply comment out or delete each entry. Agreement: You can optionally have DHCart display a link to your agreements or contracts on the checkout page. The user will be forced to tick a checkbox for your agreements. You can define a page to be linked to for agreements for domain registration, domain transfers and/or hosting. The link and the checkbox will only be displayed if you have defined a link. $agreements="agreements.html"; If you do not need to use of this option then comment the line out as required. Other settings: There are a few settings that we still need to set which will be found below the hosting packages variables as follows. $vendorcompany="Your Company Name"; $vendoremail="sales@yoursite.com"; $attachment = ""; $sendtoorder="order@yoursite.com"; $columns=5; $asymbol="$"; $currency="USD"; $tax="0"; $freedomain=""; $hostingrequired=""; $bannedemails=""; $vendoremail This is the email address which is your customers will contact with you. $vendorcompany This is your company name. $attachment This is the attachment that will be added into customer email(for example: /tmp/image.jpg). Blank it if does not required(recommended). $sendtoorder This is the email address where you would like the order details to be sent. $columns This is the number of columns of domain extension checkboxes to display underneath the domain entry field. For example below there are 5 columns of checkboxes. $asymbol Symbol to use for currency. It shows at left corner of prices. Blank it if does not required. $currency Name to use for currency. It shows at right corner of prices. Blank it if does not required. $tax Tax(%) to be added at checkout (It must be 0 if you will not use). $freedomain Set it as Y to provide free domain(registration/transfer) with hosting plans. Blank it if does not required. $hostingrequired Set it as Y if domains must have hosting plans selected in order to check out. Blank it if does not required. $bannedemails You can stop giving orders from specific email addresses. Separate each phrase with commas(for example: buyers@email.com, buyers@email2.com). Payment Process Settings: DHCart currently supports 2checkout.com, paypal.com, moneybookers.com, nochex.com, manuel processing and one of another payment gateway. Using 2checkout.com To accept payments by 2checkout.com set the following variables. $Use2CO=""; $vendorid2co="12345"; $rate2co="1.00"; $Use2CO Set as Y if you will accept payments by 2checkout.com. Blank it if you won't. $vendorid2co Your 2checkout vendor ID $rate2co If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00. Using Paypal.com To accept payments by Paypal.com set the following variables. $UsePaypal="Y" $paypalemail="paypal@yoursite.com"; $paypalcurrency="USD"; $paypalrate="1.00"; $paypalreturn="http://www.yoursite.com/ok.h tm"; $paypalcancel="http://www.yoursite.com/can.htm"; $paypaldesc="Web Services"; $UsePaypal Set as Y if you will accept payments by Paypal.com. Blank it if you won't. $paypalemail This is the Paypal account (email address) used to receive payment. $paypalcurrency Set as USD,GBP,EUR,CAD or JPY $paypalrate If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00. $paypalreturn This is the full URL that Paypal will go to after a successful sale. $paypalcancel This is the full URL that Paypal will go to if the user cancels payment at any point. $paypaldesc This is the product description shown on the checkout page of paypal.com. Using Moneybookers.com To accept payments by Moneybookers.com set the following variables. $UseMoneybookers=""; $moneybookersemail="moneybookers@yoursite.com"; $moneybookerscurrency="USD"; $moneybookersrate="1.00"; $moneybookerslanguage=""; $moneybookersreturn="http://www.yoursite.com/ok.htm"; $moneybookerscancel="http://www.yoursite.com/can.htm"; $moneybookersdesc="Web Services"; $UseMoneybookers.com Set as Y if you will accept payments by Moneybookers.com. Blank it if you won't. $moneybookersemail Your Moneybookers.com email address to receive payments $moneybookerscurrency Set as USD, GBP, EUR, AUD, CAD, JPY, HKD, SGD, CHF, DKK, SEK, SEK, XCD, MYR, NZD, TWD, THB, CZK, SKK, HUF, BGN, EEK, EEK, LVL or ZAR. $moneybookersrate If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00. $moneybookerslanguage Set as EN, DE, ES, FR or IT $moneybookersreturn This is the full URL that Moneybookers.com will go to after a successful sale. $moneybookerscancel This is the full URL that Moneybookers.com will go to if the user cancels payment at any point. $moneybookersdesc This is the product description shown on the checkout page of Moneybookers.com. Using Nochex.com To accept payments by Nochex.com set the following variables. $UseNochex=""; $nochexrate="1.00"; $nochexemail="nochex@yoursite.com"; $nochexdesc="Web Services"; $nochexreturn="http://www.yoursite.com/ok.htm"; $nochexcancel="http://www.yoursite.com/can.htm"; $UseNochex Set as Y if you will accept payments by Nochex.com. Blank it if you won't. $nochexrate If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00. $nochexemail This is the Nochex account (email address) used to receive payment. $nochexdesc This is the product description shown on the checkout page of nochex.com. $nochexreturn This is the full URL that Nochex will go to after a successful sale. $nochexcancel This is the full URL that Nochex will go to if the user cancels payment at any point. Using E-Gold.com To accept payments by E-Gold.com set the following variables. $UseEgold=""; $egoldrate="1.00"; $PAYEE_ACCOUNT="12345"; $PAYEE_NAME="Your Company Name"; $STATUS_URL="mailto:sales@yoursite.com"; $PAYMENT_URL="http://www.yoursite.com/ok.htm"; $NOPAYMENT_URL="http://www.yoursite.com/can.htm"; $UseEgold Set as Y if you will accept payments by E-Gold. Blank it if you won't. $egoldrate If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00. $PAYEE_ACCOUNT Your E-Gold account number $PAYEE_NAME The name you wishes to have displayed as the Payee on the E-Gold payment form. $STATUS_URL Your payment status url or email. Set it as NULL if you don't use this feature. $PAYMENT_URL full URL to return to after transaction $NOPAYMENT_URL full URL to return to if user cancels transaction Manual payment processing If you wish to process payments manually set the following variables. $UseManual="Y"; $manualreturn=http://www.yoursite.com/thanks.htm; $UseManual Set as Y if you wish to process payments manually. Blank it if you don't. $manualreturn This is the full URL that the user will be taken to after checkout. Your payment gateway To accept payments by your payment gateway set the following variables. $UseCC=""; $ccrate="1.00"; $ccurl="http://www.yourpaymentgateway.com"; $order_number_field="order_number"; $total_field="total"; $recurring_total_field="recurrtotal"; $other_fields=""; $UseCC Set as Y if you will accept payments by your payment gateway. Blank it if you won't. $ccrate If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00. $ccurl The url of your payment gateway or form. $order_number_field The field name of order number value. $total_field The field name of total fee value. $recurring_total_field The field name of monthly recurring total fee value. $other_fields Other field names that required together with their values (for example: cancel_url=http://www.yoursite.com/can.htm&return_url=http://www.yoursite.com/ok.htm) // Coupon Module $couponcode = ""; $applicablecoupontodomain = ""; $applicablecoupontohosting = "Y"; $couponvalue = "0"; $coupontype = "P"; $couponcode Coupon code. Blank it if does not required. $applicablecoupontodomain Set it as Y if coupon is applicable to domain registration and transfer. Blank it if does not required. $applicablecoupontohosting Set it as Y if coupon is applicable to hosting. Blank it if does not required. $couponvalue Set value of your coupon code($/%). Set it as 0 if does not required. $coupontype Set it as D for dollar(money) or P for Percentage(%). Blank it if does not required. Adding DHCart to Your Page: Now we have setup config.php you are ready to add the shopping cart to your site. First of all save the changes you have made to config.php. Open order.php file in a text editor such as Notpad. Remove the text "Customize the HEADER of your page" and paste your header html/xhtml code instead of it. Then Remove the text "Customize the FOOTER of your page" and paste your footer html/xhtml code instead of it. Finally upload your page and the following files which all need to be in the same directory on the server. Make sure you use the ascii (or text) method for FTP upload. dhcart.php dhcart.css order.php (you can change the file name like you wish) config.php whois_servers.php language.php phpmailer folder and the all files that's in. loading.gif Separate pricing for short domain names: Some registrars have higher pricing for short domain names. DHCart supports separate pricing if required. To add separate pricing you need to add a separate section to the $register entry for the domain extension separated by a comma as follows: $register[]=".cd,1:2,39.99:74.99,length(1-3)=79.99:149.99"; The new section, length(1-3)=79.99:149.99, tells Whois to use the higher pricing for domain names between 1 and 3 characters in length. You can add one length command to any domain extension as required. --------------------------------------------------------------------------------- Chapter 2 Customising DHCart --------------------------------------------------------------------------------- You can change size and colors of the text and tables by editing dhcart.css file. To help you we have separated all of the English text, the fields used on the order form and the email messages and placed them in a separate language file called "language.php". This enables you to easily translate the text into other languages, modify the emails sent to clients and also to add or remove entry fields used on the order form. Translating Into Other Languages: To translate the script first open up language.php in a text editor and save it with a new name such as french.php etc. You will find each phrase used in the script has an entry similar to the following. $lang_order_summary = "Order Summary"; Simply modify the text within the quotation marke after the equals sign. Modifying The Order Form Fields: You can easily add or remove entry fields from the order form. To do this open up the language file and scroll down to find the entry field definitions which look as follows. $cform[] = "name,Contact Person,You must enter your name"; As you can see this is split into three comma separated parts. The first part specifies the html field name. The second specifies the label displayed on the screen. The third specifies the javascript warning to be displayed if the user tries to leave the field empty. Leave the warning blank if the field can be left blank (such as fax etc). For the name and email fields you must use the html field names 'name' and 'email' although you can obviously translate the displayed labels as required. This is because the script requires these two fields. You can add, remove or edit fields as required. Modifying The Email Messages: The subject and text of the email messages sent to the client and vendor confirming the order can easily be modified. Open up the language file and scroll down to the customer or vendor email section as required. The first line defines the subject of the email. The rest of the lines define the body text of the email. Within the text you can get Whois to automatically insert data using the following variables. !!!vendorcompany!!! You company name !!!vendoremail!!! You company email address !!!ordnum!!! The unique Whois order no !!!orderdetails!!! Full order details will be inserted here. This should be on a blank line. !!!ipaddress!!! Users IP address !!!name!!! Customer name !!!formfields!!! This will insert all of the entered data from the order form. This variable should be on a blank line.