PDG Commerce Technical Reference Guide PDG Software, Inc. 1751 Montreal Circle, Suite B Tucker, Georgia 30084-6802 Copyright ©2014 PDG Software, Inc.; All rights reserved. PDG Software, Inc. (“PDG Software”) retains all ownership rights to the software programs (referred to herein as “Software”) offered by PDG Software and related documentation. Use of the Software and related documentation is governed by the license agreement accompanying the Software and applicable copyright law. THIS DOCUMENTATION IS PROVIDED “AS-IS” WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL PDG SOFTWARE BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF USE OR DATA, INTERRUPTION OF BUSINESS, OR FOR INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY KIND, ARISING FROM ANY ERROR IN THIS DOCUMENTATION. PDG Software, Inc. http://www.pdgsoft.com Contents Chapter 1 Introduction Chapter 2 CGI and Cookies 9 11 A Note About Cookie Usage ..............................................................................12 Chapter 3 Country List 13 Chapter 4 HTML Template Files 27 New Functions in PDG Commerce ....................................................................28 Include and CGI Tags .........................................................................................32 Universal Tags ....................................................................................................33 Basket Template File ..........................................................................................40 AddItem Template File .......................................................................................59 Inventory Option Template File .........................................................................62 Item Template File..............................................................................................62 MultiAdd Template File .....................................................................................80 Checkout Template File......................................................................................83 Verify Template File...........................................................................................96 ThankYou Template File ..................................................................................114 DenyCredit Template File ................................................................................129 AcceptCredit Template File..............................................................................131 Search Results Template...................................................................................131 Templates Specific to Internet Payment Services.............................................142 Category Template............................................................................................142 ShipCompare Template ....................................................................................144 Verify - Inventory Error Template....................................................................146 Error Template ..................................................................................................147 Anonymous Checkout Template File ...............................................................148 UPS Track Template File .................................................................................149 UPS Tracking Result Template File .................................................................149 UPS Address Validation Template File............................................................150 Email Templates ...............................................................................................151 SSL Templates ..................................................................................................152 Empty Templates ..............................................................................................153 Site Design Templates ......................................................................................154 User Database Templates..................................................................................155 User Database Template Tags ..........................................................................163 Multiple Shipping Templates............................................................................166 Multiple Shipping Template Tags ....................................................................174 Chapter 5 PDG Commerce Actions 177 Pricing Category Code......................................................................................178 Search Action....................................................................................................178 PreAdd Action ..................................................................................................181 MultiPreAdd Action .........................................................................................183 Add Action........................................................................................................184 MultiAdd Action...............................................................................................187 MAdd.[#] Action ..............................................................................................190 OptFullAdd Action ...........................................................................................192 OAdd Action.....................................................................................................195 Remove Action .................................................................................................196 RemoveAll Action ............................................................................................196 Display Action ..................................................................................................197 Recalc Action....................................................................................................198 Return Action....................................................................................................199 Checkout Action ...............................................................................................199 Verify Action ....................................................................................................200 BuyIt Action .....................................................................................................207 ListCategories Action .......................................................................................215 Login Action .....................................................................................................216 UPS Tracking Action........................................................................................217 Register Action .................................................................................................219 NewGuest Action..............................................................................................220 Logout Action ...................................................................................................221 SetBasket Action...............................................................................................221 RegisterNewUser Action ..................................................................................221 DisplayUser Action...........................................................................................223 UpdateCustDetails Action ................................................................................223 UpdateContact Action.......................................................................................224 AddNewContact Action....................................................................................226 RemoveContact Action.....................................................................................226 SplitAddress Action ..........................................................................................226 UseShipForBill Action .....................................................................................227 UseBillForShip Action .....................................................................................227 EmailAccountInfo Action.................................................................................227 Commerce Action Examples ............................................................................228 Chapter 6 Softgood Data Tags 231 !---INVOICE---.................................................................................................231 !---SKU--- .........................................................................................................231 !---QTY--- .........................................................................................................232 !---SCRIPT-NAME--- ......................................................................................232 !---DELIVERPAYLOAD--- .............................................................................232 !---EXEC---.......................................................................................................232 Chapter 1 Introduction What is the Technical Reference Guide? T his guide has been prepared for use by technical support staff, or advanced users, who may need technical information about PDG Commerce. The Technical Reference Guide will help you with customizing certain areas of your PDG Commerce. It should also give you a better understanding as to how PDG Commerce works. This guide is intended for users of PDG Commerce who have an advanced understanding of how Web sites work, such as Web masters, site administrators and IT professionals. This Technical Reference Guide assumes that you have already read the PDG Commerce User Guide. The PDG Commerce Technical Reference Guide is divided into six chapters: • • • • • • Introduction CGI and Cookies Country List HTML Template Files Cart Actions Softgoods At PDG we want to make sure that you get the most out of our software. That is why we’ve provided this and other manuals to help you better understand our products many features. Other guides you may find useful are: • • • • PDG Commerce Installation Guide PDG Commerce Upgrade Guide PDG Commerce User Guide PDG Create Database Utility Guide PDG Commerce -- Technical Reference Guide 9 Chapter 1 -- Introduction • • • • • • 10 PDG External Data Wizard Guide PDG Key Manager Guide PDG Permissions Guide Dreamweaver Component Guide FrontPage Component Guide NetObjects Component Guide PDG Commerce -- Technical Reference Guide Chapter 2 CGI and Cookies What is CGI? T he Common Gateway Interface (known as ‘CGI’) is a standard method of writing software that can receive data from a Web server. CGI programs are programs written to receive data from a Web server in order to perform additional processing on the data. This processing can be implemented to store the information, perform some operation on the data, and/or return results of the operation back to the Web server to be sent to the end user. CGI programs allow Webmasters and Web site owners to extend their Web site's functionality beyond traditional HTML. Because CGI programs are software programs, they must be written and developed. CGI programs can be written in almost any language: C, C++, Basic, Shell script (for Unix users), Perl (for Unix users and, now, a growing segment of NT users), and other languages as well. Typically, CGI programs are custom developed for a Web site, meeting the exact requirements dictated by the Webmaster. However, there is a growing collection of pre-made CGI programs. Pre-made CGI programs offer advantages and disadvantages over custom CGI programs. Pre-made CGI programs may not fit every requirement needed or dictated by a Webmaster. However, pre-made CGI programs are usually tested more thoroughly and are used by more than just one Web site. Pre-made CGI programs may also be backed by a company, with technical support and/or money back guarantees. PDG Commerce is the latter. PDG Commerce is a pre-made and prepackaged CGI program. PDG Commerce -- Technical Reference Guide 11 Chapter 2 -- CGI and Cookies A Note About Cookie Usage PDG Commerce uses cookies, which have been used controversially by some Web sites to obtain marketing information without the visitor's knowledge. PDG Commerce uses cookies so that a customer's cart can be remembered between visits. No other information is used in the cookie for any purpose. Customers and Web site administrators may verify this with any of the popular ‘cookie administration’ programs currently available on the market. Under no circumstance can a cookie load or execute a virus on your system, nor can it read and send files or data through the Internet. A wealth of information on cookies can be found at Cookie Central, at http://www.cookiecentral.com. This site contains valuable and meaningful information on cookies, and lists all of the details of cookies, including what they are, what they do, and what they cannot do. Also realize that cookies are used extensively on some very popular and large Web stores, including Amazon.com. By using cookies, they are better able to serve their customers and increase business and revenue. 12 PDG Commerce -- Technical Reference Guide Chapter 3 Country List T he following table provides the complete list of countries that PDG Commerce recognizes for its various operations and actions. These codes are used in all shipping & handling rules, as well as for UPS and USPS pricing of international shipments. The Index is used for the Default_Country Key found in the Shopper.conf file. Code Country 1 Abu Dhabi (United Arab Emirates) 2 Admiralty Islands (Papua New Guinea) 3 Afganistan 4 Aitutaki (Cook Islands) (New Zealand) 5 Ajman (United Arab Emirates) 6 Aland Island (Finland) 7 Albania 8 Alderney, Channel Islands (Great Britain) 9 Algeria 10 Alhucemas (Spain) 11 Alofi Island (New Caledonia) 12 Andaman Islands (India) 14 Andorra 15 Angola 16 Anguilla 17 Anjouan (Comoros) PDG Commerce Technical Reference Guide 13 Chapter 3 -- Country List 14 Code Country 18 Annobon Island (Equitorial Guinea) 19 Antigua & Barbuda 20 Argentia 21 Armenia 22 Aruba 23 Ascension 24 Astypalaia (Greece) 25 Atafu (Western Samoa) 26 Australia 27 Austria 28 Avarua (New Zealand) 29 Azerbaijan 30 Azores 31 Bahamas 32 Bahrain 33 Balearic Islands (Spain) 34 Baluchistan (Pakistan) 35 Bangladesh 36 Banks Island (Vanuatu) 37 Barbados 38 Barbuda (Antigua & Barbuda) 39 Barthelemy (Guadeloupe) 40 Belarus 41 Belgium 42 Belize 43 Benin 44 Bermuda 45 Bhutan 46 Bismark Archipelago (Papua New Guinea) 47 Bolivia 48 Bonaire (Netherlands Antilles) 49 Borabora (French Polynesia) 50 Borneo (Kalimantan) (Indonesia) 51 Borneo (North) (Malaysia) 52 Bosnia-Herzegovina 53 Botswana 54 Bougainville (Papua New Guinea) PDG Commerce -- Technical Reference Guide Chapter 3 -- Country List Code Country 55 Bourbon (Reunion) 56 Brazil 57 British Guiana (Guyana) 58 British Honduras (Belize) 59 British Virgin Islands 60 Brunei Darussalam 61 Buka (Papua New Guinea) 62 Bulgaria 63 Burkina Faso 64 Burma 65 Burundi 66 Caicos Islands (Turks & Caicos Islands) 67 Cambodia 68 Cameroon 69 Canada 70 Canary Islands (Spain) 71 Canton Island (Kiribati) 72 Cape Verde 73 Cayman Islands 74 Central African Republic 75 Ceuta (Spain) 76 Ceylon (Sri Lanka) 77 Chad 78 Chaferinas Islands (Spain) 79 Chalki (Greece) 80 Channel Islands (Jersey, Guernsey, Alderney and Sark) (Great Britain) 81 Chile 82 China 83 Christmas Island (Australia) 84 Christmas Island (Kiribati) 85 Cocos Island (Australia) 86 Columbia 87 Comoros 88 Congo (Brazzaville), Republic of the 89 Congo, Democratic Republic of the 90 Cook Islands (New Zealand) 91 Corisco Island (Equitorial Guinea) PDG Commerce -- Technical Reference Guide 15 Chapter 3 -- Country List 16 Code Country 92 Corsica (France) 93 Costa Rica 94 Cote d’Ivoire (Ivory Coast) 95 Crete (Greece) 96 Croatia 97 Cuba 98 Cumino Island (Malta) 99 Curacao (Netherland Antilles) 100 Cyjrenaica (Libia) 101 Cyprus 102 Czech Republic 103 Dahomey (Benin) 104 Damao (India) 105 Danger Islands (New Zealand) 106 Denmark 107 Desirade Island (Guadeloupe) 108 Diu (India) 109 Djibouti 110 Dodecanese Ilands (Greece) 111 Doha (Qatar) 112 Dominica 113 Dominican Republic 114 Dubai (United Arab Emirates) 115 East Timor (Indonesia) 116 Ecuador 117 Egypt 118 Eire (Ireland) 119 El Salvador 120 Ellice Islands (Tuvalu) 121 Elobey Islands (Equitorial Guinea) 122 Enderbury Islands (Kiribati) 123 England (Great Britain and Northern Ireland) 124 Equitorial Guinea 125 Eritrea 126 Estonia 127 Ethopia 128 Fakaofo (Western Samoa) PDG Commerce -- Technical Reference Guide Chapter 3 -- Country List Code Country 129 Falkland Islands 130 Fanning Island (Kiribati) 131 Faroe Islands 132 Fernando Po (Equitorial Guinea) 133 Fezzan (Libya) 135 Fiji 136 Finland 137 Formosa (Taiwain) 138 France 139 French Guiana 140 French Oceania (French Polynesia) 141 French Polynesia 142 French Somaliland (Djibouti) 143 French Territory of the Afars and Issas (Djibouti) 144 French West Indies (Guadeloupe) 145 Friendly Islands (Tonga) 146 Fujairah (United Arab Emirates) 147 Futuna (Wallis and Futuna Islands) 148 Gabon 149 Gambia 150 Gambier (French Polynesia) 151 Georgia, Republic of 152 Germany 153 Ghana 154 Gilbraltar 155 Gilbert Islands (Kiribati) 156 Goa (India) 157 Gozo Island (Malta) 158 Grand Comoro (Comoros) 159 Great Britain and Northern Ireland 160 Greece 161 Greenland 162 Grenada 163 Gernadines (St. Vincent & the Grenadines) 164 Guadeloupe 166 Guatemala 167 Guernsey, Channel Islands (Great Britain) PDG Commerce -- Technical Reference Guide 17 Chapter 3 -- Country List 18 Code Country 168 Guinea 169 Guinea-Bissau 170 Guyana 171 Hainan Island (China) 172 Haiti 173 Hashemite Kingdom (Jordan) 174 Hervey (Cook Islands) (New Zealand) 175 Hivaoa (French Polynesia) 176 Holland (Netherlands) 177 Honduras 178 Hong Kong 179 Huahine (French Polynesia) 180 Huan Island (New Caledonia) 181 Hungary 182 Iceland 183 India 184 Indonesia 185 Iran 186 Iraq 187 Ireland 188 Irian Barat (Indonesia) 189 Isle of Man (Great Britain) 190 Isle of Pines (New Caledonia) 191 Isle of Pines, West Indies (Cuba) 192 Israel 193 Italy 194 Jamaica 195 Japan 196 Jersey (Channel Islands) (Great Britain) 197 Johore (Malaysia) 198 Jordan 199 Kalymnos (Greece) 200 Kampuchea (Cambodia) 201 Karpathos (Greece) 202 Kassos (Greece) 203 Kastellorizon (Greece) 204 Kazakhstan PDG Commerce -- Technical Reference Guide Chapter 3 -- Country List Code Country 205 Kedah (Malaysia) 206 Keeling Islands (Australia) 207 Kelantan (Malaysia) 208 Kenya 209 Kiribati 210 Korea, Democratic People’s Republic of (North Korea) 211 Korea, Republic of (South Korea) 212 Kos (Greece) 214 Kowloon (Hong Kong) 215 Kuwait 216 Kyrgyzstan 217 Labrador (Canada) 218 Labuan (Malaysia) 219 Laos 220 Latvia 221 Lebanon 222 Leipsos (Greece) 223 Leros (Greece) 224 Les Saints Island (Guadeloupe) 225 Lesotho 226 Liberia 227 Libya 228 Liechtenstein 229 Lithuania 230 Lord Howe Island (Australia) 231 Loyalty Islands (New Caledonia) 232 Luxemburg 233 Macao 234 Macau (Macao) 235 Macedonia, Republic of 236 Madagascar 237 Maderia Islands (Portugal) 238 Madeira Islands 239 Malacca (Malaysia) 240 Malagasy Republic (Madagascar) 241 Malawi 242 Malaya (Malaysia) PDG Commerce -- Technical Reference Guide 19 Chapter 3 -- Country List 20 Code Country 243 Malaysia 244 Maldives 245 Mali 246 Malta 247 Manahiki (New Zealand) 248 Manchuria (China) 249 Mangaia (Cook Islands) (New Zealand) 250 Manuai (Cook Islands) (New Zealand) 251 Marie Galante (Guadeloupe) 252 Marquesas Islands (French Polynesia) 254 Martinique 255 Mauke (Cook Islands) (New Zealand) 256 Mauritania 257 Mauritius 258 Mayotte (France) 259 Melilla (Spain) 260 Mexico 261 Miquelon (St. Pierre and Miquelon) 262 Mitiaro (Cook Islands) (New Zealand) 263 Moheli (Comoros) 264 Moldova 265 Monaco (France) 266 Mongolia 267 Montserrat 268 Moorea (French Polynesia) 269 Morocco 270 Mozambique 271 Muscat (Oman) 272 Myanmar (Burma) 273 Namibia 274 Nansil Islands (Ryukyu Islands) (Japan) 275 Nauru 276 Negri Sembilan (Malaysia) 277 Nepal 278 Netherlands 279 Netherlands Antilles PDG Commerce -- Technical Reference Guide Chapter 3 -- Country List Code Country 280 Netherlands West Indies (Netherlands Antilles) 281 Nevis (St. Christopher and Nevis) 282 New Britain (Papua New Guinea) 283 New Caledonia 284 New Hanover (Papua New Guinea) 285 New Hebrides (Vanuatu) 286 New Ireland (Papua New Guinea) 287 New South Wales (Australia) 288 New Zealand 289 Newfoundland (Canada) 290 Nicaragua 291 Niger 292 Nigeria 293 Nissiros (Greece) 294 Niue (New Zealand) 295 Norfolk Island (Australia) 296 North Borneo (Malaysia) 297 North Korea (Korea, Democratic People’s Republic of) 298 Northern Ireland (Great Britain and Northern Ireland) 300 Norway 301 Nukahiva (French Polynesia) 302 Nukunonu (Western Samoa) 303 Nyasaland (Malawi) 304 Ocean Island (Kiribati) 305 Okinawa (Ryukyu Islands) (Japan) 306 Oman 307 Pahang (Malaysia) 308 Pakistan 309 Palmerston (Avarua) (New Zealand) 311 Panama 312 Papua New Guinea 313 Paraguay 314 Parry (Cook Islands) (New Zealand) 315 Patmos (Greece) 316 Pemba (Tanzania) PDG Commerce -- Technical Reference Guide 21 Chapter 3 -- Country List 22 Code Country 317 Penang (Malaysia) 318 Penghu Iaslands (Taiwan) 319 Penon de Velez de la Gomera (Spain) 320 Penrhyn (Tongareva) (New Zealand) 321 Perak (Malaysia) 322 Perlis (Malaysia) 323 Persia (Iran) 324 Peru 325 Pscadores Islands (Taiwan) 326 Petite Terre (Guadeloupe) 327 Philippines 328 Pitcairn Island 329 Poland 331 Portugal 332 Province Wellesley (Malaysia) 333 Pukapuka (New Zealand) 335 Qutar 336 Queensland (Australia) 337 Quemoy (Taiwan) 338 Raiatea (French Polynesia) 339 Rakaanga (New Zealand) 340 Rapa (French Polynesia) 341 Rarotonga (Cook Islands) (New Zealand) 342 Ras al Kaimah (United Arab Emirates) 343 Redonda (Antigua & Barbuda) 344 Reunion 345 Rhodesia (Zimbabwe) 346 Rio Muni (Equitorial Guinea) 347 Rodos (Greece) 348 Rodrigues (Mauritius) 349 Romania 351 Russia 352 Rwanda 353 Saba (Netherlands Antilles) 354 Sabah (Malaysia) 356 Saint Bartholomew (Guadeloupe) 357 Saint Christopher (St. Kitts) and Nevis PDG Commerce -- Technical Reference Guide Chapter 3 -- Country List Code Country 359 Saint Eustatius (Netherlands Antilles) 360 Saint Helena 362 Saint Kitts (St. Christopher and Nevis) 363 Saint Lucia 364 Saint Maarten (Netherlands Antilles) 365 Saint Martin (French part) (Guadeloupe) 366 Saint Martin (Netherlands part) (Netherlands Antilles) 367 Saint Pierre and Miquelon 369 Saint Vincent & the Grenadines 371 Salvador (El Salvador) 372 San Marino 373 Santa Cruz Islands (Soloman Island) 374 Sao Tome and Principe 375 Sarawak (Malaysia) 376 Sark, Channel Islands (Great Britain) 377 Saudi Arabia 378 Savage Island (Niue) (New Zealand) 379 Savaii Island (British) (Western Samoa) 380 Scotland (Great Britain and Northern Ireland) 381 Selangor (Malaysia) 382 Senegal 383 Serbia-Montenegro 384 Seychelles 385 Sharja (United Arab Emirates) 386 Shikoku (Japan) 387 Siam (Thailand) 388 Sierra Leone 389 Sikkim (India) 390 Singapore 391 Slovak Republic 392 Slovenia 393 Society Islands (French Polynesia) 394 Solomon Islands 395 Somali Democratic Republic (Somalia) 396 Somalia 397 Somaliland (Somalia) 398 South Africa PDG Commerce -- Technical Reference Guide 23 Chapter 3 -- Country List 24 Code Country 399 South Australia (Australia) 400 South Georgia (Falkland Islands) 401 South Korea (Korea, Republic of) 402 South-West Africa (Namibia) 403 Spain 404 Spitzbergen (Norway) 405 Sri Lanka 406 Ste. Marie de Madagascar (Madagascar) 407 Sudan 408 Suriname 409 Suwarrow Islands (New Zealand) 410 Swan Islands (Honduras) 411 Swaziland 412 Sweden 413 Switzerland 414 Symi (Greece) 415 Syrian Arab Republic 416 Tahaa (French Polynesia) 417 Tahiti (French Polynesia) 418 Taiwan 419 Tajikistan 420 Tanzania 421 Tasmania (Australia) 422 Tchad (Chad) 423 Thailand 424 Thursday Island (Australia) 425 Tibet (China) 426 Tilos (Greece) 427 Timor (Indonesia) 429 Tobago (Trinidad & Tobago) 430 Togo 431 Tokelau (Union) Group (Western Samoa) 432 Tonga 433 Tongareva (New Zealand) 434 Tori Shima (Ryukyu Islands) (Japan) 435 Torres Island (Vanuatu) 436 Tortola PDG Commerce -- Technical Reference Guide Chapter 3 -- Country List Code Country 437 Trans-Jordan (Hashemite Knigdom) (Jordan) 438 Transkei (South Africa) 439 Trengganu (Malaysia) 440 Trinidad & Tobago 441 Tripolitania (Libya) 442 Tristan da Cunha 443 Trucial States (United Arab Emirates) 445 Tuamotou (French Polynesia) 446 Tubuai (French Polynesia) 447 Tunisia 448 Turkey 449 Turkmenistan 450 Turks & Caicos Islands 451 Tuvalu 452 Uganda 453 Ukraine 454 Umm al Quaiwain (United Arab Emirates) 455 Umm Said (Qatar) 456 Union Group (Western Samoa) 458 United Arab Emirates 459 Upolu Island (Western Samoa) 461 United States of America 462 Uruguay 464 Uzbekistan 465 Vanuatu 466 Vatican City 467 Venezuela 468 Victoria (Australia) 469 Vietnam 472 Wales (Great Britain and Northern Ireland) 473 Wallis & Futuna Islands 474 Wellesley, Province (Malaysia) 475 West New Guinea (Indonesia) 476 Western Australia (Australia) 477 Western Samoa 479 Yemen 480 Zafarani Islands (Spain) PDG Commerce -- Technical Reference Guide 25 Chapter 3 -- Country List 26 Code Country 482 Zambia 483 Zanzibar (Tanzania) PDG Commerce -- Technical Reference Guide Chapter 4 HTML Template Files W hen customers shop within your Web store, PDG Commerce displays information about products and orders using HTML templates. Although PDG Commerce comes with default HTML templates for you to use, the information provided in this chapter will aid you in creating your own templates, or modifying the existing default templates. The HTML templates used within PDG Commerce are very similar to normal HTML pages – with one exception: the HTML template files have, embedded in them, special tags which carry the functionality of PDG Commerce. When PDG Commerce encounters these tags, it replaces the tag with the corresponding information concerning the customer's cart or order. The information that PDG Commerce displays depends on the tag used. There are many different HTML templates that can be used by PDG Commerce: • • • • • • • • • • • Basket template Basket Empty template Add Item template Item template MultiAdd template Checkout template Verify template Alternate SSL Checkout template Alternate SSL Verify template Thank You template Deny Credit template (when PDG Commerce is configured to interact with Internet payment services) PDG Commerce -- Technical Reference Guide 27 Chapter 4 -- HTML Template Files • Accept Credit template (when PDG Commerce is configured to interact with Internet payment services) • • • • • • • • • • • • • • Templates related to a specific Internet payment service SSL Thank You template Search Results template Search Results Empty template Category template ShipCompare template (for use with UPS or USPS when comparing rates) Verify - Inventory Error template Error template Anonymous Checkout template Alternate SSL Anonymous Checkout template UPS Track template UPS Tracking Result template UPS Address Validation template HTML Email Templates There are literally dozens of tags that can be used within these templates – many of which are interchangeable. We will discuss which tags may be used when each template is covered in this chapter. First, let’s go over some new sets of tags that have been implemented for PDG Commerce. New Functions in PDG Commerce PDG Commerce allows you to format certain pages in your Web store in new ways. HTML templates which display multiple products, such as the Search Results template, can now incorporate the MultiAdd and OptFullAdd actions. Imagine showing your customers all of the option selections for a single product and allowing them to simply enter quantities and add them all to their carts with a single click. PDG Commerce has enabled this and other new functions through the use of the following four pairs of tags: • • • • • REPEAT Tags REPEAT NUMBER Tags OPTIONS Tags SEARCH ROW Tags RECIPIENT Tags We will now discuss the usage of each of these sets of tags as well as what templates they may be used in. For a list of the tags that can be used between these new sets of tags, see the section for the corresponding HTML Template. 28 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files ‘REPEAT’ Tags <!---BEGIN_REPEAT---> and <!---END_REPEAT---> These tags are to be used when displaying a list of different products for which you want to display the same type of information. We will call these the REPEAT tags, for convenience sake. The most common occurrence of the REPEAT tags will be in the Basket template. These tags may also appear on the MultiAdd template or between the ‘SEARCH ROW’ tags which appear on the Search Results template. The way these tags may be used will be explained in greater detail in each template’s section in this chapter. Instead of using the standard Basket Template tags, you can now format the output and look of the Basket template using the REPEAT tags. Any information that is called between the REPEAT tags will be called for all of the items in the customer’s cart until no products are left. Inserting an HTML table row between these tags will cause your customer’s cart to be formatted nicely in a HTML table. Once you have formatted the output of the basket, you can use the standard Basket Template tags outside of the REPEAT tags to call the order’s total, discount information, etc. For example: <!---BEGIN_REPEAT---> [product data] <!---END_REPEAT---> <!---SUBTOTAL---> <!---ADD_SHIPPING_TOTAL---> This syntax in the Basket template would yield the customer’s current cart (see the ‘Basket HTML Template’ section below for a list of the Basket Repeat tags) followed by the subtotal of all of the items, and finally, any additional shipping charges incurred by any of the items in the order. The ‘product data’ that will be displayed for each product in the basket comes from the Basket Repeat template tags, while these last two items are called by the standard Basket Template tags. The Search Results template file also utilizes repeating style tags. These are “<!---BEGIN_SEARCH_ROW--->” and “<!---END_SEARCH_ROW--->”. For a list of tags that can be used between these REPEAT-style tags, see the section corresponding to the HTML template with which you are working. PDG Commerce -- Technical Reference Guide 29 Chapter 4 -- HTML Template Files ‘REPEAT ITEM’ Tags The REPEAT ITEM tags perform the same function as the REPEAT tags on a Search Results or Multiadd page. The <!---BEGIN_REPEAT_ITEM---> tag replaces the <!---BEGIN_REPEAT---> tag, and it does not generate the hidden input fields for msku#. Instead, an additional tag exists to input the hidden msku# fields. The <!---SKU_INPUT---> tag must be entered within the <!---BEGIN_REPEAT_ITEM---> and <!---END_REPEAT---> tags to generate the appropriate hidden input fields to perform the multiadd function. The following is an example of the REPEAT ITEM tags: <!---BEGIN_REPEAT_ITEM---> [product data] <!----SKU_INPUT---> <!---END_REPEAT---> ‘REPEAT NUMBER’ Tags <!---BEGIN_REPEAT[x]---> and <!---END_REPEAT[y]---> These tags are to be used when you want to display several instances of the same product on a single page. These tags will generally be utilized in the Item template, and called into the Add Item template, when you want to allow a customer to add several different option combinations of the same product to their cart with a single click. When using the REPEAT NUMBER tags, the [x] and [y] must be replaced with non-negative integers where x < y. These numbers are used to tell PDG Commerce how many instances of the product to display. The REPEAT NUMBER tags allow you to create a page on your Web store with a complete product display and ‘Add’ button for each number between x and y, inclusive. For example: <!---BEGIN_REPEAT[0]---> [data] <!---END_REPEAT[3]---> The data that falls between the REPEAT NUMBER tags will be repeated four times (0,1,2,3). These numbers only serve as indexes for PDG Commerce to distinguish the product instances on the page. For each instance on the page, then, a customer can select different options and quantities and add them all to to their basket with a single click. 30 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Please see the Item template section to see which tags may be used between the REPEAT NUMBER tags. ‘OPTIONS’ Tags <!---BEGIN_OPTIONS---> and <!---END_OPTIONS---> These tags are used for displaying the options for your Web store’s products in a more streamlined manner. The OPTIONS tags can be used in either the Basket template, to display the selected options for items in the basket, or the Item template, to display options available in the multi-add outputs. For more information on how to use the OPTIONS tags, see the sections on the respective templates. ‘SEARCH ROW’ Tags <!---BEGIN_SEARCH_ROW---> and <!---END_SEARCH_ROW---> These tags are used exclusively on the Search Results template. The SEARCH ROW tags are implemented for formatting the Search Results page in a number of different ways. In order to indicate how many search results will appear on each page and in each row on that page, refer to the ‘Search Settings’ section in the PDG Commerce User Guide. These settings are kept in the Merchant Administrator. The REPEAT tags (embedded in the SEARCH ROW tags) will determine the output for each product on the Search Results template. The SEARCH ROW tags themselves can be used to determine how the information is formatted on the Search Results page. See the Search Results template section in this chapter for more information. ‘RECIPIENT’ Tags <!---BEGIN_RECIPIENT---> and <!---END_RECIPIENT---> These tags are to be used when displaying or requesting information for multiple shipping recipients. We will call these the RECIPIENT tags, for convenience. These tags can be used on any template used during the checkout process for a multiple shipment order. Instead of using the standard Basket Template tags, you can now display carts for multiple shipping receipients using the RECIPIENT tags. Any information that is called between the RECIPIENT tags will be called for each recipient’s cart until no recipients are left. You can use the standard Basket Template repeat tags inside of the RECIPIENT tags to call the product information for each recipient’s basket. PDG Commerce -- Technical Reference Guide 31 Chapter 4 -- HTML Template Files The RECIPIENT tags may also be used by the Checkout, SSL Checkout, Verify, SSL Verify, ThankYou, SSL ThankYou, and CreditAccept pages for multiple shipping recipients. Include and CGI Tags You can include html, text, or other files in your PDG Commerce templates, much like an ‘include’ within a server-side html page. This allows for common elements of your web store, such as a navigation bar, header, or footer, to be included throughout your web store templates. The format for this tag is “<!---#INCLUDE [filename]--->”, where “[filename]” is the name of the file to be included. The file must be located in your web store’s document filespace, and specifically not within the ‘PDG_Commerce’ folder. You can include subfolder information within the filename, however any filename that tries to traverse up folders will be ignored. Note that this only takes a file and embeds its contents verbatim into the template. It does not execute any programs or scripts. You can instruct PDG Commerce to retrieve information from a webserver (your own or another) to be embedded in a template. This allows you to embed another web page that contains server-side scripting, such as asp or php, into your templates. The format for this tag is “<!---#CGI [url]--->”, where “[url]” is the URL, complete or partial, to the cgi program or document to be retrieved from the webserver. The cgi program can be on a regular server, or on an SSL secured server. Here are some valid CGI examples: <!---#CGI http://www.somewhere.com/cgi/something.cgi---> This retrieves the output of the cgi program ‘something.cgi’ from ‘www.somewhere.com’. <!---#CGI /cgi-bin/cgi-prog?name1=value1---> This retrieves the output of the cgi program ‘cgi-prog’ from your web server, passing ‘name1=value1’ to the cgi program. <!---#CGI https://www.yourstore.com/cgi/secured.cgi---> This retrieves the output of the cgi program ‘secured.cgi’ from ‘www.yourstore.com’ via an SSL connection. <!---#CGI /footer.asp---> This retrieves the output of the asp page ‘footer.asp’ from your web server. The web server will execute any asp code in the page. Note: If you execute scripts, embedding their output in a template, using the CGI tag, then please keep in mind that any HTML header information, such as setting cookies, will be ignored by PDG Commerce. 32 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Universal Tags PDG Commerce has template tags that can be inserted into any of your Web store’s dynamic templates. These tags call information about the customer’s current cart that can be displayed on PreAdd pages, the Basket page or any other page in your Web store that is generated via template. The Universal tags that come with PDG Commerce are: • • • • • • • • • • • • • • • • • • • • • • • !---SCRIPTNAME--!---SEC_SCRIPTNAME--<!---CURRENT_SUBTOTAL---> <!---CURRENT_ITEMS_NUM---> <!--ITEMRETURNURL---> !---SHOPSOMEMORE_LINK--!---#INCLUDE : This is discussed in detail earlier in this chapter. !---#CGI : This is discussed in detail earlier in this chapter. <!---ADD_WHOLE_PAGE_LINK---> !---USERNAME--!---USERMSG--!---HEADER--!---FOOTER--!---START_REGISTER_LINK--!---STATE_LIST--!---COUNTRY_LIST--!---FULL_URL--!---SEC_FULL_URL <!---LIST_CATEGORIES <!---STYLE_SHEET---> <!---DISPLAY_TEMPLATE <!---SITE_LOGO---> <!---SITE_TEXT---> We will now cover these tags in detail. !---SCRIPTNAME--This tag tells PDG Commerce to replace it with the location of PDG Commerce’s “commerce” executable. This tag can be used to call “commerce” from any one of your Web store’s templates or static pages. This tag will generally fall inside of an HTML ‘form’ tag, but may also be used with the ‘href’ tag as well. Below are two examples of how this tag may be used: PDG Commerce -- Technical Reference Guide 33 Chapter 4 -- HTML Template Files <form method=POST action="!---SCRIPTNAME---"> <input type=submit name="display" value="View My Cart"> </form> <a href="!---SCRIPTNAME---?display=action">View My Cart</a> The first example would produce a button on your page that, when clicked, would call PDG Commerce to display the customer’s current cart. The second example would create a text link that calls PDG Commerce to display the customer’s current cart. !---SEC_SCRIPTNAME--This tag tells PDG Commerce to replace it with the location of your PDG Commerce’s secure “commerce” executable. This tag can be used to call your secure “commerce” from any one of your Web store’s templates or static pages. This tag will generally fall inside of an HTML ‘form’ tag, but may also be used with the ‘href’ tag as well. Below are two examples of how this tag may be used: <form method=POST action="!---SEC_SCRIPTNAME---"> <input type=submit name="checkout" value="Secure Checkout"> </form> <a href="!---SEC_SCRIPTNAME---?checkout=action">Secure Checkout </a> The first example would produce a button on your page that, when clicked, would call PDG Commerce to proceed to your Web store’s secure checkout page. The second example would create a text link that calls PDG Commerce to proceed to your Web store’s secure checkout page. <!---CURRENT_SUBTOTAL---> Tag This tag can be used to display the subtotal of all of the items in the customer’s current cart. This subtotal only includes the price of the products (and any applicable options) that are in the customer’s cart. Sales tax, shipping charges and product discounts are not included in this value. The tag must appear in the template as: <!---CURRENT_SUBTOTAL---> Note: This tag may be appended with a “C”, <---CURRENT_SUBTOTALC--->. PDG Commerce will replace this tag with the current cart subtotal converted to the secondary currency. 34 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---CURRENT_ITEMS_NUM---> Tag This tag can be used to display the total number of items in the customer’s current cart. This total includes all quantities of all products that are in the customer’s cart. The tag must appear in the template as: <!---CURRENT_ITEMS_NUM---> !---SHOPSOMEMORE_LINK--- Tag This tag is replaced by a Shop Some More button. Please note that this tag is replaced with all the code to display the button as defined in the Merchant Administrator as well as the URL. The tag must appear in the template as: !---SHOPSOMEMORE_LINK--- <!---ITEMRETURNURL---> Tag This tag is replaced by a hidden field. It informs PDG Commerce of the “reference page” for the shopper. The reference page is the page which was being viewed prior to the AddItem page. Note that any URL entered into the “Destination of Shop Some More Button” field in the Cart Options section of the Merchant Administrator will override this reference page identifier. However, if the page was created dynamically, the user will be returned to the last statically created page. The tag must appear in the template file as: <!---ITEMRETURNURL---> <!---ADD_WHOLE_PAGE_LINK---> This tag is applicable to Search Result templates, and to all of the MultiAdd templates - both for adding multiple products at once, and adding multiple option combinations for a single product. This tag adds a submit button that allows everything on the page with a quantity greater than zero to be added. The tag must appear in the template as: !---ADD_WHOLE_PAGE_LINK--- <!---USERNAME---> This tag is replaced with the user’s Login ID for the PDG Commerce webstore. If the user is browsing the store anonymously (not logged in), then this tag is replaced with “Guest”. The tag must appear in the template as: !---USERNAME--- PDG Commerce -- Technical Reference Guide 35 Chapter 4 -- HTML Template Files <!---USERMSG---> This tag is used to display a customized message that contains the customer’s User ID. Inside this tag, you can place text that will be displayed. If the text contains “[USER]”, this is replaced with the customer’s User ID. If the user is browsing the store anonymously (not logged in), then the text “[USER]” is replaced with “Guest”. An example of this tag might be: <!---USERMSG Welcome, [USER], Thank you for shopping with us today. ---> <!---HEADER---> This tag is used to display the header file whose filename is specified in the Templates section of the Merchant Administrator. Include this tag on any custom PDG Commerce template that you want to display your header file. The tag must appear in the templates as: <!---HEADER---> <!---FOOTER---> This tag is used to display the footer file whose filename is specified in the Templates section of the Merchant Administrator. Include this tag on any custom PDG Commerce template that you want to display your footer file. The tag must appear in the templates as: <!---FOOTER---> <!---START_REGISTER_LINK---> This tag is used to display a link to the Registration template. Include this tag on any page on which you wish to provide your customers with an opportunity to register as a new user with your Web store. The tag must appear in the templates as: <!---START_REGISTER_LINK---> <!---STATE_LIST---> This tag is replaced by a drop down menu of the states entered in the StateList.txt file, located in the PDG_Commerce folder. This tag may be used for the billing state list and the shipping state list. The tag must appear in the template file as: 36 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <select name=”billstate”> <!---STATE_LIST---> </select> or <select name=”shipstate”> <!---STATE_LIST---> </select> <!---COUNTRY_LIST---> This tag is used to display a drop down menu containing all of the countries specified in the International section of your Merchant Administrator. For more information on editing the country list, see the International Settings section of the PDG Commerce User Guide. The tag must appear in the templates as: <!---COUNTRY_LIST---> !---FULL_URL--- Tag This tag tells PDG Shopping Cart to replace it with your web site’s domain name. This tag can be used on any one of your Web store’s templates. This tag may be used inside of an HTML ‘form’ tag and with the ‘href’ tag. Below are two examples of how this tag may be used: <form method=POST action="!---FULL_URL---!---SCRIPTNAME---"> <input type=submit name="checkout" value="Checkout"> </form> <a href=”!---FULL_URL---/index.html”>Home</a> The first example would produce a button on your page that, when clicked, would call PDG Shopping Cart to proceed to your Web store’s checkout page. The second example would display a link to your web site’s index page. In both cases, PDG Shopping Cart would use the absolute url path instead of a relative path. !---SEC_FULL_URL--- Tag This tag tells PDG Shopping Cart to replace it with your web site’s secure domain name. This tag can be used on any one of your Web store’s templates. This tag may be used inside of an HTML ‘form’ tag and with the ‘href’ tag. Below is an example of how this tag may be used: <a href=”!---SEC_FULL_URL---/index.html”>Home</a> This example would display a link to your web site’s secure index page, using the absolute url path to the secure web site instead of a relative path. PDG Commerce -- Technical Reference Guide 37 Chapter 4 -- HTML Template Files <!---LIST_CATEGORIES Tag This tag will be replaced by either the default or specified template to perform a list categories action, and the template will be displayed within the page containing this tag. For example, including this tag in a column on the page will use the template to display your PDG Shopping Cart’s category list in that column. When using this tag, you may either specify a template to display, or use only the tag to display the default Category template entered in the Cart Administrator. If specifying a template in the tag, the path is assumed to be relative to the web site’s root directory. The tag must appear in the template files in one of the following ways: <!---LIST_CATEGORIES---> <!---LIST_CATEGORIES PDGTemplates/CategoryList.html---> <!---STYLE_SHEET---> Tag When not using Site Design mode, this tag will be replaced with the contents of the pdgstyles.css style sheet file located in the PDG_Cart folder. You may create this file then include this tag on your templates to automatically import your style sheet. The tag must appear in the template file as: <!---STYLE_SHEET---> <!---DISPLAY_TEMPLATE---> Tag This tag will be replaced by a hidden input field in a form that will pass a specific template to be used to display the following page. For example, if you want to display a different template for a single search, but leave the default template for all other searches, you could include this tag in the search form and specify the template to be used. The path is assumed to be relative to the web site’s root directory. The tag must appear in the template file as: <!---DISPLAY_TEMPLATE PDGTemplates/SearchResult2.html---> <!---SITE_LOGO---> Tag This tag will be replaced by the image specified in the “Web Site Logo” field of the Cart Options. The tag must appear in the template file as: <img src=”!---SITE_LOGO---”> 38 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---SITE_TEXT---> Tag This tag will be replaced by the text entered in the “Web Site Text” field of the Cart Options. The tag must appear in the template file as: <!---SITE_TEXT---> ‘LOGGED IN’ Tags <!---IF_LOGGED_IN---> and <!---END_IF_LOGGED_IN---> These tags are to be used when displaying information that is only applicable when a customer is logged in to your web store. We will call these the LOGGED IN tags, for convenience. These tags can be used on any template displayed by the Commerce program. When the customer is logged in, you can provide specific options such as a 'Log Out' button, or a link to update their information. Any code that is entered between these two tags will be displayed only when the user is currently logged in. Any universal tags may be used within the <!--IF_LOGGED_IN---> and <!---END_IF_LOGGED_IN---> tags. The following example demonstrates a possible use of these tags: <!---IF_LOGGED_IN---> <a href="!---SCRIPTNAME---?displayuser=action">Update Information </a> <br> <a href="!---SCRIPTNAME---?logout=action"><img src="/images/ logout.gif" border=0></a> <!---END_IF_LOGGED_IN---> ‘NOT LOGGED IN’ Tags <!---IF_NOT_LOGGED_IN---> and <!---END_IF_NOT_LOGGED_IN ---> These tags are to be used when displaying information that is only applicable when a customer is not currently logged in to your web store. We will call these the NOT LOGGED IN tags, for convenience. These tags can be used on any template displayed by the Commerce program. When the customer is not logged in, you can provide specific options such as a 'Log In' or ‘Register’ button. Any code that is entered between these two tags will be displayed only when the user is not currently logged in. Any universal tags may be used within the <!---IF_NOT_LOGGED_IN---> and <!--END_IF_NOT_LOGGED_IN---> tags The following example demonstrates a possible use of these tags: PDG Commerce -- Technical Reference Guide 39 Chapter 4 -- HTML Template Files <!---IF_NOT_LOGGED_IN---> <a href="!---SCRIPTNAME---?login=action"><img src="/images/ login.gif" border=0></a> <br> <a href="!---SCRIPTNAME---?register=action><img src="/images/register.gif" border=0></a> <!---END_IF_NOT_LOGGED_IN---> Basket Template File The Basket Template File is used when PDG Commerce is called upon to display the contents of the customer's cart to the customer. The Basket Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer, it searches the HTML template file for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s browser. After receiving and processing the Display action, PDG Commerce uses the Basket HTML template file to display the resulting cart. The following are the standard Basket Template tags: • • • • • • • • • • • • • • • • • • • 40 <!---BASKET---> <!---DISPLAYCART---> <!---ADDITEMMSG---> <!---ADDITEMDATA---> <!---REMOVEALLMSG---> <!---SUBTOTAL---> <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> <!---PROD_CAT_QTY_DISC---> <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> !---SEC_SCRIPTNAME--<!---SEC_FORCE_DATA---> !---CHECKOUT_LINK--!---SECURE_CHECKOUT_LINK--!---REMOVE_ALL_LINK--!---RECALC_LINK--!---TRACK_ORDER_SUBMIT--- PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files PDG Commerce also accommodates the REPEAT and OPTIONS tags in the Basket HTML template file. See the end of this ‘Basket Template File’ section for more information on how these new tags may be used in the Basket template file. PDG Commerce is given the location of this template file through its key in the Shopper.Conf file. For more information on Shopper.Conf, you will need to contact PDG. A sample Basket Template File is included with PDG Commerce. The following is an example of the standard Basket template which displays the customer’s cart using the <!---BASKET---> tag. See the figure below for an example of a customized Basket template. Standard Basket Display <!---BASKET---> Tag This tag tells PDG Commerce to replace the tag with the contents of the customer's current cart. This output is formatted in a table. PDG Commerce also embeds “calls” back to itself in the output which allow users to remove items, change the quantities of items, remove all of the items, to proceed with purchasing the items in their cart, or to return to shopping. These calls are in the form of buttons on the bottom of the page. Because PDG Commerce displays the contents of the customer's cart in a table, the customer's Web browser must be capable of displaying tables. The tag must have its own line in the template file, and must appear as: <!---BASKET---> Note: When PDG Commerce encounters the <!---BASKET---> tag, it displays all of the product and order information. If this tag is used to display the customer’s cart, the use of the REPEAT tags (and subsequently the Repeat Basket template tags) will not be necessary. Likewise, if you plan on customizing you Basket template with the REPEAT tags, the <!---BASKET---> tag will not be necessary. PDG Commerce -- Technical Reference Guide 41 Chapter 4 -- HTML Template Files <!---DISPLAYCART---> Tag This tag works essentially the same way as the <!---BASKET---> tag. See above for an explanation. For consistency’s sake, it is recommended that you use either one or the other, and not both for displaying your customer’s cart. The tag must have its own line in the template file, and must appear as: <!---DISPLAYCART---> <!---ADDITEMMSG---> Tag This tag tells PDG Commerce to replace the tag with a special message only when items are added to the basket. If items are not being added to the basket, then this tag is ignored. The text to be displayed should be embedded in the tag, after the ADDITEMMSG and a colon. The tag must appear in the template file as: <!---ADDITEMMSG:[text]---> In the above example, [text] is the message to be displayed on the Basket page only if items are being added to the Cart. This tag is only processed if the item was added as a result of an Add action, and not of a MultiAdd action. <!---ADDITEMDATA---> Tag This tag tells PDG Commerce to replace the tag with a description and quantity of what items are being added to the cart. If items are not being added to the cart when it is called to be displayed, then this tag is ignored. The tag must appear in the template file as: <!---ADDITEMDATA---> An example of the above two tags used in conjunction might be: <!---ADDITEMMSG:The following has been added to your Cart: ---><br> <!---ADDITEMDATA---> This tag is only processed if the item was added as a result of an Add action, and not of a MultiAdd action. 42 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---REMOVEALLMSG---> Tag This tag tells PDG Commerce to replace the tag with a special message only when the cart is being emptied. If the cart is not being emptied, then this tag is ignored. The tag must appear in the template file as: <!---REMOVEALLMSG:[text]---> In the above example, [text] is the message that is to be displayed only if the cart is being emptied. <!---SUBTOTAL---> Tag This tag tells PDG Commerce to replace the tag with the cost of all of the products in the current cart before sales tax or shipping is applied. This calculation may be used in determining any additional shipping costs or discounts if these have been specified in the Shipping Rules section of the Merchant Administrator (see the PDG Commerce User Guide for more information). The tag must appear in the template file as: <!---SUBTOTAL---> <!---WEIGHT_TOTAL---> Tag This tag tells PDG Commerce to replace the tag with the total weight of the order. This is done by adding the weights of all of the quantities of each product in the order. This calculation may be used to determine shipping costs if weight tables have been specified in the ‘Shipping Rules’ section of the Merchant Administrator (see the PDG Commerce User Guide for more information). The tag must appear in the template file as: <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> Tag This tag tells PDG Commerce to replace the tag with the total number of items in the order. This is done by adding the quantities of all of the products in the order. This calculation may be used in determining any additional shipping costs or discounts if specified in the Shipping Rules section of the Merchant Administrator (see the PDG Commerce User Guide for more information). The tag must appear in the template file as: <!---NUM_ITEMS---> PDG Commerce -- Technical Reference Guide 43 Chapter 4 -- HTML Template Files <!---ORDER_SUBTOTAL_DISC---> Tag This tag tells PDG Commerce to replace the tag with whatever subtotal-based discount may be applied to the order. This calculation is made depending upon the discounts that you defined with the Merchant Administrator. If no discount applies to the order, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---ORDER_SUBTOTAL_DISC---> <!---PROD_CAT_QTY_DISC---> Tag This tag will display all product category quantity discounts applied to the order. Each product category quantity discount will be displayed with the label “Discount for Ordering X Products From A000”, where X is the number of products ordered from category A000. The tag must appear in the template file as: <!---PROD_CAT_QTY_DISC---> <!---BONUS_PT_TOTAL---> Tag This tag tells PDG Commerce to replace the tag with the total number of bonus or “frequent shopper” points accumulated for the order. If no bonus points are earned from the current order, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> Tag This tag tells PDG Commerce to replace the tag with any additional shipping charges that may have been applied to any of the products in the cart. This includes additional shipping charges for all quantities of all applicable products. If no additional shipping charges are incurred from any of the products on the order, PDG Commerce will replace this tag with “0.0”. The tag must appear in the template file as: <!---ADD_SHIPPING_TOTAL---> 44 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---SEC_SCRIPTNAME--- Tag This tag tells PDG Commerce to replace the tag with the URL of the PDG Commerce on the secure server. The tag must appear in the template file as: !---SEC_SCRIPTNAME--- <!---SEC_FORCE_DATA---> Tag This tag tells PDG Commerce to replace the tag with the cookie information that needs to be passed to your secure server/directory in order to perform a secure checkout. This tag is necessary if you wish to offer a secure checkout option from your custom Basket HTML template, and the secure server or secure cgi-path is different from its non-secure counterpart. The tag must appear in the template file as: <!---SEC_FORCE_DATA---> <!---CHECKOUT_LINK---> Tag This tag is replaced with the code for a CheckOut button. Please note that this is the complete code for displaying the button image as defined in the Merchant Administrator as well as the proper form value. The tag must appear in the template file as: <!---CHECKOUT_LINK---> <!---SECURE_CHECKOUT_LINK---> Tag This tag is replaced with the code for a Secure CheckOut button. Please note that this is the complete code for displaying the button image as defined in the Merchant Administrator as well as the proper form value. The tag must appear in the template file as: <!---SECURE_CHECKOUT_LINK---> <!---REMOVE_ALL_LINK---> Tag This tag is replaced with the code for a Remove All button, which will remove all items from the basket when clicked. Please note that this is the complete code for displaying the button image as defined in the Merchant Administrator as well as the proper form value. The tag must appear in the template file as: <!---REMOVE_ALL_LINK---> PDG Commerce -- Technical Reference Guide 45 Chapter 4 -- HTML Template Files <!---RECALC_LINK---> Tag This tag is replaced with the code for a Recalc button, which will recalculate the totals (subtotal, weight, etc.) for the items in the basket when clicked. Please note that this is the complete code for displaying the button image as defined in the Merchant Administrator as well as the proper form value. The tag must appear in the template file as: <!---RECALC_LINK---> <!---TRACK_ORDER_SUBMIT---> Tag This tag is available on the template if Site Design is enabled. Please see the PDG Software Site Design guide for further information on this tag. ‘REPEAT’ Tags In addition to the standard Basket Template tags, the Basket HTML Template file can also use the REPEAT tags. If you are planning on customizing the layout of the Basket template, you will need to employ the REPEAT tags. These consist of two tags, <!---BEGIN_REPEAT---> and <!---END_REPEAT--->, between which all of the tags for displaying each product in the basket will be placed. Any information that falls between the REPEAT tags in the Basket HTML template will be repeated for each item in the customer’s cart, until no items are left. These tags must have their own lines in the template file, and must appear as: <!---BEGIN_REPEAT---> [product data] <!---END_REPEAT---> The ‘product data’ comes from the Repeat Basket tags which are explained below. For more information on how the REPEAT tags work and how they may be used, see the beginning of this chapter. 46 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files While the tags will be explained below, here is an example of a Basket template customized using the REPEAT and Repeat Basket tags: Customized Basket Template Display The tags that are allowed to be used between the REPEAT tags in the Basket HTML template will be called the Basket Repeat tags. They are as follows: !---ROW_COLOR--- Tag This tag is replaced by the appropriate background color for the row if Row Coloring is enabled in the Templates section of your Commerce Administrator. Please see the PDG Commerce User Guide or PDG Commerce Design Guide (if using Site Design mode) for information on configuring row coloring. This tag should be placed in all table cell fields within the REPEAT tags on the Basket page. There should be a single space before and after the tag. The tag must appear in the template file as: <td !---ROW_COLOR--- > <!---SKU---> Tag This tag is replaced by the SKU or Product Code for the selected product. The tag must appear in the template file, between the REPEAT tags, as: <!---SKU---> <!---QTY---> Tag This tag is replaced by a text field displaying the quantity of the selected product that is currently in the basket. Note that this is a form field that can be modified by the customer from the Basket page. The tag must appear in the template file, between the REPEAT tags, as: <!---QTY---> PDG Commerce -- Technical Reference Guide 47 Chapter 4 -- HTML Template Files <!---QTY_BUTTON---> Tag This tag is replaced by a ‘recalculate’ button that cues PDG Commerce to refigure the price of the order depending upon the updated quantity in the field created by the <!---QTY---> tag, as explained above. The tag must appear in the template file, between the REPEAT tags, as: <!---QTY_BUTTON---> <!---INDEX---> Tag This tag is replaced with the Basket index number assigned by PDG Commerce for the corresponding product. This number is generally used internally and should not be embedded in your Basket template. However if you do decide to display the index number, the tag must appear in the template file, between the REPEAT tags, as: <!---INDEX---> <!---BASEPRICE---> Tag This tag is replaced by the unit price, modified with any changes due to customer category discounting, for the selected product as it was entered into your Merchant Administrator (see ‘Maintaining Products’ in the PDG Commerce User Guide for more information). The tag must appear in the template file, between the REPEAT tags, as: <!---BASEPRICE---> Note: This tag may be appended with a “C”, <---BASEPRICEC--->. PDG Commerce will replace this tag with the unit price converted to the secondary currency. <!---QTYPRICE---> Tag This tag is replaced by the total price of the selected product being ordered. This value is calculated by multiplying the base or unit price by the quantity of the product being ordered. The tag must appear in the template file, between the REPEAT tags, as: <!---QTYPRICE---> Note: This tag may be appended with a “C”, <---QTYPRICEC--->. PDG Commerce will replace this tag with the quantity price converted to the secondary currency. <!---BASEAMOUNT---> Tag This tag is replaced by the unit price for the product including any selected options. If there are no charges applied to any of the selected options, this 48 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files amount will reflect the same as <!---BASEPRICE--->. The tag must appear in the template file, between the REPEAT tags, as: <!---BASEAMOUNT---> Note: This tag may be appended with a “C”, <---BASEAMOUNTC--->. PDG Commerce will replace this tag with the base amount converted to the secondary currency. <!---QTYAMOUNT---> Tag This tag is replaced by the total price for the all of the products with their selected options. This value is calculated by multiplying the product’s price including the selected options by the quantity ordered. The tag must appear in the template file, between the REPEAT tags, as: <!---QTYAMOUNT---> Note: This tag may be appended with a “C”, <---QTYAMOUNTC--->. PDG Commerce will replace this tag with the quantity amount converted to the secondary currency. <!---BASEADDONS---> Tag This tag is replaced by the cost of any add-ons or options that may have been included with the selected product. If there are no charges that apply to any of the selected options for the given product, then this tag is “0.0”. The tag must appear in the template file, between the REPEAT tags, as: <!---BASEADDONS---> Note: This tag may be appended with a “C”, <---BASEADDONSC--->. PDG Commerce will replace this tag with the add-on cost converted to the secondary currency. <!---QTYADDONS---> Tag This tag is replaced by the cost of all of the add-ons or options for the selected product. This value is figured by multiplying the base add-on price by the number of add-ons being ordered (i.e. the quantity of the product being ordered with the add-on). If there are no charges that apply to any of the selected options for the given product, then this tag is “0.0”. The tag must appear in the template file, between the REPEAT tags, as: <!---QTYADDONS---> Note: This tag may be appended with a “C”, <---QTYADDONSC--->. PDG Commerce will replace this tag with the quantity add-on price converted to the secondary currency. PDG Commerce -- Technical Reference Guide 49 Chapter 4 -- HTML Template Files <!---BASEDISCOUNT---> Tag This tag is replaced by the “per unit” discount incurred by the selected product when a valid quantity has been ordered. The valid quantity is determined by discount tiers created in the Merchant Administrator. If there is no discount, then this tag is “0.0”. The tag must appear in the template file, between the REPEAT tags, as: <!---BASEDISCOUNT---> Note: This tag may be appended with a “C”, <---BASEDISCOUNTC--->. PDG Commerce will replace this tag with the product’s base discount converted to the secondary currency. <!---QTYDISCOUNT---> Tag This tag is replaced by the total discount that may be incurred due to the quantity of the selected product ordered. These discounts are configured in the Product configuration section of the Merchant Administrator (See ‘Maintaining Products’ in the PDG Commerce User Guide). If there is no quantity discount that applies, then this tag is “0.0”. The tag must appear in the template file, between the REPEAT tags, as: <!---QTYDISCOUNT---> Note: This tag may be appended with a “C”, <---QTYDISCOUNTC--->. PDG Commerce will replace this tag with the order’s quantity discount converted to the secondary currency. <!---KEY---> Tag This tag is replaced by the specific SKU or product code, without any option suffixes, for the selected product. The tag must appear in the template file, between the REPEAT tags, as: <!---KEY---> <!---DESC---> Tag This tag is replaced by the product’s one-line description as defined in the Product Definition in the Merchant Administrator. The tag must appear in the template file, between the REPEAT tags, as: <!---DESC---> 50 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---UNITOFMEASURE---> Tag This tag is replaced with the unit of measurement associated with the value for the selected product’s weight. The tag must appear in the template file, between the REPEAT tags, as: <!---UNITOFMEASURE---> <!---BASEWEIGHT---> Tag This tag is replaced with the numerical value for the selected product’s weight. If the product has no weight, it is replaced with “0.0”. The tag must appear in the template file, between the REPEAT tags, as: <!---BASEWEIGHT---> <!---QTYWEIGHT---> Tag This tag is replaced by the total weight of the given product being ordered. This value is calculated by multiplying the product’s base weight by the quantity of the product being ordered. If the product has no weight, it is replaced with “0.0”. The tag must appear in the template file, between the REPEAT tags, as: <!---QTYWEIGHT---> <!---THUMB---> Tag This tag is replaced with the thumbnail image URL for the given product. As this is a URL, it should appear in an HTML image tag. If there is not an image specified for a product, this tag will display the transparent.gif image. If the transparent.gif image is not found in the CommConfig folder on the site, a broken image link will be displayed. The THUMB tag must appear in the template file, between the REPEAT tags, and can appear in the following scenario: <img src=”!---THUMB---”> <!---IMG---> Tag This tag is replaced by the image for the given product. If there is not an image specified for a product, this tag will display the transparent.gif image. If the transparent.gif image is not found in the CommConfig folder on the site, a broken image link will be displayed. The tag must appear in the template file, between the REPEAT tags, as: <img src=”!---IMG---”> <!---IMAGE---> Tag This tag is replaced by the image for the given product. This tag works the same as the <!---IMG---> tag explained above. It is recommended that you PDG Commerce -- Technical Reference Guide 51 Chapter 4 -- HTML Template Files only use one of these conventions, not both. If there is not an image specified for a product, this tag will display the transparent.gif image. If the transparent.gif image is not found in the CommConfig folder on the site, a broken image link will be displayed. The tag must appear in the template file, between the REPEAT tags, as: <img src=”!---IMAGE---”> <!---BASE_ADD_SHIPPING---> Tag This tag is replaced by any additional shipping charge that is incurred by the product itself. If there is no additional shipping charge associated with the product, then this tag is ignored. The tag must appear in the template file, between the REPEAT tags, as: <!---BASE_ADD_SHIPPING---> <!---QTY_ADD_SHIPPING---> Tag This tag is replaced by the total shipping charges incurred from ordering this product. This value can be calculated by multiplying the additional shipping charge associated with the given product by the quantity of the product ordered. If there is no additional shipping charge associated with the product, then this tag is ignored. The tag must appear in the template file, between the REPEAT tags, as: <!---QTY_ADD_SHIPPING---> <!---USERDEF#---> Tag This tag is replaced by any User Defined data that you may have entered for the given product. The # (0-9) indicates which user defined field to display. If there is no user defined data for the given field, then this tag is ignored. The tag must appear in the template file, between the REPEAT tags, as: <!---USERDEF1---> Note: There may be as many as ten (0-9) of these tags in your Basket HTML template file. <!---REMOVE_BUTTON---> Tag This tag is replaced by a “Remove” button for the selected product. When the customer clicks this button, the cart is re-displayed with all quantities of the selected product removed from the basket. The tag must appear in the template file, between the REPEAT tags, as: <!---REMOVE_BUTTON---> 52 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---DESC_OPT---> Tag This tag is replaced with the option description for the product in the basket. There will be a line break after each option description. The tag must appear in the template file, between the REPEAT tags, as: <!---DESC_OPT---> <!---VALUEOPT---> Tag This tag is replaced by the option selections for the selected product in the basket. There will be a line break after each option selection. The tag must appear in the template file, between the REPEAT tags, as: <!---VALUEOPT---> <!---ORIGINAL_PRICE---> Tag This tag is replaced by the original price of the current product, before any product discounting, in the basket. If no discount is applied to the order, this tag is ignored. The tag must appear in the template file, between the REPEAT tags, as: <!---ORIGINAL_PRICE---> <!---TEXT_ORIGINAL_PRICE---> Tag This tag is replaced by the original price of the current product, before any product discounting, in the basket, with the label “Original Price:”. If no discount is applied to the order, this tag is ignored. The tag must appear in the template file, between the REPEAT tags, as: <!---TEXT_ORIGINAL_PRICE---> <!---DISCOUNT_AMOUNT---> Tag This tag is replaced by the discounted amount of the current product in the basket. The tag must appear in the template file, between the REPEAT tags, as: <!---DISCOUNT_AMOUNT---> <!---TEXT_DISCOUNT_AMOUNT---> Tag This tag is replaced by the discount amount of the current product in the basket, with the label “Discount Of:”. The tag must appear in the template file, between the REPEAT tags, as: <!---TEXT_DISCOUNT_AMOUNT---> PDG Commerce -- Technical Reference Guide 53 Chapter 4 -- HTML Template Files !---MIN_QTY--- Tag This tag is replaced by the minimum quantity that can be ordered of the item. This value is set in the Merchant Administrator. If there is no minimum quantity, this tag is replaced with “0”. The tag must appear in the template file as: !---MIN_QTY--- <!---MIN_QTY_TEXT---> Tag This tag is used to display a customized message that contains the minimum quantity of the item that can be ordered. If there is no minimum quantity for the item, then this tag is ignored (instead of being replaced with “0”). Inside the tag, you place text that will be displayed. If the text contains “[VALUE]”, this is replaced with the minimum quantity. The tag must appear in the template file as: <!---MIN_QTY_TEXT You must order at least [VALUE] units to buy this. --> !---MAX_QTY--- Tag This tag is replaced by the maximum quantity that can be ordered of the item. This value is set in the Merchant Administrator. If there is no maximum quantity, this tag is replaced with “0”. The tag must appear in the template file as: !---MAX_QTY--- <!---MAX_QTY_TEXT---> Tag This tag is used to display a customized message that contains the maximum quantity of the item that can be ordered. If there is no maximum quantity for the item, then this tag is ignored (instead of being replaced with “0”). Inside the tag, you place text that will be displayed. If the text contains “[VALUE]”, this is replaced with the maximum quantity. The tag must appear in the template file as: <!---MAX_QTY_TEXT Only [VALUE] units per order. ---> <!---GIFT_CERT_KEY---> Tag This tag is used to display a unique gift certificate ID code for each gift certificate purchased. This key will be required to identify the gift certificate when it is used to purchase a later order. The tag must appear in the template file as: <!---GIFT_CERT_KEY---> 54 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---PRICE_WITH_ITEM_DISC---> Tag This tag is replaced by the product quantity discount, if any can be applied for this product. If there is no product quantity discount for the item, then this tag is ignored. If a discount exists, the amount displayed will be the amount discounted per unit of the product. The tag must appear in the template file as: <!---PRICE_WITH_ITEM_DISC---> <!---QTY_PRICE_WITH_ITEM_DISC---> Tag This tag is replaced with the total product quantity discount, if any can be applied for this product. This value can be calculated by multiplying the quantity discount associated with the given product by the quantity of the product ordered. If there is no product quantity discount for the item, then this tag is ignored. The tag must appear in the template file as: <!---QTY_PRICE_WITH_ITEM_DISC---> <!---INV---> Tag PDG Commerce replaces this tag with the current inventory for the product displayed. If inventory is being tracked by product options for the selected product, this tag will be replaced by a link that reads ‘Display Inventory by Options.’ This link will open an inventory status page, which uses the AddItem template. If there are none of the selected product in stock, the proper message regarding backorders will be displayed. If inventory is not being tracked for the selected product, this tag is ignored. The tag must appear in the template file as: <!---INV---> <!---INVOPT---> Tag This tag is replaced by the current inventory for the selected product. If inventory is being tracked by options, then the current number of items in stock with the specified options will be displayed. If there is no available inventory in stock, the proper message regarding backorders will be displayed. The tag must appear in the template file as: <!---INVOPT---> <!---CROSS_SALE---> Tag This tag will display links for all items listed in the Cross Sale section of the product’s details in the Merchant Administrator. The text for the link will be the linked product’s one line description if no link text was entered in the Cross Sale section. The tag must appear in the template file as: <!---CROSS_SALE---> PDG Commerce -- Technical Reference Guide 55 Chapter 4 -- HTML Template Files <!---UP_SALE---> Tag This tag will display links for all items listed in the Up Sale section of the product’s details in the Merchant Administrator. The text for the link will be the linked product’s one line description if no link text was entered in the Up Sale section. The tag must appear in the template file as: <!---UP_SALE---> <!---REMOVE_SUBMIT---> Tag This tag will be replaced by the Remove Button image specified in the Buttons section of your Cart Administrator. The tag must appear in the template file as: <!---REMOVE_SUBMIT---> <!---QTY_INPUT---> Tag This tag will be replaced by an input field that allows the customer to enter a quantity amount for each product. The tag must appear in the template file as: <!---QTY_INPUT---> ‘RECIPIENT’ Tags In addition to the standard Basket Template tags, the Basket HTML Template file can also use the RECIPIENT tags. If you are planning on customizing the layout of the Basket template, and you allow customers to ship a single order to multiple recipients, you will need to employ the RECIPIENT tags. These consist of two tags, <!---BEGIN_RECIPIENT---> and <!--END_RECIPIENT--->, between which all of the tags for displaying each recipient’s basket will be placed. Any information that falls between the RECIPIENT tags in the Basket HTML template will be repeated for each recipient’s cart until no recipients are left. You can use the standard Basket Template repeat tags inside of the RECIPIENT tags to call the product information for each recipient’s basket. In addition to the Basket repeat tags, you may also use the following tags within the RECIPIENT tags: <!---FRIENDLYNAME---> Tag This tag will display the friendly name entered for the current recipient. The tag must appear in the template file as: <!---FRIENDLYNAME---> 56 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---SUBTOTAL---> Tag This tag will display the subtotal of the current recipient’s basket. The tag must appear in the template file as: <!---SUBTOTAL---> ‘OPTIONS’ Tags If you are planning on customizing the layout of the Basket template, you will need to employ the REPEAT tags. See above if you have not already done so. In order to display options for a product using the REPEAT tags, you must also use the OPTIONS tags inside of the REPEAT tags. These consist of two tags, <!---BEGIN_OPTIONS---> and <!---END_OPTIONS--->, between which all of the tags for displaying the preselected options will be placed. Any information that falls between the OPTIONS tags in the Basket HTML template calls the specific option information that has been selected by the customer for the corresponding product. The information that is called is repeated for all of the available options for the given product. These tags must appear in the HTML template file as: <!---BEGIN_OPTION---> [option data] <!---END_OPTION---> The ‘option data’ comes from the Basket Options tags that work with the OPTIONS tags within the Basket HTML template in which they are embedded. For more information on how the OPTIONS tags work, see the beginning of this chapter. The tags that are allowed to be used between the OPTIONS tags in the Basket HTML template are as follows: <!---DESC---> Tag This tag is replaced by the name of the option for the given product. The tag must appear in the template file, between the OPTIONS tags, as: <!---DESC---> <!---VALUE---> Tag This tag is replaced by the customer-selected value for the corresponding option of the given product. The tag must appear in the template file, between the OPTIONS tags, as: <!---VALUE---> PDG Commerce -- Technical Reference Guide 57 Chapter 4 -- HTML Template Files <!---PRICE---> Tag This tag is replaced with the cost reflected by the particular option selection for the given product. If there is no additional cost for the option selection, then this tag is replaced with “0.00”. The tag must appear in the template file, between the OPTIONS tags, as: <!---PRICE---> <!---MNGRMTEXT---> Tag If the particular product option is for custom monogramming, this tag is replaced by the text selected by the customer to be monogrammed or engraved on the selected product. If there is no monogramming, then this tag is ignored. The tag must appear in the template file, between the OPTIONS tags, as: <!---MNGRMTEXT---> <!---NON_ZERO_PRICE---> Tag This tag is replaced with the cost reflected by the particular option selection for the given product. If there is no additional cost for the option selection, then this tag is ignored. The tag must appear in the template file, between the OPTIONS tags, as: <!---NON_ZERO_PRICE---> <!---NON_ZERO_QTYPRICE---> Tag This tag is replaced by the total price of the selected option being ordered. This value is calculated by multiplying the price of the option selection by the quantity of the product being ordered. If there is no additional cost for the option selection, then this tag is ignored. The tag must appear in the template file, between the OPTIONS tags, as: <!---NON_ZERO_QTYPRICE---> <!---NON_ZERO_PRICEC---> Tag This tag is replaced with the secondary currency cost reflected by the particular option selection for the given product. If there is no additional cost for the option selection, then this tag is ignored. The tag must appear in the template file, between the OPTIONS tags, as: <!---NON_ZERO_PRICEC---> <!---NON_ZERO_QTYPRICEC---> Tag This tag is replaced by the secondary currency cost of the total price of the selected option being ordered. This value is calculated by multiplying the 58 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files price of the option selection by the quantity of the product being ordered. If there is no additional cost for the option selection, then this tag is ignored. The tag must appear in the template file, between the OPTIONS tags, as: <!---NON_ZERO_QTYPRICEC---> AddItem Template File The AddItem Template File is used when PDG Commerce needs to obtain quantity and option information from a user after receiving the PreAdd action. For more information on the PreAdd action, please refer to the chapter regarding ‘PDG Commerce Actions’ of this Technical Reference Guide. The AddItem Template File is also used when PDG Commerce displays inventory option tracking information, from a link created by the <!---INV---> tag. The AddItem Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer, it searches the HTML Template File for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s Web browser. The following are the standard AddItem Template tags (and are case-sensitive): • • • • • <!---ITEM---> <!---UnitPriceRecalcScript---> <!---OPTIONPRICECALCSCRIPT---> <!---SKU---> <!---DESC---> Note: The <---UnitPriceRrcalcScript---> and <!---OPTIONPRICECALCSCRIPT---> tags may cause run-time errors when used in conjunction with customized Item templates that utilize the REPEAT, REPEAT NUMBER or OPTIONS tags. This tag only works with the standard Item template style. The <!---ITEM---> tag adds functionality to the AddItem template by embedding the Item template in the AddItem template. When using the AddItem page to display inventory, the <!---ITEM---> tag will be replaced by a table displaying the inventory status of each option combination of the item. A sample AddItem Template File is included with PDG Commerce. PDG Commerce -- Technical Reference Guide 59 Chapter 4 -- HTML Template Files <!---ITEM---> Tag PDG Commerce replaces this tag with selectable information about the product to be added. The <!---ITEM---> tag is replaced with data that is displayed in the Item HTML template. What the Item template can display includes, but is not limited to, the following: • • • • • • [Item description] [Item price] Enter quantity: [Edit box for quantity] Option 1 description: [Pull-down box with selections for option 1] [More options...] [Submit button with the ADD action] For more information, see the following section on the Item Template File. The tag must have its own line in the template file, and must appear as: <!---ITEM---> <!---UnitPriceRecalcScript---> Tag This tag gets inserted between the ‘head’ (<head>,</head>) tags and tells PDG Commerce to replace the tag with a dynamically created JavaScript function which enables the real-time price recalculation based on the options that the customer selects on the AddItem page. When this script is inserted, the pricing on the AddItem page will automatically reflect that of any options changed by the customer. Note that this script updates the unit price for the options selected. The displayed price will not change if the quantity ordered field is changed. There is also additional Javascript support functions in the AddItem and Item templates for this tag, which are staticially written in these templates. For this tag to operate properly, these Javascript functions need to be in the AddItem and Item templates as well. Note: This tag is case-sensitive. The JavaScripts located in the default template must remain there. If you create your own template, these scripts must be present if you wish for real-time price calculations on your catalog pages. The tag must appear in “head” section of the template file as: <!---UnitPriceRecalcScript---> 60 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---OPTIONPRICECALCSCRIPT---> Tag This tag gets inserted between the ‘head’ (<head>,</head>) tags and tells PDG Commerce to replace the tag with a dynamically created JavaScript function which enables the real-time price recalculation based the option(s) that the customer selects on the AddItem page. When this script is inserted, the pricing on the AddItem page will automatically reflect that of any added cost incurred by options chosen by the customer. This script, unlike the UnitPriceRecalcScript tag, also inserts Javascript code to prevent invalid option combinations for the product, as defined in the Merchant Administrator. The JavaScripts located in the default template must remain there. If you create your own template, these scripts must be present if you wish for real-time price calculations on your catalog pages. The tag must appear in “head” section of the template file as: <!---OPTIONPRICECALCSCRIPT---> <!---SKU---> Tag PDG Commerce replaces this tag with the sku number or product code of the item being displayed. The tag must appear in the template file as: <!---SKU---> <!---DESC---> Tag PDG Commerce replaces this tag with the one-line description (name) of the item that you entered when initially setting up the product in your Merchant Administrator. The tag must appear in the template file as: <!---DESC---> Secondary Currency Calculation If you want the secondary currency to be calculated on your product’s Item pages, you need to alter the ‘FormatEuro’ JavaScript used on the AddItem.html template file. If your secondary currency is Euros, you do not need to make any changes. If you are using a different secondary currency, open your AddItem template in an HTML editor. Find the end of the ‘FormatEuro’ JavaScript, which reads as follows: valStr = "" + valInt + "." + valFracStr + " EU"; Change the value “ EU” to the label of the currency you will be displaying as your secondary value. PDG Commerce -- Technical Reference Guide 61 Chapter 4 -- HTML Template Files Inventory Option Template File The Inventory Option Template File will display the available option combinations for the current product, as well as how many items are available for purchase for each possible option combination. Before PDG Shopping Cart sends the Inventory Option Template to the customer, it searches the HTML Template File for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s Web browser. The following is the standard Inventory Option Tag: • <!---OPTION_INVENTORY---> PDG Shopping Cart is given the location of this template file from the directory and template name specified in the Templates section of the Merchant Administrator (which stores a key in the Shopper.Conf file). For more information on entering files in the Templates section, refer to the PDG Commerce User Guide. PDG Shopping Cart is given the location of this template file from the directory and template name specified in the Templates section of the Merchant Administrator (which stores a key in the Shopper.Conf file). For more information on entering files in the Templates section, refer to the PDG Commerce User Guide. <!---OPTION_INVENTORY---> Tag This tag is replaced by a formatted table containing all possible option combinations for the product, and how many of each combination are currently in stock. The tag must appear in the template file as: <!---OPTION_INVENTORY---> Item Template File The Item Template File is used to customize PDG Commerce’s output for the item on the AddItem template. Essentially, this is an HTML document which gets inserted into the AddItem template. 62 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files As with all other templates, before it is sent to the customer, PDG Commerce searches the Item template for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s Web browser. The following are the standard Item Template tags: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • <!---SKU---> <!---DESC---> <!---UNITOFMEASURE---> <!---PRICE---> <!---TEXT---> <!---INV---> <!---WEIGHT---> <!---BONUSPOINT---> <!---IMAGE---> <!---THUMB---> <!---ITEMOPT---> <!---ITEMOPT#---> <!---DESC_OPT---> <!---DESC_OPT#---> <!---VALUEOPT---> <!---VALUEOPT#---> <!---ITEMRETURNURL---> <!---ITEMRECALCFIELD---> <!---USERDEF---> <!---INVOPT---> !---ORIGINAL_PRICE--!---TEXT_ORIGINAL_PRICE--!---DISCOUNT_AMOUNT--!---TEXT_DISCOUNT_AMOUNT--!---MIN_QTY--!---MAX_QTY--!---MIN_QTY_TEXT--!---MAX_QTY_TEXT--<!---ADD_LINK---> <!---SHOPSOMEMORE_LINK---> <!---CROSS_SALE---> <!---UP_SALE---> <!---RECIPIENT_SELECT_OPTIONS---> <!---RECIPIENT_SELECT_TABLE---> <!---MULTISHIP_ADD_LINK---> <!---NUMBER_OF_RECIPIENTS---> PDG Commerce -- Technical Reference Guide 63 Chapter 4 -- HTML Template Files • <!---RECIPIENT_SELECT---> PDG Commerce comes with a sample Item template file. Below is an example of how this template will be displayed. For information on how to customize this display, see the ‘REPEAT NUMBER Tags’ section below. Sample Item Template Display <!---SKU---> Tag PDG Commerce replaces this tag with the SKU or product code of the item being displayed. The tag must appear in the template file as: <!---SKU---> <!---DESC---> Tag PDG Commerce replaces this tag with the One-line description (name) of the item that you entered when initially setting up the product in your Merchant Administrator. The tag must appear in the template file as: <!---DESC---> <!---UNITOFMEASURE---> Tag This tag is replaced with the unit of measurement associated with the quantity for the selected product. This can be “units,” or “boxes,” or “pairs,” or “yards,” for example. The tag must appear in the template file as: <!---UNITOFMEASURE---> 64 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---WEIGHT---> Tag PDG Commerce replaces this tag with the weight value assigned to the product during its setup. The tag must appear in the template file as: <!---WEIGHT---> <!---PRICE---> Tag PDG Commerce replaces this tag with the unit price of the indicated product. The tag must appear in the template file as: <!---PRICE---> Note: This tag may be appended with a “C”, <---PRICEC--->. PDG Commerce will replace this tag with the unit price converted to the secondary currency. <!---TEXT---> Tag PDG Commerce replaces this tag with the product text, or detailed description, of the item being displayed. The tag must appear in the template file as: <!---TEXT---> <!---INV---> Tag PDG Commerce replaces this tag with the current inventory for the product being displayed. If inventory is being tracked by product options for the selected product, this tag will be replaced by a link that reads ‘Display Inventory by Options.’ This link will open an inventory status page, which uses the AddItem template. If there is none of the selected product in stock, the proper message regarding backorders will be displayed. If inventory is not being tracked for the selected product, this tag is ignored. The tag must appear in the template file as: <!---INV---> <!---BONUSPOINT---> Tag PDG Commerce replaces this tag with the bonus point (frequent shopper points) value of the item being displayed. The tag must appear in the template file as: <!---BONUSPOINT---> PDG Commerce -- Technical Reference Guide 65 Chapter 4 -- HTML Template Files <!---IMAGE---> Tag PDG Commerce replaces this tag with the image URL associated with the selected item. If there is not an image specified for a product, this tag will display the transparent.gif image. If the transparent.gif image is not found in the CommConfig folder on the site, a broken image link will be displayed. The tag should appear in the template file as: <img src=”!---IMAGE---”> <!---THUMB---> Tag PDG Commerce replaces this tag with the thumbnail image URL associated with the selected item. If there is not an image specified for a product, this tag will display the transparent.gif image. If the transparent.gif image is not found in the CommConfig folder on the site, a broken image link will be displayed. The tag must appear in the template file as: <img src=”---THUMB---”> <!---ITEMOPT---> Tag This tag is replaced by the option labels and selection menus for the options associated with the selected product. The tag must appear in the template file as: <!---ITEMOPT---> <!---ITEMOPT#---> Tag PDG Commerce replaces this tag with the option label and selection menu for the option # appearing in your Commerce Administrator. The index numbers for the options begin at zero, so the first option would be <!---ITEMOPT0-->, the second option would be <!---ITEMOPT1--->, and so on. The tag must appear in the template file as: <!---ITEMOPT#---> The item descriptions and selection boxes will be displayed in the following manner: Product Option Selection Displays on the Item Template 66 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---DESC_OPT---> Tag This tag is replaced by the option descriptions associated with the selected product. There will be a line break after each option description. The tag must appear in the template file as: <!---DESC_OPT---> <!---DESC_OPT#---> Tag PDG Commerce replaces this tag with the option label for the option # appearing in your Commerce Administrator. The index numbers for the options begin at zero, so the <!---DESC_OPT0---> tag will display the option label for the first option, the <!---DESC_OPT1---> tag will display the option label for the second option, and so on. The tag must appear in the template file as: <!---DESC_OPT#---> <!---VALUEOPT---> Tag This tag is replaced by the option selection drop down menus associated with the selected product. There will be a line break after each option description. The tag must appear in the template file as: <!---VALUEOPT---> <!---VALUEOPT#---> Tag PDG Commerce replaces this tag with the option selection drop down menu for the option # appearing in your Commerce Administrator. The index numbers for the options begin at zero, so the <!---VALUEOPT0---> tag will display the option selection drop down menu for the first option, the <!--VALUEOPT1---> tag will display the option selection drop down menu for the second option, and so on. The tag must appear in the template file as: <!---VALUEOPT#---> <!---ITEMRETURNURL---> Tag This tag is replaced by a hidden field. It informs PDG Commerce of the “reference page” for the shopper. The reference page is the page which was being viewed prior to the AddItem page. Note that any URL entered into the “Destination of Shop Some More Button” field in the Cart Options section of the Merchant Administrator will override this reference page identifier. However, if the page was created dynamically, the user will be returned to the last statically created page. PDG Commerce -- Technical Reference Guide 67 Chapter 4 -- HTML Template Files The tag must appear in the template file as: <!---ITEMRETURNURL---> <!---ITEMRECALCFIELD---> Tag This tag is replaced by the current price of the product, with the price modified appropriately to reflect any price changes by option. The tag must appear in the template file as: <!---ITEMRECALCFIELD---> <!---USERDEF#---> Tag This tag is replaced by any User Defined data that may be associated with the particular product. The # (0-9) indicates which user defined field to display for the selected product. If there is no user defined data for the given field, then this tag will be ignored. The tag must appear in the template file as: <!---USERDEF#---> <!---INVOPT---> Tag This tag is replaced by the current inventory for the selected product. If inventory is being tracked by options, then this value will be displayed. If there is no available inventory in stock, the proper message regarding backorders will be displayed. The tag must appear in the template file as: <!---INVOPT---> !---ORIGINAL_PRICE--- Tag This tag is replaced by the original price of the item before any discounting. If no discount is applied to the product, this tag is ignored. The tag must appear in the template file as: <---ORIGINAL_PRICE---> !---TEXT_ORIGINAL_PRICE--- Tag This tag is replaced by the original price of them before any discounting, with the label “Original Price:”. If no discount is applied to the product, this tag is ignored. The tag must appear in the template file as: !---TEXT_ORIGINAL_PRICE--- 68 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---DISCOUNT_AMOUNT--- Tag This tag is replaced by the discounted amount of the item. The tag must appear in the template file as: !---DISCOUNT_AMOUNT--- !---TEXT_DISCOUNT_AMOUNT--- Tag This tag is replaced by the discounted amount of the item, with the label “Discount Of:”. The tag must appear in the template file as: !---TEXT_DISCOUNT_AMOUNT--- !---MIN_QTY--- Tag This tag is replaced by the minimum quantity that can be ordered of the item. This value is set in the Merchant Administrator. If there is no minimum quantity, this tag is replaced with “0”. The tag must appear in the template file as: !---MIN_QTY--- <!---MIN_QTY_TEXT---> Tag This tag is used to display a customized message that contains the minimum quantity of the item that can be ordered. If there is no minimum quantity for the item, then this tag is ignored (instead of being replaced with “0”). Inside the tag, you place text that will be displayed. If the text contains “[VALUE]”, this is replaced with the minimum quantity. The tag must appear in the template file as: <!---MIN_QTY_TEXT You must order at least [VALUE] units to buy this. --> !---MAX_QTY--- Tag This tag is replaced by the maximum quantity that can be ordered of the item. This value is set in the Merchant Administrator. If there is no maximum quantity, this tag is replaced with “0”. The tag must appear in the template file as: !---MAX_QTY--- <!---MAX_QTY_TEXT---> Tag This tag is used to display a customized message that contains the maximum quantity of the item that can be ordered. If there is no maximum quantity for PDG Commerce -- Technical Reference Guide 69 Chapter 4 -- HTML Template Files the item, then this tag is ignored (instead of being replaced with “0”). Inside the tag, you place text that will be displayed. If the text contains “[VALUE]”, this is replaced with the maximum quantity. The tag must appear in the template file as: <!---MAX_QTY_TEXT Only [VALUE] units per order. ---> !---ADD_LINK--- Tag This tag displays the “Add to Cart” button. The tag must appear in the template file as: <!---ADD_LINK---> !---SHOPSOMEMORE_LINK--- Tag This tag displays the “Shop Some More” button. The tag must appear in the template file as: <!---SHOPSOMEMORE_LINK---> !---CROSS_SALE--- Tag This tag will display links for all items listed in the Cross Sale section of the product’s details in the Merchant Administrator. The text for the link will be the linked product’s one line description if no link text was entered in the Cross Sale section. The tag must appear in the template file as: <!---CROSS_SALE---> !---UP_SALE--- Tag This tag will display links for all items listed in the Up Sale section of the product’s details in the Merchant Administrator. The text for the link will be the linked product’s one line description if no link text was entered in the Up Sale section. The tag must appear in the template file as: <!---UP_SALE---> 70 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---RECIPIENT_SELECT_OPTIONS--- Tag This tag will display a selection drop down menu containing all available friendly names for multiple shipping recipients that have been previously saved by the current customer, if the customer is logged in. The tag must appear in the template file as: <select name=singlerecipient><!---RECIPIENT_SELECT_OPTIONS---> </select> !---RECIPIENT_SELECT_TABLE--- Tag This tag will display a vertical table allowing the customer to either choose from a drop down menu of saved recipient selections or enter a new recipient name and specify a quantity of the product to add to the cart for that recipient. By default, this table displays fields to enter two recipients. If the customer enters a larger number of recipients in the numrecipients input field and clicks the “Redraw Recipient Table” button, this tag will display the same fields to specify the recipient name and quantity, but it will display enough fields to enter the number of recipients requested by the customer. The tag must appear in the template file as: <!---RECIPIENT_SELECT_TABLE---> !---MULTISHIP_ADD_LINK--- Tag This tag will display an “Add to Cart” button that will add the products entered in either the table displayed by the <!--RECIPIENT_SELECT_TABLE---> tag or the table displayed by the <!--RECIPIENT_SELECT---> tag. This tag creates a button that performs a “mshipadd” action. If a single recipient is specified, the <!---ADD_LINK---> button will be used instead of the <!---MULTISHIP_ADD_LINK---> button and will perform an “add” action. The tag must appear in the template file as: <!---MULTISHIP_ADD_LINK---> !---NUMBER_OF_RECIPIENTS--- Tag This tag will accept a value for the number of recipients entry fields that the customer wants to appear on the page. When the recipient table is redrawn, the number entered in this field will indicate how many recipient name entry fields and quantity entry fields should be displayed on the page. The tag must appear in the template file as: <input type=text name=numrecipients value="!--NUMBER_OF_RECIPIENTS---"> PDG Commerce -- Technical Reference Guide 71 Chapter 4 -- HTML Template Files The number of recipient entry fields to be displayed on the page may also be set in the link to the Item page, for example: http://www.webstorename.com/cgi-bin/commerce?preadd=action&key=A0001&numrecipients=4 !---RECIPIENT_SELECT--- Tag This tag will display a horizontal table allowing the customer to either choose from a drop down menu of saved recipient selections or enter a new recipient name and specify a quantity of the product to add to the cart for that recipient. By default, this table displays fields to enter two recipients. If the customer enters a larger number of recipients and clicks the “Redraw Recipient Table” button, this tag will display the same fields to specify the recipient name and quantity, but it will display enough fields to enter the number of recipients requested by the customer. The tag must appear in the template file as: <!---RECIPIENT_SELECT---> ‘DISCOUNT’ Tags In addition to the standard Item Template tags, the Item HTML Template file can also use the DISCOUNT tags. If you are planning on customizing the layout of the Quantity Discount table displayed on the Item Template, you will need to employ the DISCOUNT tags. These consist of two tags, <!--BEGIN_ITEM_DISC---> and <!---END_ITEM_DISC--->, between which all of the tags for displaying each quantity discount will be placed. Any information that falls between the DISCOUNT tags in the Item HTML Template will be repeated for each quantity discount defined for the product, until no discounts are left. These tags must have their own lines in the template file, and must appear as: <!---BEGIN_ITEM_DISC---> [discount data] <!---END_ITEM_DISC---> The ‘discount data’ comes from the Quantity Discount tags which are as follows: <!---MIN---> Tag This tag displays the minimum quantity for the current discount. The tag must appear in the template file, between the DISCOUNT tags, as: <!---MIN---> 72 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---MAX---> Tag This tag displays the maximum quantity for the current discount. The tag must appear in the template file, between the DISCOUNT tags, as: <!---MAX---> <!---DISC_AMT---> Tag This tag displays the amount discounted from the item price. For example, a discount of $5.00 would display -5.00. The tag must appear in the template file, between the DISCOUNT tags, as: <!---DISC_AMT---> <!---ITEM_PRICE---> Tag This tag displays the modified item price, which is the item price after the discount has been applied. For example, if the product’s original price is $15.00, and the discount is $5.00, this tag will display 10.00. The tag must appear in the template file, between the DISCOUNT tags, as: <!---ITEM_PRICE---> ‘REPEAT NUMBER’ Tags When the Item template is embedded in the Add Item template, you may find it convenient to use the REPEAT NUMBER tags. This yields an Item page that displays multiple entries for a single product and its options. This layout allows customers to select several different option combinations for the product, enter a quantity for each, and add them all to their cart with a single click. The tags that may be used between the REPEAT NUMBER tags within the Item template are the same as the standard Item Template tags listed above. Warning: Please be aware that if you used the REPEAT NUMBER tags on the Item template, any Item template tags outside of these REPEAT NUMBER tags will cause errors in PDG Commerce. These tags must have their own lines in the template file, and must appear as: <!---BEGIN_REPEAT[x]---> [item data] <!---END_REPEAT[y]---> In the example above, x and y are integers (where x < y) and the ‘item data’ is called by the standard Item Template tags. The same types of product data will be displayed for each number between x and y, inclusively. Note: If more than one set of REPEAT NUMBER tags are used in the Item HTML template, you must make sure that the spans (x,y) DO NOT overlap. PDG Commerce -- Technical Reference Guide 73 Chapter 4 -- HTML Template Files For more information on how the REPEAT NUMBER tags work, please see the beginning of this chapter. The figure below shows an example of an Item template that utilizes the REPEAT NUMBER tags. Custom Item Template Display From this Item tempalate, a customer can choose quantities of up to three different option combinations and add them to his cart with a single click. ‘OPTIONS’ Tags You have seen the OPTIONS tags used to repeat the option information for several different products in the Basket HTML template. The OPTIONS tags may also be used, with slightly different functionality, in the Item HTML template. When used in the Item HTML template, the OPTIONS tags will repeat the product listing for all of the possible option combinations. Therefore, if a product has two options each with three selections, there would be nine product instances on the Item page, each with a unique option combination. Each listing will be accompanied by a ‘Quantity’ field and an ‘Add’ button for easy shopping by your customers. These tags must appear in the HTML template file as: <!---BEGIN_OPTIONS---> [option data] <!---END_OPTIONS---> 74 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files The ‘option data’ comes from the Options Item tags that work with the Item HTML template. For more information on how the OPTIONS tags work, see the beginning of this chapter. The figure below illustrates how the Item page may look for an item that has two options with three possible selections each. Custom Item Template Display Note: The <---UNITPRICERECALCSCRIPT---> and <!---OPTIONPRICECALCSCRIPT---> tags may cause run-time errors when used in conjunction with customized Item templates that utilize the REPEAT, REPEAT NUMBER or OPTIONS tags. This tag only works with the standard Item template style. The tags that are allowed to be used between the OPTIONS tags in the Item HTML template (i.e. the Options Item tags) are as follows: <!---OPT_LINE_PRICE---> Tag This tag is replaced by the price of the product before any additional option charges have been applied. The tag must appear in the template file, between the OPTIONS tags, as: <!---OPT_LINE_PRICE---> <!---OPT_LINE_ADDED_PRICE---> Tag This tag is replaced by any added price that accompanies the given option selections. The tag must appear in the template file, between the OPTIONS tags, as: <!---OPT_LINE_ADDED_PRICE---> PDG Commerce -- Technical Reference Guide 75 Chapter 4 -- HTML Template Files <!---OPT_LINE_SKU---> Tag This tag is replaced by the specific product code for the product with the given option combination. This product code includes any SKU suffixes that accompany that product’s option selections. The tag must appear in the template file, between the OPTIONS tags, as: <!---OPT_LINE_SKU---> <!---DESC_OPT---> Tag This tag is replaced by the names or descriptions given to the options for the particular product. There will be a line break after each option description. The tag must appear in the template file, between the OPTIONS tags, as: <!---DESC_OPT---> Note: This tag may be appended with a number, <---DESC_OPT[#]--->. PDG Commerce will replace this tag with only the option description that corresponds to that option’s index number. If an option doesn’t exist for that index number, the tag will be ignored. Option indices start at zero. For example, <!---DESC_OPT0---> will display the description for the first option assigned to the product. <!---VALUEOPT---> Tag This tag is replaced by the particular option selection for the given product entry. There will be a line break after each option selection. The tag must appear in the template file as: <!---VALUEOPT---> Note: This tag may be appended with a number, <---VALUE_OPT[#]--->. PDG Commerce will replace this tag with only the option selection that corresponds to that option’s index number. If an option doesn’t exist for that index number, the tag will be ignored. Option indices start at zero. For example, <!---VALUEOPT0---> will display the menu of selections for the first option assigned to the product. <!---OPT_LINE_INV---> Tag This tag is replaced by the physical inventory for the product with the given option combination. If there is no inventory, this line will indicate whether backordering is allowed on the selected item. The tag must appear in the template file, between the OPTIONS tags, as: <!---OPT_LINE_INV---> 76 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---OPT_LINE_QTY---> Tag This tag is replaced by the ‘name’ portion of the HTML text input that will contain the quantity of the product to be added. This tag is important for accurately indexing the product’s option combinations on the template. The tag must appear within an HTML input tag, between the OPTIONS tags, as: <input name="!---OPT_LINE_QTY---" value="0"> <!---OPT_LINE_ADD---> Tag This tag is replaced by the ‘name’ portion of the HTML submit button that is used for changing quantities. This tag is important for accurately indexing the product’s option combinations on the template. The tag must appear within an HTML input tag, between the OPTIONS tags, as: <input type="submit" name="!---OPT_LINE_ADD---" value="[text to display]"> This will create a button that will add the corresponding quantity entered in the “OPT_LINE_QTY” text field, above, to the shopper’s Cart. Option Display Tags When used in the Item HTML template, the OPTION DISPLAY tags will list the options for the current product. Therefore, if a product has three options, the HTML code and PDG tags insided the OPTION DISPLAY section will be repeated three times for this product on the Item page, once for each option. The OPTION DISPLAY tags will display all options in the same fashion. Please note that the OPTION DISPLAY tags may not be used inside the OPTIONS tags. These tags must appear in the HTML template file as: <!---BEGIN_OPTION_DISPLAY---> [option display data] <!---END_OPTION_DISPLAY---> The tags that are allowed to be used between the OPTION DISPLAY tags in the Item HTML template (i.e. the option display data) are as follows: <!---OPTION_DESCRIPTION---> Tag This tag is replaced by the name or description of the current option. The tag must appear in the template file as: <!---OPTION_DESCRIPTION---> PDG Commerce -- Technical Reference Guide 77 Chapter 4 -- HTML Template Files <!---OPTION_SELECT---> Tag This tag is replaced by a drop down menu containing the available selections for the current option. The tag must appear in the template file as: <!---OPTION_SELECT---> <!---OPTION_SELECT_WITH_PRICING---> Tag This tag is replaced by a drop down menu containing the available selections for the current option. If any of the option selections have a price change assigned to them, the price change will be displayed next to the selection name in the drop down menu. The tag must appear in the template file as: <!---OPTION_SELECT_WITH_PRICING---> <!---OPTION_VERT_RADIO---> Tag This tag is replaced by a set of radio buttons. A radio button appears next to each option selection’s name. Only one radio for each option may be selected at a time. This tag will display the radio buttons and selection names in a vertical format. The tag must appear in the template file as: <!---OPTION_VERT_RADIO---> <!---OPTION_VERT_RADIO_WITH_PRICING---> Tag This tag is replaced by a set of radio buttons. A radio button appears next to each option selection’s name. Only one radio for each option may be selected at a time. If any of the option selections have a price change assigned to them, the price change will be displayed next to the selection name. This tag will display the radio buttons and selection names in a vertical format. The tag must appear in the template file as: <!---OPTION_VERT_RADIO_WITH_PRICING---> <!---OPTION_HORIZ_RADIO---> Tag This tag is replaced by a set of radio buttons. A radio button appears next to each option selection’s name. Only one radio for each option may be selected at a time. This tag will display the radio buttons and selection names in a horizontal format. The tag must appear in the template file as: <!---OPTION_HORIZ_RADIO---> <!---OPTION_HORIZ_RADIO_WITH_PRICING---> Tag This tag is replaced by a set of radio buttons. A radio button appears next to each option selection’s name. Only one radio for each option may be selected at a time. If any of the option selections have a price change assigned to them, the price change will be displayed next to the selection name. This tag will 78 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files display the radio buttons and selection names in a horizontal format. The tag must appear in the template file as: <!---OPTION_HORIZ_RADIO_WITH_PRICING---> <!---IF_CUST_TEXT---> Tag and <!---END_IF_CUST_TEXT---> Tag These tags are used to indicate the custom text display area. Any OPTION DISPLAY tags appearing in between these two tags on the page will only be displayed if the current option has a custom text selection. The tags must appear in the template file as: <!---IF_CUST_TEXT---> and <!---END_IF_CUST_TEXT---> <!---AUTO_SELECT_CUST_TEXT---> Tag This tag should be used if you are collecting custom text for each option for the product. This tag will pass the option information as a hidden input field, with the custom text selection specified. The tag must appear in the template file as: <!---AUTO_SELECT_CUST_TEXT---> <!---CUST_TEXT---> Tag This tag is replaced with an input box for custom text. By default, this input field will be displayed with a size of 20. You may specify a different size by adding size=x to the tag. The tag must appear in the template file as: <!---CUST_TEXT---> or <!---CUST_TEXT size=40---> <!---CUSTOM_TEXTAREA---> Tag This tag is replaced with an input textarea for custom text. By default, this textarea will be displayed with a column width of 20 and a rowspan of three. You may specify a different size by adding cols=x and rows=y to the tag. The tag must appear in the template file as: <!---CUSTOM_TEXTAREA---> or <!---CUSTOM_TEXTAREA cols=40 rows=5---> PDG Commerce -- Technical Reference Guide 79 Chapter 4 -- HTML Template Files MultiAdd Template File The MultiAdd Template File is used whenever the MultiPreAdd action is called. The MultiAdd template is used to allow customers to add several products to their cart with a single click. The MultiAdd Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer’s browser, it searches the file for special tags. When PDG Commerce encounters these tags, they are replaced with the appropriate information before being sent to the customer’s Web browser. In order for PDG Commerce to properly receive and process information from this template file, the MultiAdd Template File must contain a form submission back to PDG Commerce with the MultiAdd action. For all the required fields for this action, please see the MultiAdd action definition in Chapter 5 of this Technical Reference Guide. The tags used with the MultiAdd Template are the same as those that can be used with the REPEAT tags in the Item template. However, it is imperative that you use the REPEAT tags on the MultiAdd Template, as this provides the multiple listing which makes MultiAdd a special feature. For more information, see the Repeat Item template tags in the ‘Item Template File’ section, above. Note: PDG Commerce’s "locked options" feature will not be enabled when the MultiAdd template is called from the MultiPreAdd action. Please see 'Maintaining Products' of the PDG Commerce User Guide for more information on locked options. PDG Commerce is given the location of this template file from the directory and template name specified in the Templates section of the Merchant Administrator (which stores a key in the Shopper.Conf file). For more information on entering files in the Templates section, refer to the PDG Commerce User Guide. There are many different ways in which you can format the MultiAdd template. The following are three example Multiadd formats. 80 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files MultiAdd Row Format In addition to the item template tags, you may also use the following tags within the REPEAT tags on the MultiAdd page. <!---ADD_SUBMIT---> Tag This tag will be replaced by the Add Item to Cart Button image specified in the Buttons section of your Cart Administrator. The tag must appear in the template file as: <!---ADD_SUBMIT---> <!---QTY_INPUT---> Tag This tag will be replaced by an input field that allows the customer to enter a quantity amount for each product. The tag must appear in the template file as: <!---QTY_INPUT---> Below is an example of how the MultiAdd Row Format will be displayed: MultiAdd Thumbnail Format In addition to the item template tags, you may also use the following tags within the REPEAT tags on the MultiAdd page. <!---ADD_SUBMIT---> Tag This tag will be replaced by the Add Item to Cart Button image specified in the Buttons section of your Cart Administrator. The tag must appear in the template file as: <!---ADD_SUBMIT---> PDG Commerce -- Technical Reference Guide 81 Chapter 4 -- HTML Template Files <!---QTY_INPUT---> Tag This tag will be replaced by an input field that allows the customer to enter a quantity amount for each product. The tag must appear in the template file as: <!---QTY_INPUT---> Below is an example of how the MultiAdd Thumbnail Format will be displayed: Select Box Format If you wish to repeat the products on a multiadd page without including the msku variables, you may use a different set of REPEAT tags. For example, if you wish to display a drop down menu of all products available on your web site, then have the customer use this menu to access the Item page for a single product, you could not use the msku variables. In that case, you would use the REPEAT ITEM tags instead of the standard REPEAT tags. For example, the following code would display the drop down menu: <form method=post action="!---SCRIPT_NAME---"> <input type=hidden name="preadd" value="action"> <select name="key"> <!---BEGIN_REPEAT_ITEM---> <option value="!---SKU---">!---DESC---</option> <!---END_REPEAT---> </select> <input type=submit name="submit" value="Submit"> </form> 82 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Note: This code will use the constraints of the "Number of Results Per Page" field in the Search settings of the Commerce Administrator to control the amount of search results listed in the drop down menu. For more information on these settings, please view the "Configuring Product Search Results" chapter in the PDG Commerce User Guide. Below is an example of how the Select Box Format will be displayed: If you would like to enter the msku variables in a different format than that of the normal REPEAT tags, you may use the REPEAT ITEM tags with an additional sku input tag to add the msku variables in a different location: <!---SKU_INPUT---> Tag This tag will be replaced by the appropriate msku variable for each product displayed within the <!---BEGIN_REPEAT_ITEM---> and <!---END_REPEAT---> tags. The tag must appear in the template file as: <!---SKU_INPUT---> Note: If you are using the REPEAT ITEM tags on a Multiadd template but are not creating a drop down menu of products, you must include the <!---SKU_INPUT---> tag. Checkout Template File The Checkout Template File is used when PDG Commerce needs to obtain the customer’s contact, billing, and shipping information from a user after receiving the Checkout action (usually from the Basket page). For more information on the Checkout action, please see the chapter regarding PDG Commerce Actions. The Checkout Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer, it searches the HTML Template File for special tags. When PDG Commerce encounters these tags, they are replaced with the appropriate information before being sent to the customer’s Web browser. In order for PDG Commerce to properly receive and process information from this template file, the Checkout Template File must contain a form subPDG Commerce -- Technical Reference Guide 83 Chapter 4 -- HTML Template Files mission back to PDG Commerce with the Verify action. For all the required fields for this callback, please see the Verify action definition in the chapter regarding PDG Commerce Actions. The Checkout Template has many of the tags available on the Basket template page. They are described in detail with the Basket Template, and are listed here for reference: • • • • • • • • • • • • <!---BASKET---> <!---ADDITEMMSG---> <!---ADDITEMDATA---> <!---REMOVEALLMSG---> <!---SUBTOTAL---> <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> <!---PROD_CAT_QTY_DISC---> <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> The REPEAT tags, and all available tags that may be placed inside REPEAT sections. The following are the standard Checkout Template tags: • • • • • • • • • • • • • • • • • • 84 <!---ORDER---> <!---SHIPPINGMETHOD---> <!---COUNTRIES---> <!---BILLCOUNTRY---> <!---SHIPCOUNTRY---> <!---DISPLAYCART---> <!---DISPLAYFORCECOOKIE---> <!---PDGCARTFORMDATA---> <!---SUBTOTAL---> <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> !--- SUBMIT_LINK--<!---SUBTOTAL_WITH_DISCOUNT---> <!---SEC_FORCE_DATA---> ShipText and BillText PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Additionally, PDG Commerce supports these customer information related tags. These tags allow PDG Commerce to pre-fill out purchase information based on the customer’s account. • • • • • • • • • • • • • • • • • • !---EMAIL--!---PHONE1--!---BILL_FIRST_NAME--!---BILL_LAST_NAME--!---BILL_STREET1--!---BILL_STREET2--!---BILL_CITY--!---BILLSTATE--!---BILL_PROVINCE--!---BILL_ZIP--!---SHIPPING_DEST_SELECT--!---SHIP_NAME--!---SHIP_STREET1--!---SHIP_STREET2--!---SHIP_CITY--!---SHIPSTATE !---SHIP_PROVINCE--!---SHIP_ZIP--- A sample Checkout Template File is included with PDG Commerce. Below is an example of how this Checkout Template will be displayed. Please see the section on REPEAT Tags at the beginning of this chapter for more information on how to customize this template. PDG Commerce -- Technical Reference Guide 85 Chapter 4 -- HTML Template Files Sample Checkout Template Display <!---ORDER---> Tag When this tag is encountered, PDG Commerce replaces it with the customer's current cart. Unlike the cart display used in the Basket template file, this display does not allow the customer to change product quantities. While it is still formatted in a table, the total displayed for the order does not contain any additional shipping charges or sales tax. These additional costs can bedisplayed on the Verify template with some of the tags explained later. 86 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files The tag must have its own line in the template file, and must appear in the template file as: <!---ORDER---> <!---SHIPPINGMETHOD---> Tag When this tag is encountered, PDG Commerce replaces it with a drop-down menu containing all the available shipping methods as defined in your Merchant Administrator. This tag must appear inside the template as. <!---SHIPPINGMETHOD---> This field is almost always required. If you are planning to remove this field (for instance, if you have only one shipping method), you will need to replace it with an input field like the one below: <input type="hidden" name="shippingmethod" value="0"> <!---COUNTRIES---> Tag When PDG Commerce encounters this tag, it replaces it with a list of HTML “option” form inputs for all of the available countries. This tag must be inserted between HTML “select” tags in the template and can appear as: <select name="billcountry"> <!---COUNTRIES---> </select> This syntax will produce a drop-down menu which lists all of the available countries in PDG Commerce for the billcountry form input. <!---STATES---> Tag When PDG Commerce encounters this tag, it replaces it with a list of HTML “option” form inputs for all of the available states. This tag must be inserted between HTML “select” tags in the template and can appear as: <select name="billstate"> <!---STATES---> </select> This syntax will produce a drop-down menu which lists all of the available U.S. states and Canadian provinces for the billstate form input. PDG Commerce -- Technical Reference Guide 87 Chapter 4 -- HTML Template Files <!---DISPLAYCART---> Tag When this tag is encountered, PDG Commerce replaces it with the customer's current cart. Unlike the cart display used in the Basket Template File, this display does not allow the customer to change product quantities. While it is still formatted in a table, the total displayed for the order does not contain any additional shipping charges or sales tax. The tag must have its own line in the template file, and must appear in the template file as: <!---DISPLAYCART---> Note: This tag works essentially the same as the <!---ORDER---> tag, explained above. <!---DISPLAYFORCECOOKIE---> Tag When this tag is encountered, PDG Commerce replaces it with the cookie that has been appended to the shopper’s Web browser. Forced cookies are only needed if the customer’s cart is being directed to a different server (i.e. a secure server). This tag must appear in the template as: <!---DISPLAYFORCECOOKIE---> <!---PDGCARTFORMDATA---> Tag When this tag is encountered, PDG Commerce replaces it with hidden information that is necessary for the checkout process. This tag must be located within the form submission in the Checkout HTML template file. No visible information is replaced by this tag, therefore, it does not affect the visible layout of your HTML template in any way. This tag is required for the Checkout Template, and for PDG Commerce to operate properly. The tag must appear in the template file as: <!---PDGCARTFORMDATA---> <!---SUBTOTAL---> Tag This tag is replaced by the subtotal for the order in the customer’s current cart. This value represents just the total price of all of the products in the cart. Sales tax, shipping, and discounts have not been considered. The tag must appear in the template file as: <!---SUBTOTAL---> 88 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---WEIGHT_TOTAL---> Tag This tag is replaced by the total weight of all of the products in the current cart. This value may be used to calculate shipping charges if weight tables have been specified in the ‘Shipping Rules’ section of the Merchant Administrator, and this value is also used in any real-time shipping costs obtained from either UPS or USPS. The tag must appear in the template file as: <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> Tag This tag is replaced by the total number of items in the current cart. This value may be used to calculate shipping charges if quantity tables have been specified in the ‘Shipping Rules’ section of the Merchant Administrator (See the PDG Commerce User Guide for more information). The tag must appear in the template file as: <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> Tag This tag tells PDG Commerce to replace the tag with whatever subtotal-based discount may be applied to the order. This calculation is made depending upon the discounts you defined in the Merchant Administrator (See the PDG Commerce User Guide for more information). If no discount applies to the order, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---ORDER_SUBTOTAL_DISC---> <!---PROD_CAT_QTY_DISC---> Tag This tag will display all product category discounts applied to the order. Each product category quantity discount will be displayed with the label “Discount for Ordering X Products From A000”, where X is the number of products ordered from category A000. The tag must appear in the template file as: <!---PROD_CAT_QTY_DISC---> PDG Commerce -- Technical Reference Guide 89 Chapter 4 -- HTML Template Files <!---BONUS_PT_TOTAL---> Tag This tag is replaced by the total number of bonus or ‘frequent shopper’ points awarded to the current order. If no bonus points have been earned by the products in the order, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> Tag When PDG Commerce encounters this tag, it is replaces with any additional shipping charges that may have been applied to any of the products in the current order. If no additional shipping charges are incurred from any of the products in the order, PDG Commerce will ignore this tag. The tag must appear in the template file as: <!---ADD_SHIPPING_TOTAL---> !---SUBMIT_LINK--- Tag PDG Commerce replaces this with the submit button for the form, which will send shipping and billing information to the cart and proceed with collecting payment information. The tag must appear in the template file as: !---SUBMIT_LINK--- <!---SUBTOTAL_WITH_DISCOUNT---> Tag This tag is replaced by the subtotal for the order in the customer’s current order. This value represents just the total price of all of the products in the cart, with all discounting applied. This subtotal does not include any of the charges for any applied taxes or any shipping and handling. The tag must appear in the template file as: <!---SUBTOTAL---> !---EMAIL--This tag is replaced with the customer’s email address if the customer is currently logged in. !---PHONE1--This tag is replaced with the customer’s phone number if the customer is currently logged in. 90 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---BILL_FIRST_NAME--This tag is replaced with the customer’s first name of the billing information, if the customer is currently logged in. !---BILLFIRSTNAME--This tag is replaced with the HTML code for an edit box which contains the first name of the customer’s billing information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---BILL_LAST_NAME--This tag is replaced with the customer’s last name of the billing information, if the customer is currently logged in. !---BILLLASTNAME--This tag is replaced with the HTML code for an edit box which contains the last name of the customer’s billing information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---BILL_STREET1--This tag is replaced with the first line of the customer’s of the street information of the billing adress, if the customer is currently logged in. !---BILLSTREET1--This tag is replaced with the HTML code for an edit box which contains the first line of the street address of the customer’s billing information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---BILL_STREET2--This tag is replaced with the first second of the customer’s of the street information of the billing adress, if the customer is currently logged in. PDG Commerce -- Technical Reference Guide 91 Chapter 4 -- HTML Template Files !---BILLSTREET2--This tag is replaced with the HTML code for an edit box which contains the second line of the street address of the customer’s billing information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---BILL_CITY--This tag is replaced with the customer’s city of the billing information, if the customer is currently logged in. !---BILLCITY--This tag is replaced with the HTML code for an edit box which contains the city of the customer’s billing information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---BILLSTATE--This tag is replaced with the customer’s state of the billing information, if the customer is currently logged in. !---BILL_PROVINCE--This tag is replaced with the customer’s province of the billing information, if the customer is currently logged in. <!---BILLCOUNTRY---> Tag When this tag is encountered, PDG Commerce replaces it with a drop-down menu containing all the countries with their corresponding numeric code for PDG Commerce. The value selected by the customer may later be used for UPS real-time cost capturing, as well as determining the applicable shipping, handling, and tax rules (if the customer opts to ship to their billing address). The name of the drop-down menu is ‘billcountry’ and is used specifically to generate the ‘billcountry’ form input. This tag must be inside the form submission to PDG Commerce with the Verify action. <!---BILLCOUNTRY---> 92 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files This field can be removed, but must be replaced with its HTML equivalent. For instance, if you only offer shipping to the United States, this field would look like: <input type="hidden" name="billcountry" value="461"> If you wanted to offer shipping to the US and Canada: <select name="billcountry"> <option value="461">United States <option value="69">Canada </select> A list of the country codes you would need to reference for this type of syntax is found later in this manual. !---BILL_ZIP--This tag is replaced with the customer’s postal code of the billing information, if the customer is currently logged in. !---BILLZIP--This tag is replaced with the HTML code for an edit box which contains the postal code of the customer’s billing information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---SHIPPING_DEST_SELECT--This tag is replaced with the HTML for a drop-down select menu box, which allows the customer to select a secondary shipping address to use instead of the primary shipping address. Customers can define secondary shipping addresses in the UserUpdate template. !---SHIP_NAME--This tag is replaced with the customer’s name for the primary shipping address, if the customer is currently logged in. !---SHIPNAME--This tag is replaced with the HTML code for an edit box which contains the name of the customer’s primary shipping information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. PDG Commerce -- Technical Reference Guide 93 Chapter 4 -- HTML Template Files !---SHIP_STREET1--This tag is replaced with the first line of the customer’s street for the primary shipping address, if the customer is currently logged in. !---SHIPSTREET1--This tag is replaced with the HTML code for an edit box which contains the first line of the street address of the customer’s primary shipping information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---SHIP_STREET2--This tag is replaced with the second line of the customer’s street for the primary shipping address, if the customer is currently logged in. !---SHIPSTREET2--This tag is replaced with the HTML code for an edit box which contains the second line of the street address of the customer’s primary shipping information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---SHIP_CITY--This tag is replaced with the customer’s city for the primary shipping address, if the customer is currently logged in. !---SHIPCITY--This tag is replaced with the HTML code for an edit box which contains the city of the customer’s primary shipping information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. !---SHIPSTATE--This tag is replaced with the customer’s state for the primary shipping address, if the customer is currently logged in. 94 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---SHIP_PROVINCE--This tag is replaced with the customer’s province for the primary shipping address, if the customer is currently logged in. <!---SHIPCOUNTRY---> Tag When this tag is encountered, PDG Commerce replaces it with a drop-down menu containing all the countries with their corresponding numeric codes for PDG Commerce. This code may later be used for UPS real-time cost capturing, as well as determining the applicable shipping, handling, and tax rules. The name of the drop down menu is ‘shipcountry’ and is used to specifically generate the shipcountry form input. This tag must be inside the form submission to PDG Commerce with the Verify action. The tag must have its own line in the template file, and must appear in the template file as: <!---SHIPCOUNTRY---> !---SHIP_ZIP--This tag is replaced with the customer’s postal code for the primary shipping address, if the customer is currently logged in. !---SHIPZIP--This tag is replaced with the HTML code for an edit box which contains the postal code of the customer’s primary shipping information, if the customer is currently logged in. The edit box will already be properly named so that any changes to it will be saved when the customer continues on to the Verify step. ShipText and BillText You can provide blank form inputs on your Checkout template to allow customers to provide you with any special shipping or billing instructions. The field for additional billing information must be named “billtext.” The field for additional shipping information must be named “shiptext.” The text in these form fields will be saved by PDG Commerce and can be optionally displayed on the Verify and ThankYou templates. PDG Commerce -- Technical Reference Guide 95 Chapter 4 -- HTML Template Files Basket Template Tags In addition to the standard Checkout Template tags, the Checkout HTML Template can also take any of the standard Basket Template tags. The standard Basket Template tags allow you to customize the display of the customer’s cart on the Checkout page. ‘REPEAT’ and ‘OPTIONS’ Tags Like the Basket template, the Checkout Template can also utilize the REPEAT and OPTIONS tags. The tags used within the REPEAT and OPTIONS tags for the Checkout HTML template are the same as those used in the Basket HTML template (i.e. the Repeat Basket tags and the Options Basket tags). For information on what tags can be used with the REPEAT and OPTIONS tags in the Checkout Template, please see the ‘Basket Template File’ section of this chapter. Passthrough Fields Any form field whose name begins with the four letters “PASS” will have its values automatically forwarded to the final ThankYou templates, log files, and emails. For example: <input type="text" name="PASSGiftCard" size="20"> The example above will create a text field in this template for customer input. Whatever the user types in this field will automatically be forwarded to the notification e-mails, ThankYou template, and order log file under the label “GiftCard”. Verify Template File The Verify Template File is used when PDG Commerce needs to verify a customer’s contact, billing, and shipping information. It is also used to collect payment information from a customer after receiving the Verify action. The Verify Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer’s browser, it searches the file for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s Web browser. In order for PDG Commerce to properly receive and process information from this template file, the Verify Template File must contain a form submission back to PDG Commerce with the BuyIt action. For all the required fields 96 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files for this callback, please see the BuyIt action definition in this Technical Reference Guide. The following are the standard Verify Template tags: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • <!---CUSTOMER---> <!---BILLTO---> <!---SHIPTO---> <!---PDGCARTFORMDATA---> <!---BILLMETHOD---> <!---BILLNAME---> <!---BILLADDRESS---> <!---BILLCITY---> <!---BILLSTATE---> <!---BILLZIP---> <!---BILLEMAIL---> <!---BILLAMOUNT---> <!---BILLDATE---> <!---ORDER---> <!---BILLPHONE1---> <!---BILLPHONE2---> <!---SHIPNAME---> <!---SHIPADDRESS---> <!---SHIPCITY---> <!---SHIPSTATE---> <!---SHIPZIP---> <!---COMPANY---> <!---SUBTOTAL---> <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> <!---PROD_CAT_QTY_DISC---> <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> <!---TOTAL---> <!---TAX---> <!---SHIPPING_TOTAL---> <!---FLUX_AMOUNT---> <!---PRE_FLUX_TOTAL---> <!---BILLCOUNTRY---> <!---SHIPCOUNTRY---> !---SUBMIT_LINK--<!---SUBTOTAL_WITH_DISCOUNT---> PDG Commerce -- Technical Reference Guide 97 Chapter 4 -- HTML Template Files • • • <!---SHIP_METHOD---> <!---BILLTEXT---> <!---SHIPTEXT---> Additionally, there are some specialized tags that can be used for specific Internet payment services. These are: • • • • • • !---PAYFLOW_LINK_ACTION--<!---PAYFLOW_ORDER_DATA---> !---PAYPAL_ACTION--<!---PAYPAL_DATA---> !---WORLDPAY_ACTION--<!---WORLDPAY_DATA---> A sample Verify Template File is included with PDG Commerce. Here is an example of how that template may be displayed. Please see the sections below on ‘Basket Tags’ and ‘REPEAT Tags’ for more information on how to customize this template. 98 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Sample Verify Template Display <!---CUSTOMER---> Tag This tag is replaced by all of the customer’s complete billing and shipping information as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---CUSTOMER---> Note: If the <!---CUSTOMER---> tag is used, then none of the following tags relating to the customer’s address need to be implemented. PDG Commerce -- Technical Reference Guide 99 Chapter 4 -- HTML Template Files <!---BILLTO---> Tag When PDG Commerce encounters this tag, the tag is replaced with the customer's billing information. This includes the name and complete billing address as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLTO---> Note: If the <!---BILLTO---> tag is used, then none of the following tags relating to the customer’s billing address need to be implemented. <!---SHIPTO---> Tag When PDG Commerce encounters this tag, the tag is replaced with the customer's shipping information. This includes the name and complete shipping address as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---SHIPTO---> Note: If the <!---SHIPTO---> tag is used, then none of the following tags relating to the customer’s shipping address need to be implemented. <!---PDGCARTFORMDATA---> Tag When this tag is encountered, PDG Commerce replaces it with hidden information that is necessary for the checkout process. This tag must be located within the form submission in the Verify HTML template file. No visible information is replaced by this tag, therefore, it will not affect the visible layout of your Web store in any way. This tag is required for the Verify Template, and for PDG Commerce to operate properly. This tag must appear inside the form submission to PDG Commerce with the Verify action. The tag must appear in the template file as: <!---PDGCARTFORMDATA---> <!---BILLMETHOD---> Tag When PDG Commerce encounters this tag, it is replaced by a pull-down select box, allowing the customer to choose a payment method. The payment methods are definied by the store merchant in the Merchant Administrator. The tag must appear in the template file as: <!---BILLMETHOD---> 100 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---BILLNAME---> Tag When PDG Commerce encounters this tag, it is replaced by the billing name as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLNAME---> <!---BILLADDRESS---> Tag When PDG Commerce encounters this tag, it is replaced by the billing address as supplied by the customer on the Checkout page. The billaddr1 and billaddr2 are combined to create the text that replaces this tag. The tag must appear in the template file as: <!---BILLADDRESS---> <!---BILLCITY---> Tag When PDG Commerce encounters this tag, it is replaced by the billing city as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLCITY---> <!---BILLSTATE---> Tag When PDG Commerce encounters this tag, it is replaced by the billing state as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLSTATE---> <!---BILLZIP---> Tag When PDG Commerce encounters this tag, it is replaced by the billing ZIP code as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLZIP---> PDG Commerce -- Technical Reference Guide 101 Chapter 4 -- HTML Template Files <!---BILLCOUNTRY---> Tag When PDG Commerce encounters this tag, it is replaced by the billing country as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLCOUNTRY---> <!---BILLEMAIL---> Tag This tag is replaced by the e-mail address to which billing information should be sent. This value should have been entered by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLEMAIL---> <!---BILLPHONE1---> Tag When PDG Commerce encounters this tag, it is replaced by the primary phone number as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLPHONE1---> <!---BILLPHONE2---> Tag When PDG Commerce encounters this tag, it is replaced by the secondary phone number as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---BILLPHONE2---> <!---BILLAMOUNT---> Tag This tag is replaced with the amount of the order that is to be billed to the customer. This total includes tax, shipping and any additional charges or discounts that may have been applied. The tag must appear in the template file as: <!---BILLAMOUNT---> 102 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---BILLDATE---> Tag This tag is replaced by the date on which the order is to be billed. This will generally yield the current date. The tag must appear in the template file as: <!---BILLDATE---> <!---ORDER---> Tag When this tag is encountered, PDG Commerce replaces it with the customer's current cart. This information is formatted in a table. Unlike the cart display used in the Basket Template File, this display does not allow the customer to change product quantities. Unlike the <!---ORDER---> tag used in the Checkout Template File, this order output contains all additional shipping costs and applicable tax. The tag must have its own line in the template file, and must appear in the template file as: <!---ORDER---> <!---SHIPNAME---> Tag When PDG Commerce encounters this tag, it is replaced by the name to which the order will be shipped, as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---SHIPNAME---> <!---SHIPADDRESS---> Tag When PDG Commerce encounters this tag, it is replaced by the address to which the order will be shipped, as supplied by the customer on the Checkout page. The fields shippaddr1 and shipaddr2 are combined to form the text that replaces this text. The tag must appear in the template file as: <!---SHIPADDRESS---> <!---SHIPCITY---> Tag When PDG Commerce encounters this tag, it is replaced by the city to which the order will be shipped, as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---SHIPCITY---> PDG Commerce -- Technical Reference Guide 103 Chapter 4 -- HTML Template Files <!---SHIPSTATE---> Tag When PDG Commerce encounters this tag, it is replaced by the state to which the order will be shipped, as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---SHIPSTATE---> <!---SHIPZIP---> Tag When PDG Commerce encounters this tag, it is replaced by the ZIP code to which the order will be shipped, as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---SHIPZIP---> <!---COMPANY---> Tag When PDG Commerce encounters this tag, it is replaced by the company name supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---COMPANY---> <!---SHIPCOUNTRY---> Tag When PDG Commerce encounters this tag, it is replaced by the country to which the order will be shipped, as supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---SHIPCOUNTRY---> <!---SUBTOTAL---> Tag This tag is replaced by the subtotal for the order. This price does not include sales tax, shipping charges or any other charges or discounts. The tag must appear in the template file as: <!---SUBTOTAL---> Note: This tag may be appended with a “C”, <---SUBTOTALC--->. PDG Commerce will replace this tag with the subtotal of the order converted to the secondary currency. 104 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---WEIGHT_TOTAL---> Tag This tag is replaced by the total weight of all of the products in the current cart. This value may be used to calculate shipping charges if weight tables have been specified in the ‘Shipping Rules’ section of the Merchant Administrator. This value is also used when real-time shipping costs are obtained from either UPS or USPS. The tag must appear in the template file as: <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> Tag This tag is replaced by the total number of items in the current cart. This value may be used to calculate shipping charges if quantity tables have been specified the ‘Shipping Rules’ section of the Merchant Administrator. The tag must appear in the template file as: <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> Tag This tag tells PDG Commerce to replace the tag with whatever subtotal-based discount may be applied to the order. This calculation is made depending upon the discounts you defined in the Merchant Administrator. If no discount applies to the order, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---ORDER_SUBTOTAL_DISC---> Note: This tag may be appended with the letter “C”, <---ORDER_SUBTOTAL_DISCC--->. PDG Commerce will replace this tag with the order’s subtotal discount converted to the secondary currency. <!---PROD_CAT_QTY_DISC---> Tag This tag will display all product category quantity discounts applied to the order. Each product category quantity discount will be displayed with the label “Discount for Ordering X Products From A000”, where X is the number of products ordered from category A000. The tag must appear in the template file as: <!---PROD_CAT_QTY_DISC---> PDG Commerce -- Technical Reference Guide 105 Chapter 4 -- HTML Template Files <!---BONUS_PT_TOTAL---> Tag This tag is replaced by the total number of bonus or ‘frequent shopper’ points incurred by the order. If no bonus points are earned by the order, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> Tag This tag tells PDG Commerce to replace the tag with any additional shipping charges that may have been applied to any of the products in the current cart. If no additional shipping charges are incurred from any of the products on the order, PDG Commerce will ignore this tag. The tag must appear in the template file as: <!---ADD_SHIPPING_TOTAL---> Note: This tag may be appended with the letter “C”, <---ADD_SHIPPING_TOTALC--->. PDG Commerce will replace this tag with the total additional shipping charges for any products in the order converted to the secondary currency. <!---TOTAL---> Tag This tag is replaced by the total cost of the order. This price includes all product and option costs, sales tax, shipping and additional charges placed on the order as well as any discounts that may have been applied to the order. The tag must appear in the template file as: <!---TOTAL---> Note: This tag may be appended with a “C”, <---TOTALC--->. PDG Commerce will replace this tag with the total cost of the order converted to the secondary currency. <!---TAX---> Tag This tag is replaced by the total sales tax placed on the order. If there is no sales tax to include, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---TAX---> Note: This tag may be appended with a “C”, <---TAXC--->. PDG Commerce will replace this tag with the order’s total sales tax converted to the secondary currency. 106 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---SHIPPING_TOTAL---> Tag This tag is replaced by the total shipping charges applied to the order. This includes all shipping charges attributed to the weight, subtotal, shipping method or the products themselves. The tag must appear in the template file as: <!---SHIPPING_TOTAL---> Note: This tag may be appended with a “C”, <---SHIPPING_TOTALC--->. PDG Commerce will replace this tag with the total shipping charges for the order converted to the secondary currency. <!---FLUX_AMOUNT---> Tag This tag is replaced by the amount that was added to the order to accommodate changes in currency exchange rates. If a currency conversion has not been made, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---FLUX_AMOUNT---> Note: This tag may be appended with a “C”, <---FLUX_AMOUNTC--->. PDG Commerce will replace this tag with the order’s flux amount converted to the secondary currency. <!---PRE_FLUX_TOTAL---> Tag This tag is replaced by the total of the order after the amount has been converted to the secondary currency, but before the “Flux Amount” is added. If a currency conversion has not been made, then this tag is replaced with “0.0”. The tag must appear in the template file as: <!---PRE_FLUX_TOTAL---> Note: This tag may be appended with a “C”, <---PRE_FLUX_TOTALC--->. PDG Commerce will replace this tag with the order’s pre-flux total converted to the secondary currency. !---SUBMIT_LINK--- Tag This tag is replaced by the submit button for the form, which collects the entered payment information and processes the order. The tag must appear in the template file as: !---SUBMIT_LINK--- PDG Commerce -- Technical Reference Guide 107 Chapter 4 -- HTML Template Files <!---SUBTOTAL_WITH_DISCOUNT---> Tag This tag is replaced by the subtotal for the order in the customer’s current order. This value represents just the total price of all of the products in the cart, with all discounting applied. This subtotal does not include any of the charges for any applied taxes or any shipping and handling. The tag must appear in the template file as: <!---SUBTOTAL---> <!---SHIP_METHOD---> Tag This tag is replaced by the shipping method chosen by the customer. The tag must appear in the template file as: <!---SHIP_METHOD---> <!---BILLTEXT---> Tag If you provided a field in the Checkout template named “billtext,” then this tag will be replaced with the customer-supplied text from that field. The tag must appear in the template file as: <!---BILLTEXT---> <!---SHIPTEXT---> Tag If you provided a field in the Checkout template named “shiptext,” then this tag will be replaced with the customer-supplied text from that field. The tag must appear in the template file as: <!---SHIPTEXT---> !---EMAIL--This tag is replaced with the customer’s email address if the customer is currently logged in. !---PHONE1--This tag is replaced with the customer’s phone number if the customer is currently logged in. 108 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---BILLFIRSTNAME--This tag is replaced with the customer’s first name of the billing information, if the customer is currently logged in. !---BILLLASTNAME--This tag is replaced with the customer’s last name of the billing information, if the customer is currently logged in. !---BILLSTREET1--This tag is replaced with the first line of the customer’s of the street information of the billing adress, if the customer is currently logged in. !---BILLSTREET2--This tag is replaced with the first second of the customer’s of the street information of the billing adress, if the customer is currently logged in. !---BILLCITY--This tag is replaced with the customer’s city of the billing information, if the customer is currently logged in. !---BILLSTATE--This tag is replaced with the customer’s state of the billing information, if the customer is currently logged in. !---BILLPROVINCE--This tag is replaced with the customer’s province of the billing information, if the customer is currently logged in. !---BILLZIP--This tag is replaced with the customer’s postal code of the billing information, if the customer is currently logged in. PDG Commerce -- Technical Reference Guide 109 Chapter 4 -- HTML Template Files !---SHIPNAME--This tag is replaced with the customer’s name for the primary shipping address, if the customer is currently logged in. !---SHIPSTREET1--This tag is replaced with the first line of the customer’s street for the primary shipping address, if the customer is currently logged in. !---SHIPSTREET2--This tag is replaced with the second line of the customer’s street for the primary shipping address, if the customer is currently logged in. !---SHIPCITY--This tag is replaced with the customer’s city for the primary shipping address, if the customer is currently logged in. !---SHIPSTATE--This tag is replaced with the customer’s state for the primary shipping address, if the customer is currently logged in. !---SHIPPROVINCE--This tag is replaced with the customer’s province for the primary shipping address, if the customer is currently logged in. !---SHIPZIP--This tag is replaced with the customer’s postal code for the primary shipping address, if the customer is currently logged in. 110 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Basket Template Tags In addition to the standard Verify Template tags, the Verify HTML Template can also take any of the Basket Template Repeat tags. The use of the Basket Template Repeat tags allows you to display the customer’s cart on the Verify page. This allows you to customize what is displayed on your Web store’s Verify page. ‘REPEAT’ and ‘OPTIONS’ Tags Like the Basket template, the Verify Template can also utilize the REPEAT and OPTIONS tags. The tags used within the REPEAT and OPTIONS tags for the Verify HTML template are the same as those used in the Basket HTML template (i.e.: the Repeat Basket tags and the Options Basket tags). For information on what tags can be used with the REPEAT and OPTIONS tags in the Verify Template, please see the ‘Basket Template File’ section of this chapter. Passthrough Fields Any form field whose name begins with the four letters “PASS” will have its values automatically forwarded to the final ThankYou templates and notification e-mails. For example: <input type="text" name="PASSGiftCard" size="20"> The example above will create a field in this template for customer input. Whatever the user types in this field is automatically forwarded to the emails, ThankYou templates, and order.log file, and labelled as “GiftCard”. Note: It is not mandatory for the customer to enter any information in this field – they can leave it blank and still check out normally. This field could be made mandatory by using JavaScript, but this is outside the normal functionality of PDG Commerce. Payflow Link Tags If you are using Payflow Link as one of several payment methods, then PDG Commerce will use a redirect page to take the customer to Payflow Link if it was the chosen payment method on the Verify page. This page will be displayed by default. However, if you would like to customize the redirect page, you may create a template and enter its name in the Payflow Link settings of your Merchant Administrator. Your template should contain the following code: PDG Commerce -- Technical Reference Guide 111 Chapter 4 -- HTML Template Files <html> <body onLoad=”javascript:setTimeout(‘document.forms.pdgredirect.submit()’,4000);”> <form action=”!---PAYFLOW_LINK_ACTION---” method=POST name=pdgredirect> <!---PAYFLOW_ORDER_DATA---> <center>Please wait while we direct you to VeriSign’s secure web site to complete your payment.</center> <center>Thank you for your patience.</center> <center><input type=submit name= value=”Go To VeriSign’s PayFlow Link Payment Pages (click here if you are not redirected automatically)”> </center> </form> </body> </html> If you are using Payflow Link as your only payment method, you can embed the form in your Verify page and skip the redirect page. In that case your Verify template should contain the following code: <form action=”!---PAYFLOW_LINK_ACTION---” method=POST name=pdgredirect> <!---PAYFLOW_ORDER_DATA---> </form> PayPal Tags If you are using PayPal as one of several payment methods, then PDG Commerce will use a redirect page to take the customer to PayPal if it was the chosen payment method on the Verify page. This page will be displayed by default. However, if you would like to customize the redirect page, you may create a template and enter its name in the PayPal settings of your Merchant Administrator. Your template should contain the following code: <html> <body onLoad=”javascript:setTimeout(‘document.forms.pdgredirect.submit()’,4000);”> <form action=”!---PAYPAL_ACTION---” method=POST name=pdgredirect> <!---PAYPAL_DATA---> 112 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <center>Please wait while we direct you to PayPal’s secure web site to complete your payment.</center> <center>Thank you for your patience.</center> <center><input type=submit name= value=”Go to PayPal’s payment server (click here if you are not redirected automatically)”></center> </form> </body> </html> If you are using PayPal as your only payment method, you can embed the form in your Verify page and skip the redirect page. In that case your Verify template should contain the following code: <form action=”!---PAYPAL_ACTION---” method=POST name=pdgredirect> <!---PAYPAL_DATA---> </form> WorldPay Tags If you are using WorldPay as one of several payment methods, then PDG Commerce will use a redirect page to take the customer to WorldPay if it was the chosen payment method on the Verify page. This page will be displayed by default. However, if you would like to customize the redirect page, you may create a template and enter its name in the WorldPay settings of your Merchant Administrator. Your template should contain the following code: <html> <body onLoad=”javascript:setTimeout(‘document.forms.pdgredirect.submit()’,4000);”> <form action=”!---WORLDPAY_ACTION---” method=POST name=pdgredirect> <!---WORLDPAY_DATA---> <center>Please wait while we direct you to WorldPay’s secure web site to complete your payment.</center> <center>Thank you for your patience.</center> <center><input type=submit name= value=”Go to WorldPay’s payment server (click here if you are not redirected automatically”></center> </form> </body> PDG Commerce -- Technical Reference Guide 113 Chapter 4 -- HTML Template Files </html> If you are using WorldPay as your only payment method, you can embed the form in your Verify page and skip the redirect page. In that case your Verify template should contain the following code: <form action=”!---WORLDPAY_ACTION---” method=POST name=pdgredirect> <!---WORLDPAY_DATA---> </form> ThankYou Template File The ThankYou Template File is used after the BuyIt action has been received and the order has been submitted. The ThankYou Template File is essentially an HTML Web page. However, before PDG Commerce sends the HTML Template File to the customer, it searches the file for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s Web browser. The following are the standard ThankYou Template tags: • • • • • • • • • • • • • • • • • • • • 114 <!---ORDERINFO---> <!---INVOICE---> <!---CCAUTHNUMBER---> <!---TOTAL---> <!---SUBTOTAL---> <!---SOFTGOODS---> <!---FIRSTNAME---> <!---LASTNAME---> <!---NAME---> <!---ADDR1---> <!---ADDR2---> <!---CITY---> <!---STATE---> <!---COUNTRY---> <!---ZIP---> <!---BRANDSFORLESS---> <!---INKTOMI---> <!---EMAIL---> <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • <!---ORDER_SUBTOTAL_DISC---> <!---PROD_CAT_QTY_DISC---> <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> <!---TAX---> <!---SHIPPING_TOTAL---> <!---FLUX_AMOUNT---> <!---PRE_FLUX_TOTAL---> <!---BILLNAME---> <!---BILLADDRESS---> <!---BILLCITY---> <!---BILLSTATE---> <!---BILLZIP---> <!---BILLCOUNTRY---> <!---BILLAMOUNT---> <!---BILLDATE---> <!---BILLPHONE1---> <!---BILLPHONE2---> <!---SHIPNAME---> <!---SHIPADDRESS---> <!---SHIPCITY---> <!---SHIPSTATE---> <!---SHIPZIP---> <!---SHIPCOUNTRY---> <!---COMPANY---> <!---BILLMETHOD---> <!---SUBTOTAL_WITH_DISCOUNT---> <!---SHIP_METHOD---> <!---BILLTEXT---> <!---SHIPTEXT---> <!---CARD_TYPE---> <!---CARD_NUMBER---> <!---CARD_EXP_DATE---> <!---BANK_NAME---> <!---ROUTING_NUMBER---> <!---CHECK_NUMBER---> <!---ACCOUNT_NUMBER---> <!---PASSTHROUGH---> PDG Commerce -- Technical Reference Guide 115 Chapter 4 -- HTML Template Files A sample ThankYou Template File is included with PDG Commerce. Below is an example of how this template will be displayed. Sample Thank You Template Display <!---ORDERINFO---> Tag When this tag is encountered in the ThankYou Template File, this tag is replaced with the complete invoice of the order submitted. The invoice will be displayed in table format. The invoice includes: • • The unique invoice number • • The complete contact, billing, and shipping information. The complete order, with the final total considering shipping, tax and discounts The payment information, with any credit card information properly censored The tag must have its own line in the template file, and must appear in the template file as: <!---ORDERINFO---> Note: If the <!---ORDERINFO---> tag is used, then none of the following tags, with the exception of the CCAUTHNUMBER tag and the SOFTGOODS tag, will need to be implemented, as they will appear in the ORDERINFO tag. CCAUTHNUMBER and SOFTGOODS are exceptions, do not appear in the ORDERINFO tag, and must be placed on the template in order to be displayed. 116 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---INVOICE---> Tag This tag is replaced with the unique invoice number for the order. The tag must appear in the template file as: <!---INVOICE---> <!---CCAUTHNUMBER---> Tag This tag is replaced by the authorization number, assigned by the payment authorization service, that corresponds to the current order. This number can be referred to in order to track your authorization service’s activities. The tag must appear in the template file as: <!---CCAUTHNUMBER---> Note that this information does not appear in the ORDERINFO tag. If you wish for the authorization number to be displayed, this tag will need to be used, regardless of whether ORDERINFO is used or not. <!---TOTAL---> Tag This tag is replaced by the total amount for which the transaction was authorized. This represents the total amount of the order considering sales tax, shipping charges and any additional charges or discounts. The tag must appear in the template file as: <!---TOTAL---> <!---SUBTOTAL---> Tag This tag is replaced by the subtotal of the order. This represents just the cost of the products ordered and does not include sales tax, shipping charges, etc. The tag must appear in the template file as: <!---SUBTOTAL---> <!---SOFTGOODS---> Tag This tag is replaced by the Softgood data entered for the products being ordered. This data will generally consist of a link to a URL that contains a link to download the purchased Softgood product. If there is no Softgood data for any of the products being ordered, then this tag is ignored. The tag must appear in the template file as: <!---SOFTGOODS---> PDG Commerce -- Technical Reference Guide 117 Chapter 4 -- HTML Template Files Note that this information does not appear in the SOFTGOODS tag. If you wish for the authorization number to be displayed, this tag will need to be used, regardless of whether SOFTGOODS is used or not. For information on utilizing the Softgood Data, please refer to the appropriate chapter on Softgood Data in this Technical Reference Manual. <!---FIRSTNAME---> Tag This tag is replaced by the first name of the billing information of the customer by whom the order was placed. The tag must appear in the template file as: <!---FIRSTNAME---> <!---LASTNAME---> Tag This tag is replaced by the last name of the billing information of the customer by whom the order was placed. The tag must appear in the template file as: <!---LASTNAME---> Note: If the <!---FIRSTNAME---> and <!---LASTNAME---> tags are used, then the following <!---NAME---> tag does need to be implemented, as it would be redundant. <!---NAME---> Tag This tag is replaced by the full name of the billing information of the customer by whom the order was placed. If this tag is used, you should not use either of the two tags above. The tag must appear in the template file as: <!---NAME---> <!---ADDR1---> Tag This tag is replaced by the first line of the billing information of the street address from which the customer placed the order. The tag must appear in the template file as: <!---ADDR1---> 118 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---ADDR2---> Tag This tag is replaced by the second line of the billing information of the address from which the customer placed the order. The tag must appear in the template file as: <!---ADDR2---> <!---CITY---> Tag This tag is replaced by the city from the billing information of the customer that placed the order. The tag must appear in the template file as: <!---CITY---> <!---STATE---> Tag This tag is replaced by the state from the billing information of the customer that placed the order. The tag must appear in the template file as: <!---STATE---> <!---COUNTRY---> Tag This tag is replaced by the country from the billing information of the customer that placed the order. The tag must appear in the template file as: <!---COUNTRY---> <!---ZIP---> Tag This tag is replaced by the ZIP code from the billing information of the customer that placed the order. The tag must appear in the template file as: <!---ZIP---> <!---EMAIL---> Tag This tag is replaced by the e-mail address for the customer who placed the order. The tag must appear in the template file as: <!---EMAIL---> PDG Commerce -- Technical Reference Guide 119 Chapter 4 -- HTML Template Files <!---BRANDSFORLESS---> Tag This tag is replaced by the affiliate tracking information provided by Brands for Less. This is a third party affiliate tracking system, and you must first set up an account with Brands For Less before you will be able to utilize this tag. If the order contains no affiliate tracking information, then this tag is ignored. The tag must appear in the template file as: <!---BRANDSFORLESS---> <!---INKTOMI---> Tag This tag is replaced by the affiliate tracking information provided by Inktomi. This is a third party affiliate tracking system, and you must first set up an account with Inktomi before you will be able to utilize this tag. If there is no affiliate tracking information to report for this order, then this tag is ignored. The tag must appear in the template file as: <!---INKTOMI---> <!---WEIGHT_TOTAL---> Tag This tag is replaced by the total weight of all of the products in the order. This value may have been used to calculate shipping charges if weight tables were specified in the ‘Shipping Rules’ section of the Merchant Administrator. This value is also used for any real-time shipping costs that are obtained from either UPS or USPS. The tag must appear in the template file as: <!---WEIGHT_TOTAL---> <!---NUM_ITEMS---> Tag This tag is replaced by the total number of items in the order. This value may have been used to calculate shipping charges if quantity tables were specified the ‘Shipping Rules’ section of the Merchant Administrator. The tag must appear in the template file as: <!---NUM_ITEMS---> <!---ORDER_SUBTOTAL_DISC---> Tag This tag tells PDG Commerce to replace the tag with whatever subtotal-based discount may have been applied to the order. This calculation is made depending upon the discounts you defined in the Merchant Administrator. If no discount applies to the order, then this tag is replaced with “0.00”. The tag must appear in the template file as: 120 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---ORDER_SUBTOTAL_DISC---> Note: This tag may be appended with the letter “C”, <---ORDER_SUBTOTAL_DISCC--->. PDG Commerce will replace this tag with the order’s subtotal discount converted to the secondary currency. <!---PROD_CAT_QTY_DISC---> Tag This tag will display all product category quantity discounts applied to the order. Each product category quantity discount will be displayed with the label “Discount for Ordering X Products From A000”, where X is the number of products ordered from category A000. The tag must appear in the template file as: <!---PROD_CAT_QTY_DISC---> <!---BONUS_PT_TOTAL---> Tag This tag is replaced by the total number of bonus or ‘frequent shopper’ points incurred by the order. If no bonus points were earned by the order, then this tag is replaced with “0.00”. The tag must appear in the template file as: <!---BONUS_PT_TOTAL---> <!---ADD_SHIPPING_TOTAL---> Tag This tag is replaced by the total additional shipping charges for any products in the order. These are shipping charges attributed to the products themselves. If there were no additional shipping charges incurred by any of the products in the order, then this tag is replaced with “0.00”. The tag must appear in the template file as: <!---ADD_SHIPPING_TOTAL---> Note: This tag may be appended with the letter “C”, <---ADD_SHIPPING_TOTALC--->. PDG Commerce will replace this tag with the total additional shipping charges for any products in the order converted to the secondary currency. <!---TAX---> Tag This tag is replaced by the sales tax applied to the order. If there was no sales tax applied to the order, then this tag is replaced with “0.00”. The tag must appear in the template file as: <!---TAX---> PDG Commerce -- Technical Reference Guide 121 Chapter 4 -- HTML Template Files Note: This tag may be appended with a “C”, <---TAXC--->. PDG Commerce will replace this tag with the order’s total sales tax converted to the secondary currency. <!---SHIPPING_TOTAL---> Tag This tag is replaced by the total shipping charges placed on the order. This includes all shipping charges based on order’s subtotal, weight, shipping method, or the products themselves. The tag must appear in the template file as: <!---SHIPPING_TOTAL---> Note: This tag may be appended with a “C”, <---SHIPPING_TOTALC--->. PDG Commerce will replace this tag with the order’s total shipping charges converted to the secondary currency. <!---FLUX_AMOUNT---> Tag This tag is replaced by the amount that was added to the order to accommodate changes in currency exchange rates. If a currency conversion was not made, then this tag is replaced with “0.00”. The tag must appear in the template file as: <!---FLUX_AMOUNT---> Note: This tag may be appended with a “C”, <---FLUX_AMOUNTC--->. PDG Commerce will replace this tag with the order’s flux amount converted to the secondary currency. <!---PRE_FLUX_TOTAL---> Tag This tag is replaced by the total of the order after that amount was converted to the secondary currency, but before the Flux Amount is added (see above). If a currency conversion was not made, then this tag is replaced with “0.00”. The tag must appear in the template file as: <!---PRE_FLUX_TOTAL---> Note: This tag may be appended with a “C”, <---PRE_FLUX_TOTALC--->. PDG Commerce will replace this tag with the order’s pre-flux total converted to the secondary currency. 122 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---BILLNAME---> Tag This tag is replaced with the name, as supplied by the customer on the Checkout page, to which the order is to be billed. The tag must appear in the template file as: <!---BILLNAME---> <!---BILLADDRESS---> Tag This tag is replaced with the street address, as supplied by the customer on the Checkout page, to which the order is to be billed. The tag must appear in the template file as: <!---BILLADDRESS---> <!---BILLCITY---> Tag This tag is replaced with the city, as supplied by the customer on the Checkout page, to which the order is to be billed. The tag must appear in the template file as: <!---BILLCITY---> <!---BILLSTATE---> Tag This tag is replaced with the state, as supplied by the customer on the Checkout page, to which the order is to be billed. The tag must appear in the template file as: <!---BILLSTATE---> <!---BILLZIP---> Tag This tag is replaced with the ZIP code, as supplied by the customer on the Checkout page, to which the order is to be billed. The tag must appear in the template file as: <!---BILLZIP---> <!---BILLCOUNTRY---> Tag This tag is replaced with the country, as supplied by the customer on the Checkout page, to which the order is to be billed. The tag must appear in the template file as: <!---BILLCOUNTRY---> PDG Commerce -- Technical Reference Guide 123 Chapter 4 -- HTML Template Files <!---BILLAMOUNT---> Tag This tag is replaced with the amount that was billed to the customer for the current order. The tag must appear in the template file as: <!---BILLAMOUNT---> <!---BILLDATE---> Tag This tag is replaced by the date on which the transaction was completed. This value will normally display the current date. The tag must appear in the template file as: <!---BILLDATE---> <!---BILLPHONE1---> Tag This tag is replaced by the primary phone number for the person to which the order is to be billed. The tag must appear in the template file as: <!---BILLPHONE1---> <!---BILLPHONE2---> Tag This tag is replaced by the secondary phone number for the person to which the order is to be billed. This value will generally be a work or cellular phone number. It should be provided by the customer on your Web store’s Checkout page. The tag must appear in the template file as: <!---BILLPHONE2---> <!---SHIPNAME---> Tag This tag is replaced by the name, as entered by the customer on the Checkout page, to which the order is to be shipped. The text for this tag is the combined first and last names of the shipping information. The tag must appear in the template file as: <!---SHIPNAME---> 124 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---SHIPADDRESS---> Tag This tag is replaced by the street address, as entered by the customer on the Checkout page, to which the order is to be shipped. The text for this tag is the combined first and second lines of street addresses of the shipping information. The tag must appear in the template file as: <!---SHIPADDRESS---> <!---SHIPCITY---> Tag This tag is replaced by the city, as entered by the customer on the Checkout page, to which the order is to be shipped. The tag must appear in the template file as: <!---SHIPCITY---> <!---SHIPSTATE---> Tag This tag is replaced by the state, as entered by the customer on the Checkout page, to which the order is to be shipped. The tag must appear in the template file as: <!---SHIPSTATE---> <!---SHIPZIP---> Tag This tag is replaced by the ZIP code, as entered by the customer on the Checkout page, to which the order is to be shipped. The tag must appear in the template file as: <!---SHIPZIP---> <!---SHIPCOUNTRY---> Tag This tag is replaced by the country, as entered by the customer on the Checkout page, to which the order should be shipped. The tag must appear in the template file as: <!---SHIPCOUNTRY---> PDG Commerce -- Technical Reference Guide 125 Chapter 4 -- HTML Template Files <!---COMPANY---> Tag When PDG Commerce encounters this tag, it is replaced by the company name supplied by the customer on the Checkout page. The tag must appear in the template file as: <!---COMPANY---> <!---BILLMETHOD---> Tag When PDG Commerce encounters this tag, it is replaced by the billing method chosen by the customer on the Verify page. The tag must appear in the template file as: <!---BILLMETHOD---> <!---SUBTOTAL_WITH_DISCOUNT---> Tag This tag is replaced by the subtotal for the order in the customer’s current order. This value represents just the total price of all of the products in the cart, with all discounting applied. This subtotal does not include any of the charges for any applied taxes or any shipping and handling. The tag must appear in the template file as: <!---SUBTOTAL_WITH_DISCOUNT---> <!---SHIP_METHOD---> Tag This tag is replaced by the shipping method chosen by the customer. The tag must appear in the template file as: <!---SHIP_METHOD---> <!---BILLTEXT---> Tag If you provided a field in the Checkout template named “billtext,” then this tag will be replaced with the customer-supplied text from that field. The tag must appear in the template file as: <!---BILLTEXT---> 126 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---SHIPTEXT---> Tag If you provided a field in the Checkout template named “shiptext,” then this tag will be replaced with the customer-supplied text from that field. The tag must appear in the template file as: <!---SHIPTEXT---> <!---CARD_TYPE---> Tag If you collected the customer’s credit card information on your Verify page, this tag will display the type of credit card used for purchase. Otherwise this tag will be ignored. The tag must appear in the template file as: <!---CARD_TYPE---> <!---CARD_NUMBER---> Tag If you collected the customer’s credit card information on your Verify page, this tag will display the credit card number used for purchase. For security purposes, only the last four digits will be displayed, and all other digits will be replaced with an ‘X’. If you did not collect credit card information, this tag will be ignored. The tag must appear in the template file as: <!---CARD_NUMBER---> <!---CARD_EXP_DATE---> Tag If you collected the customer’s credit card information on your Verify page, this tag will display the expiration date of the credit card used for purchase. Otherwise this tag will be ignored. The tag must appear in the template file as: <!---CARD_EXP_DATE---> <!---BANK_NAME---> Tag If you collected the customer’s check information on your Verify page, this tag will display the bank name of the check used for purchase. Otherwise this tag will be ignored. The tag must appear in the template file as: <!---BANK_NAME---> PDG Commerce -- Technical Reference Guide 127 Chapter 4 -- HTML Template Files <!---ROUTING_NUMBER---> Tag If you collected the customer’s check information on your Verify page, this tag will display the routing number of the check used for purchase. Otherwise this tag will be ignored. The tag must appear in the template file as: <!---ROUTING_NUMBER---> <!---CHECK_NUMBER---> Tag If you collected the customer’s check information on your Verify page, this tag will display the number of the check used for purchase. Otherwise this tag will be ignored. The tag must appear in the template file as: <!---CHECK_NUMBER---> <!---ACCOUNT_NUMBER---> Tag If you collected the customer’s check information on your Verify page, this tag will display the account number of the check used for purchase. For security purposes, each digit of the number will be replaced with an ‘X’. If you did not collect check information, this tag will be ignored. The tag must appear in the template file as: <!---ACCOUNT_NUMBER---> <!---PASSTHROUGH---> Tags If you collected any passthrough tags on your CheckOut or Verify templates, you may display them on the ThankYou template. There are two ways to use the passthrough tags. The <!---PASSTHROUGH---> tag will display all of your passthrough fields in a formatted table in the order they were input. If you wish to display a single passthrough field, or display the passthroughs in a different format, you may use the tag with the name of your input field. The name of the field used in the tag must match the name of the field. For example, if the name of your input field was “PASSPhone”, then the tag must read <!---PASSPhone--->. A field named “PASSCompany” must use the tag <!--PASSCompany--->, etc. The tags should appear in the template as: <!---PASSTHROUGH---> or <!---PASSPhone---> <!---PASSCompany---> etc. 128 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Basket Template Tags In addition to the standard ThankYou Template tags, the ThankYou HTML Template can also take any of the Basket Template Repeat tags. The use of the Basket Template Repeat tags allows you to display the customer’s cart on the ThankYou page. This allows you to customize what is displayed on your ThankYou page. ‘REPEAT’ and ‘OPTIONS’ Tags Like the Basket template, the ThankYou Template can also utilize the REPEAT and OPTIONS tags. The tags used within the REPEAT and OPTIONS tags for the Thank You HTML template are the same as those used in the Basket HTML template (i.e.: the ‘Repeat Basket’ tags and the ‘Options Basket’ tags). These tags allow you to customize the display of the customer’s cart on the ThankYou page. For information on what tags can be used with the REPEAT and OPTIONS tags in the Thank You Template, please see the ‘Basket Template File’ section of this chapter. Below is an example of a Thank You Template that has been customized using the REPEAT tags. Customized Thank You Template Display DenyCredit Template File The DenyCredit Template File is used when PDG Commerce fails to receive authorization for a credit card purchase online. If you are not using any payment authorization services with PDG Commerce, this template file will still PDG Commerce -- Technical Reference Guide 129 Chapter 4 -- HTML Template Files be used if the customer supplies a credit card number that does not pass the proper mathematical (luhn10) verification. If a credit card authorization does fail, PDG Commerce only displays this template file and not the ThankYou Template File. The DenyCredit Template File is essentially an HTML Web page. However, before the template is sent to the customer’s browser, PDG Commerce searches it for special tags. When a tag is encountered, it is replaced with the appropriate information before being sent to the customer’s Web browser. The DenyCredit Template File can contain the following tags: • • <!---BILLINGINFO---> <!---REASON---> A sample DenyCredit Template File is included with PDG Commerce. Below is an example of how this template may be displayed. Sample Deny Credit Template Display <!---BILLINGINFO---> Tag When this tag is encountered in the DenyCredit Template File, the tag is replaced with the customer's billing and payment information. The billing information contains the billing name and address. The payment information is comprised of the selected payment method as well as any necessary account information (i.e.: credit card number and expiration date for credit cards; account and routing information for online checks). Any information that may be sensitive, such as credit card information, will be censored. The tag must appear in the template file as: <!---BILLINGINFO---> 130 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---REASON---> Tag When this tag is encountered, PDG Commerce replaces it with the “reason” for the transaction’s denial, if a reason is provided to PDG Commerce by the authorization service. This information comes from one of several sources including the failure of the authorization service. This tag can be removed if you do not want this information displayed. If no reason is supplied, then this tag will be ignored. If you do want the information displayed, the tag must appear in the template file as: <!---REASON---> AcceptCredit Template File The AcceptCredit Template File is used after the BuyIt action has been received, but only if a credit card authorization has succeeded. The AcceptCredit Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer, it searches the file for special tags, and replaces them with the corresponding information. This template file is independent of the ThankYou Template File, which allows your Web store to have different order confirmation pages depending on whether the order required online credit card authorization. If you wish to have the same page displayed for all received orders including successful credit card authorizations, use only the ThankYou Template File and do not specify an AcceptCredit Template File in the Merchant Administrator (See the PDG Commerce User Guide for more information). Note: The standard AcceptCredit Template tags are the same as the standard ThankYou Template tags. Please refer to the ‘ThankYou HTML template’ section for information on how to embed tags into the AcceptCredit HTML template file. A sample AcceptCredit Template File is included with PDG Commerce. Please see the Thank You Template File section for an example of how this template may be displayed. Search Results Template The Search Results Template File is used after the Search action has been received. This is the template that will be used to display the products which match the customer’s search query, provided there were any matches. The Search Results Template File is essentially an HTML Web page. However, PDG Commerce -- Technical Reference Guide 131 Chapter 4 -- HTML Template Files before PDG Commerce sends it to the customer, it searches the HTML Template File for special tags, and replaces them with the appropriate information. The following are the standard Search Results Template tags: • • • • • • • • • • • • • • • • • • • • • • • • <!---SEARCHRESULTS---> <!---KEYWORDS---> <!---SEARCH_FAIL_MESSAGE---> <!---NEXT_SEARCH---> <!---PREVIOUS_SEARCH---> <!---PAGE_INFO---> <!---CAT_IMG---> <!---CAT_TEXT---> <!---CAT_DESC---> <!---SEC_FORCE_DATA---> <!---NEXT_SEARCH_URL---> <!---PREVIOUS_SEARCH_URL---> <!---RESULTS_PER_PAGE---> <!---SORT_BY_DESC_PRICE_URL---> <!---SORT_BY_ASC_PRICE_URL---> <!---SORT_BY_DESC_SKU_URL---> <!---SORT_BY_ASC_SKU_URL---> <!---SORT_BY_DESC_DESC_URL---> <!---SORT_BY_ASC_DESC_URL---> <!---SORT_BY_DESC_ORDER_URL---> <!---SORT_BY_ASC_ORDER_URL---> <!---SORT_BY_PRICE_HEADER_URL---> <!---SORT_BY_SKU_HEADER_URL---> <!---SORT_BY_DESC_HEADER_URL---> In addition to these tags, the Javascript functions “FormatCurrency” and “FormatEuro” need to be in the <head> portion of any Search Results template file. These Javascript functions can be found in the default Search Results and default PreAdd templates that came with your PDG Commerce archive, and can be copied and pasted verbatim into your new templates. A sample Search Results Template File is included with PDG Commerce, however you may customize the look of your Search Results page by using the REPEAT tags. Below are two examples of how the standard Search Results template may be displayed (depending upon the layout chosen in the Merchant Administrator). 132 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Sample Search Results Template Display (Thumbnail Layout) Sample Search Results Template Display (Catalog Layout) <!---SEARCHRESULTS---> Tag When PDG Commerce encounters this tag, it is replaced with the Thumbnail or Catalog formatted search results, depending upon which has been selected in the Merchant Administrator. See ‘Search Settings’ in the PDG Commerce User Guide for more information. The tag must appear in the template file as: <!---SEARCHRESULTS---> Note: If you would like to customize the look of search results returned by your Web store, see the ‘REPEAT Tags’ section. If you use the <!---SEARCHRESULTS---> tag, you should not use the REPEAT tags to customize your search results page. PDG Commerce -- Technical Reference Guide 133 Chapter 4 -- HTML Template Files <!---KEYWORDS---> Tag This tag, when encountered, is replaced by the actual search criteria as entered by the customer. For “hard” coded searches, this tag may not be necessary and can be omitted (See the PDG Commerce User Guide for more information on “hard” searches). The tag must appear in the template file as: <!---KEYWORDS---> <!---SEARCH_FAIL_MESSAGE---> Tag This tag is replaced with the text message that is to be displayed if the customer’s search failed. This message will be automatically generated by PDG Commerce, depending upon the reason for the search failure. Generally, this tag will be used on the Search Results Empty HTML template (i.e.: “Search failed because there were no matches”). If the search did not fail, this tag will be ignored. The tag must appear in the template file as: <!---SEARCH_FAIL_MESSAGE---> <!---NEXT_SEARCH---> Tag This tag is replaced by a text link to the “next” page of search results. If there are no further pages of search results, then this tag is ignored. The tag must appear in the template file as: <!---NEXT_SEARCH---> <!---PREVIOUS_SEARCH---> Tag This tag is replaced by a link to the “previous” page of search results. If the shopper is already on the first page of search results, then this tag is ignored. The tag must appear in the template file as: <!---PREVIOUS_SEARCH---> <!---PAGE_INFO---> Tag This tag is replaced by the information regarding what page of the search results are being displayed. This information includes the number of the page being displayed and the total number of pages in the search results. The tag must appear in the template file as: <!---PAGE_INFO---> 134 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Category Template Tags PDG Commerce’s Search Results template can now contain certain Category template tags. These tags may be inserted in your Search Results template to provide a customer with information about the category within which the search was performed. The following standard Category template tags may be used in the Search Results template: • • • • • • <!---CAT_IMG---> <!---CAT_TEXT---> <!---CAT_DESC---> <!---CAT_PARENT---> <!---CAT_CODE---> <!---CAT_DISP_PROD---> For information on what these tags mean, see the following section on the Category Template File. Note: The three tags above may only be used in the Search Results template if the Search action has been called with the “Category” form input. See Chapter 5 of this Technical Reference Guide for more information on the Search action and its available inputs. <!---SEC_FORCE_DATA---> The tag is replaced with hidden form fields that are needed in the form if PDG Commerce is switching to a secure URL. Include this PDG Commerce tag in your search form if the action of the form points to an https address. <!---NEXT_SEARCH_URL---> This tag is replaced with the URL to have PDG Commerce display the next set of results for the search, or is ignored if there is no more results. Note that this field creates a URL, not a link or button. If you use this tag in a hyperlink and there are no more results, the hyperlink will be broken and result in a PDG Commerce error. If you have specific Javascript that will create the hyperlinks dynamically for you based on the return results, and just need the URL for the hyperlink, then use this field. Otherwise you will probably only need the <!---NEXT_SEARCH---> tag. <!---PREVIOUS_SEARCH_URL---> This tag is replaced with the URL to have PDG Commerce display the previous set of results for the search, or is ignored if there is no more results before the current set. PDG Commerce -- Technical Reference Guide 135 Chapter 4 -- HTML Template Files Note that this field creates a URL, not a link or button. If you use this tag in a hyperlink and there are no more results before the current set, the hyperlink will be broken and result in a PDG Commerce error. If you have specific Javascript that will create the hyperlinks dynamically for you based on the return results, and just need the URL for the hyperlink, then use this field. Otherwise you will probably only need the <!---PREVIOUS_SEARCH---> tag. <!---RESULTS_PER_PAGE---> This tag is replaced with the number of search results per page, as defined in the Merchant Administrator. It can be used in Javascript for creating search set identifiers (i.e. “Results 30 through 45”). <!---SORT_BY_DESC_PRICE_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by price in descending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_DESC_PRICE_URL---”>Price</a> <!---SORT_BY_ASC_PRICE_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by price in ascending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_ASC_PRICE_URL---”>Price</a> <!---SORT_BY_DESC_SKU_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by sku number in descending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_DESC_SKU_URL---”>Sku</a> 136 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---SORT_BY_ASC_SKU_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by sku number in ascending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_ASC_SKU_URL---”>Sku</a> <!---SORT_BY_DESC_DESC_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by one-line description in descending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_DESC_DESC_URL---”>Description</a> <!---SORT_BY_ASC_DESC_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by one-line description in ascending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_ASC_DESC_URL---”>Description</a> <!---SORT_BY_DESC_ORDER_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by the order in which the products were entered in the Merchant Administrator, in descending order. For example, the most recently added product will appear first in the sorted list of search results. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_DESC_ORDER_URL---”>Date</a> PDG Commerce -- Technical Reference Guide 137 Chapter 4 -- HTML Template Files <!---SORT_BY_ASC_ORDER_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search sorted by the order in which the products were entered in the Merchant Administrator, in ascending order. For example, the most recently added product will appear last in the sorted list of search results. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_ASC_ORDER_URL---”>Date</a> <!---SORT_BY_PRICE_HEADER_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search ordered by price. Clicking the link once will sort the results by price in ascending order. Clicking the link a second time will sort the results by price in descending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_PRICE_HEADER_URL---”>Price</a> <!---SORT_BY_SKU_HEADER_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search ordered by sku number. Clicking the link once will sort the results by sku number in ascending order. Clicking the link a second time will sort the results by sku number in descending order. Clicking this link will display the first page of the search results. The “Previous Search Results” and “Next Search Results” pages will maintain the selected sort order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_SKU_HEADER_URL---”>Sku</a> <!---SORT_BY_DESC_HEADER_URL---> Tag This tag is replaced by the appropriate url to display your Search Result Template page with the results of the search ordered by description. Clicking the link once will sort the results by description in ascending order. Clicking the link a second time will sort the results by description in descending order. The tag must be used as an HTML link, such as: <a href=”!---SORT_BY_DESC_HEADER_URL---”>Description</a> 138 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files ‘SEARCH ROW’ Tags These tags are used to determine what data will be repeated for each ‘row’ on the Search Results page. You should have already defined how many search results will comprise a row using the Merchant Administrator (see the PDG Commerce User Guide for more information). The repeated data may now actually comprise a row across the Search Results template depending upon how the HTML ‘table’ tags are formatted (see the following section for more information). ‘REPEAT’ Tags The REPEAT tags can also be used on the Search Results template to customize the look of your Web store’s search results page. The tags that can be used between the REPEAT tags on the Search Results template are the same as the standard Item template tags. Please see the ‘Item Template File’ section, above, for more information. In addition to the item template tags, you may also use the following tags within the REPEAT tags on the Search Result page. !---ROW_COLOR--- Tag This tag is replaced by the appropriate background color for the row if Row Coloring is enabled in the Templates section of your Commerce Administrator. Please see the PDG Commerce User Guide or PDG Commerce Design Guide (if using Site Design mode) for information on configuring row coloring. This tag should be placed in all table cell fields within the REPEAT tags on the Basket page. There should be a single space before and after the tag. The tag must appear in the template file as: <td !---ROW_COLOR--- > <!---ADD_SUBMIT---> Tag This tag will be replaced by the Add Item to Cart Button image specified in the Buttons section of your Cart Administrator. The tag must appear in the template file as: <!---ADD_SUBMIT---> <!---QTY_INPUT---> Tag This tag will be replaced by an input field that allows the customer to enter a quantity amount for each product. The tag must appear in the template file as: <!---QTY_INPUT---> PDG Commerce -- Technical Reference Guide 139 Chapter 4 -- HTML Template Files <!---ITEMOPT_FOR_ADD---> Tag This tag is replaced by the option labels and selection menus for the options associated with the appropriate product. This tag may be used when using an add action within the REPEAT tags. This tag may not be used with a multiadd action. The tag must appear in the template file as: <!---ITEMOPT_FOR_ADD---> The REPEAT tags may only be used within the SEARCH ROW tags on the Search Result template. The placement of these tags helps to determine the format of the search results on the page. You must have first configured the Search Settings in the Merchant Administrator to display the results in “Custom Line Repeat” format. See the PDG Commerce User Guide for more information on the “Search Settings” section of the Administrator. If you have your HTML ‘table row’ tags (<tr>,</tr>) outside of the REPEAT tags, then the ‘Number of Results per Row’ that you specified in the Merchant Administrator will hold true. PDG Commerce will then create as many rows as necessary to fulfill the ‘Number of Results per Page’ criteria, which is also configured in the Merchant Administrator (see the PDG Commerce User Guide). You can also embed your HTML ‘table row’ tags (<tr>,</tr>) inside the REPEAT tags. Then, each product will comprise a single row in a standard table layout. Note that the HTML ‘table row’ tags override the ‘Number of Search Results per Row’ setting indicated in the Merchant Administrator. If you have a heading row, you can place it within the SEARCH ROW tags. This will cause it to repeat after however many ‘Number of Results per Row’ you specified in the Merchant Administrator. Placing the header row outside of the SEARCH ROW tags will cause the header to display only once. Below are two examples of how a customized Search Results template may be displayed. In the first example, the ‘table row’ tags are located inside the REPEAT tags. In the second example, the ‘table row’ tags are located outside of the REPEAT tags. 140 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Custom Search Results Template Display Custom Search Results Template Display PDG Commerce -- Technical Reference Guide 141 Chapter 4 -- HTML Template Files Templates Specific to Internet Payment Services There are certain templates that may only be used by certain Internet payment services. These services typically involve transferring your customers to the Internet payment service’s secure server to provide payment information.. Template for VeriSign’s Payflow Link Using VeriSign’s Payflow Link as part of the checkout process for PDG Commerce is easy and simple. The checkout process for your customer begins normally. You customer is presented with a ‘checkout’ page where they provide billing contact and shipping information. From there the customer proceeds to the ‘verify’ page, where the customer can choose a method of payment. From this page, PDG Commerce will redirect the customer to the VeriSign Payflow Link server, using the VeriSign Payflow Link Template, passing the collected contact information to it. The customer then provides the VeriSign server with the proper payment information, and the transaction is processed by VeriSign Payflow Link. Once the transaction is processed, the Payflow Link server silently contacts your PDG Commerce and notifies it of the order completion. PDG Commerce can then log the order properly and send out appropriate emails. The Payflow Link template is not used if you are not using Payflow Link. If you are using VeriSign’s Payflow Pro, this template is not used. Category Template The Category Template File is used after the customer has clicked on a button to display all of your Web store’s product categories. The Category Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer’s Web browser, it searches the Template File for special tags, and replaces them with the appropriate information. The only tags that may be used on the Category HTML template file must be used within the REPEAT tags. This causes the category information to be displayed for every category in your Web store. The standard Repeat Category tags are as follows: • • • • • • 142 <!---CAT_IMG---> <!---CAT_TEXT---> <!---CAT_DESC---> <!---CAT_PARENT---> <!---CAT_CODE---> <!---CAT_DISP_PROD---> PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files A sample Category Template File is included with PDG Commerce. Below is an example of how that template may be displayed. Sample Category Template Display <!---CAT_IMG---> Tag This tag is replaced by a reference to the product category’s corresponding image, as defined in the ‘Product Category Details’ section of the Merchant Administrator. The tag must appear between the REPEAT tags in the template file as: <img src=”!---CAT_IMG---”> <!---CAT_TEXT---> This tag is replaced by the name of a particular product category, as defined in the ‘Product Category Details’ section of the Merchant Administrator. The tag must appear between the REPEAT tags in the template file as: <!---CAT_TEXT---> <!---CAT_DESC---> This tag is replaced by the description of the particular category as defined in the ‘Product Category Details’ section of the Merchant Administrator. This tag must appear between the REPEAT tags in the template file as: <!---CAT_DESC---> <!---CAT_PARENT---> This tag is replaced by the particular category’s parent category as defined in the ‘Product Category Details’ section of the Merchant Administrator. This tag must appear between the REPEAT tags in the template file as: <!---CAT_PARENT---> PDG Commerce -- Technical Reference Guide 143 Chapter 4 -- HTML Template Files <!---CAT_CODE---> This tag is replaced by the particular category’s four character code as defined in the ‘Product Category Details’ section of the Merchant Administrator. This tag must appear between the REPEAT tags in the template file as: <!---CAT_CODE---> <!---CAT_DISP_PROD---> This tag is replaced by the URL for the template that acts as the home page for the particular product category as defined in the ‘Product Category Details’ section of the Merchant Administrator. This tag should be used within an HTML “hypertext reference” tag (href) for creating a link to this URL. This tag must appear between the REPEAT tags in the template file. An example of this tag in the Category template would be: <a href="!---CAT_DISP_PROD---">view products</a> ShipCompare Template The ShipCompare Template File is used to display shipping rates returned from UPS or USPS, when a specific PDG Commerce shipping method is defined to compare rates. The ShipCompare Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer’s Web browser, it searches the Template File for special tags, and replaces them with the appropriate information. The standard ShipCompare tags are as follows: • • • • • • • • <!---BEGIN_SHIP_COMPARE---> <!---END_SHIP_COMPARE---> !---SERVICE_NAME--!---SERVICE_COST--!---SERVICE_DESCRIPTION--!---SERVICE_ERROR--!---SERVICE_BUTTON--!---CONTINUE_SUBMIT---- <!---BEGIN_SHIP_COMPARE---> Tag This tag denotes the beginning of a repeatable section of the ShipCompare template. This section is then repeated, until the END_SHIP_COMPARE tag 144 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files is reached, for each shipping service rate to be compared. The tag must appear in the template file as: <!---BEGIN_SHIP_COMPARE---> <!---END_SHIP_COMPARE---> Tag This tag denotes the end of a repeatable section of the ShipCompare template. This section, beginning with the BEGIN_SHIP_COMPARE tag, is then repeated for each shipping service rate to be compared. The tag must appear in the template file as: <!---END_SHIP_COMPARE---> !---SERVICE_NAME--- Tag This tag is replaced with the name of the available UPS / USPS service. The tag must appear inside BEGIN_SHIP_COMPARE and END_SHIP_COMPARE tags in the template file as: !---SERVICE_NAME--- The text that is displayed for this tag is provided by the shipping service and cannot be modified. !---SERVICE_COST--- Tag This tag is replaced with the cost of the available UPS / USPS service. The tag must appear inside BEGIN_SHIP_COMPARE and END_SHIP_COMPARE tags in the template file as: !---SERVICE_COST--- !---SERVICE_DESCRIPTION--- Tag This tag is replaced with a brief description of the available UPS / USPS service. The tag must appear inside BEGIN_SHIP_COMPARE and END_SHIP_COMPARE tags in the template file as: !---SERVICE_DESCRIPTION--- The text that is displayed for this tag is provided by the shipping service and cannot be modified. PDG Commerce -- Technical Reference Guide 145 Chapter 4 -- HTML Template Files !---SERVICE_ERROR--- Tag If an error occurs while retrieving information for this service, then this tag is replaced with that error. An example might be if a service is not available because of an order’s extreme weight. The tag must appear inside BEGIN_SHIP_COMPARE and END_SHIP_COMPARE tags in the template file as: !---SERVICE_ERROR--- !---SERVICE_BUTTON--- Tag This tag is replaced with a submit button that allows the customer to choose the service and proceed with checkout. The tag must appear inside BEGIN_SHIP_COMPARE and END_SHIP_COMPARE tags in the template file as: !---SERVICE_BUTTON--- !---CONTINUE_SUBMIT--- Tag This tag is available on the template if Site Design is enabled. Please see the PDG Software Site Design guide for further information on this tag. Verify - Inventory Error Template The Verify - Inventory Error Template is used when your webstore tracks inventory on products and backordering is turned off, and not enough inventory is available to fill a customer’s order during the checkout process. PDG Commerce will modify the basket’s contents to include only the items in inventory. Then the new basket will be displayed to the customer using this template. The customer can then continue to checkout normally, or go back and shop for other items. Note that this template is only used if you are tracking inventory and do not allow backordering of out-of-stock products. The template can be displayed prior to the CheckOut, or between the CheckOut and Verify steps. The Verify - Inventory Error Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer’s Web browser, it searches the Template File for special tags, and replaces them with the appropriate information. 146 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files The standard Verify - Inventory Error template uses all the tags that the Basket template uses. In addition to those tags, these other tags are used: • • <!---PRINT_BILLING---> !---SUBMIT_ORDER_BUTTON--- <!---PRINT_BILLING---> Tag This tag is replaced with hidden fields containing any billing information that may be submitted during the checkout process. If this template is used by PDG Commerce before any billing information is collected, then this tag is ignored. If this template is used by PDG Commerce between the CheckOut and Verify steps, then this tag is replaced with hidden fields containing the data from the CheckOut step. The tag must appear in the template file as: <!---PRINT_BILLING---> !---SUBMIT_ORDER_BUTTON--- Tag This tag is replaced with a submit button, allowing the order with the modified basket to continue to be processed. The tag must appear in the template file as: !---SUBMIT_ORDER_BUTTON--- Error Template If any type of error occurs during the customer’s shopping in your web store, PDG Commerce uses the Error template to display the appropriate error message to the customer. The standard Error template uses the following tags: • • • <!---ERROR_MESSAGE---> <!---ERROR_CODE---> <!---SYSTEM_VERSION---> PDG Commerce -- Technical Reference Guide 147 Chapter 4 -- HTML Template Files <!---ERROR_MESSAGE---> Tag When this tag is encountered, PDG Commerce will replace it with an error message explaining what action has caused the problem. The tag must appear in the template file as: <!---ERROR_MESSAGE---> <!---ERROR_CODE---> Tag When this tag is encountered, PDG Commerce will replace it with the index value of the error that was returned. This number is useful to know if you must contact PDG Software for technical support. The tag must appear in the template file as: <!---ERROR_CODE---> <!---SYSTEM_VERSION---> Tag When this tag is encountered, PDG Commerce will replace it with the version, build, and patchlevel information of the Commerce program that is installed on your server. The tag must appear in the template file as: <!---SYSTEM_VERSION---> Anonymous Checkout Template File The Anonymous Checkout Template File is used if you have specified a separate Checkout template to be used for non-secure checkout when customers have chosen not to log in or register with your site. This file will obtain the customer’s contact, billing, and shipping information from the customer after receiving the Checkout action (usually from the Checkout Select page). For more information on the Checkout action, please see the chapter regarding PDG Commerce actions. The Anonymous Checkout Template File is essentially an HTML Web page. However, before PDG Commerce sends it to the customer, it searches the HTML Template File for special tags. When PDG Commerce encounters these tags, they are replaced with the appropriate information before being sent to the customer’s Web browser. In order for PDG Commerce to properly receive and process information from this template file, the Anonymous Checkout Template File must contain a form submission back to PDG Commerce with the Verify action. For all the 148 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files required fields for this callback, please see the Verify action definition in the chapter regarding PDG Commerce Actions. The Anonymous Checkout Template uses the same tags available on the Checkout Template page. For more information, see the “Checkout Template File” section, above. UPS Track Template File The UPS Track Template file is used to allow customers to enter information and track the status of their order package. If you wish to provide UPS package tracking to your customers, you will use the UPS Track template provided with your PDG Commerce. You can create a link to the tracking page using the following code: <a href=”http://www.mywebstore.com/cgi-bin/commerce?display=action&template=Templates/UPSTrack.html&emptyoverride=yes”>Track Order</a> Even though the UPS Track template is a static HTML page, you should use the above link to display the template through a Commerce action, otherwise the country list will not be populated by PDG Commerce. The standard UPS Track template uses the following tag: • <!---COUNTRY_LIST---> <!---COUNTRY_LIST---> Tag When this tag is encountered, PDG Commerce replaces it with a drop-down menu containing all the countries with their corresponding numeric code for PDG Commerce. The tag must appear in the template file as: <!---COUNTRY_LIST---> UPS Tracking Result Template File If you offer UPS package tracking to your customers, this template is used to display the results of the tracking inquiry. This page will display the address to which the package was shipped, the address from which the package was shipped, the details of the package, and the date and location of every action taken on the package. The standard UPS Tracking Result Template uses the following tag: • <!---TRACK_RESULTS---> PDG Commerce -- Technical Reference Guide 149 Chapter 4 -- HTML Template Files <!---TRACK_RESULTS---> Tag When this tag is encountered, PDG Commerce replaces it with the information returned from UPS, including the address from which the package was shipped, the address to which the package was shipped, the details of the package, and the date and location of every action taken on the package. The tag must appear in the template file as: <!---TRACK_RESULTS---> UPS Address Validation Template File If you are registered to use UPS OnLine Tools and have checked the “I want UPS® Address Validation When Customers Check Out” box in the UPS Details section of your Merchant Administrator, this template will display if a customer enters an invalid shipping address on the Checkout page (whether or not they have chosen a UPS shipping method). This template will allow the customer to bypass the validation and use the current address, enter a new address, or choose from the closest available matches to the address entered on the Checkout page. The standard UPS Address Validation Template uses the following tags: • • • • • • <!---PDGCARTFORMDATA---> <!---UPS_CURRENT_ADDR---> <!---UPS_ADDR_SUGGEST---> <!---BYPASS_VAL_W_JAVA_SUBMIT---> <!---CLEAR_W_JAVA_SUBMIT---> <!---CONTINUE_W_JAVA_SUBMIT---> <!---PDGCARTFORMDATA---> Tag When this tag is encountered, PDG Commerce replaces it with the hidden information that is necessary for the address validation process. This tag must be located within the form submission in the UPS Address Validation Template file. No visible information is replaced by this tag, therefore, it does not affect the visible layout of your HTML template in any way. This tag is required for the UPS Validate Address Template, and for PDG Commerce to operate properly. The tag must appear in the template file as: <!---PDGCARTFORMDATA---> 150 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files <!---UPS_CURRENT_ADDR---> Tag When this tag is encountered, PDG Commerce will replace it with the actual address that the customer entered on the Checkout page. The tag must appear in the template file as: <!---UPS_CURRENT_ADDR---> <!---UPS_ADDR_SUGGEST---> Tag When this tag is encountered, PDG Commerce will replace it with a dropdown menu containing the closest available matches to the address entered on the Checkout page that were found as valid addresses by UPS. The tag must appear in the template as: <!---UPS_ADDR_SUGGEST---> <!---BYPASS_VAL_W_JAVA_SUBMIT---> Tag This tag is available on the template if Site Design is enabled. Please see the PDG Software Site Design guide for further information on this tag. <!---CLEAR_W_JAVA_SUBMIT---> Tag This tag is available on the template if Site Design is enabled. Please see the PDG Software Site Design guide for further information on this tag. <!---CONTINUE_W_JAVA_SUBMIT---> Tag This tag is available on the template if Site Design is enabled. Please see the PDG Software Site Design guide for further information on this tag. Email Templates The Email templates can use the following tag: • <!---SOFTGOODS_LINKS---> <!---SOFTGOODS_LINKS---> Tag This tag will be replaced by urls of the download links for all softgoods purchased in this order. The tag must appear in the template files as: <!---SOFTGOODS_LINKS---> PDG Commerce -- Technical Reference Guide 151 Chapter 4 -- HTML Template Files This tag will enter the url of the softgoods download into the email. The url will not be an HTML link. For example: http://www.webstorename.com/cgi-bin/commerce?deliver=action&invoice=I00001&sku=A0001&qty=1 If you are using the PDG Internal Mailer, you can have PDG Commerce send HTML emails to yourself and customers. With these HTML emails, you can use HTML to graphically display your order receipts sent to your customers. Remember that your customer’s email program will need to be able to display HTML to display these emails correctly. The HTML Email templates can use any PDG Commerce tags that are available for use on the ThankYou template. Your HTML email templates must have a file extension of .html. If you are using HTML emails, you can send attachments which you can display within the emails. All attached files must be in the Attachments folder located inside the PDG_Commerce directory. Directory traversal to reach a file in a different location on the server is not allowed. To display the attached file within the email, you should code the HTML as normal, but place cid: in front of the attached filename, as in the following example: <img src=”cid:logo.gif”> Note: All email templates must be saved in the EmailTemplates folder in your PDG_Cart directory. SSL Templates The SSL (secure socket layer) Template Files work like their non-secure counterparts. They are essentially HTML Web pages, and they are also searched for special tags before PDG Commerce sends them to the customer’s Web browser. The sample SSL Template Files that are included with PDG Commerce are: • • • • SSL Checkout Template SSL Verify Template SSL Thank You Template SSL Anonymous Checkout Template If your customer is shopping on an SSL connection to your webstore and either the SSL Checkout or SSL Verify are not specified in the Merchant Administrator, then PDG Commerce will use the standard Checkout and Verify templates in their place. If the customer is shopping on an SSL connection, then the SSL Thank You template MUST be specified in the Merchant 152 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Administrator - otherwise the customer will receive an Error page during checkout. These template files should essentially be the same as their non-secure counterparts, simply located in a secure directory on you Web server. Important: If you are using custom graphics on your Web store, you must provide the complete URL in your image references on all SSL Templates. Example: <img src=“https://www.yourstore.com/images/prod1.jpg> Note the ‘s’ which indicates that the image is on a secure server If you do not provide the complete URLs to images or maintain an ‘Images’ directory on the secure side of your Web server, the links to your images will be broken on your SSL Templates. Empty Templates There are two HTML templates that come with PDG Commerce that are simply static HTML pages. These are the Basket Empty Template and the Search Results Empty Template. They are essentially static because there are no tags for PDG Commerce to interpret on these templates. Actually, the Search Results Empty template can take one tag, which we will discuss later. Basket Empty Template The Basket Empty Template is used in place of the Basket Template when there are no items in the customer’s Cart. Instead of the tags for formatting items, you should put some text that notifies that the customer that there are no products in his cart. This template will be used whenever the DISPLAY action is called and the customer’s cart is empty. The Basket Empty Template will also be displayed whenever the customer clicks the ‘Remove All’ button to empty his cart. The Basket Empty Template can utilize the following tags: !---SHOPSOMEMORE_LINK--- Tag This tag is replaced by a Shop Some More button. Please note that this tag is replaced with all the code to display the button as defined in the Merchant Administrator as well as the URL. The tag must appear in the template as: !---SHOPSOMEMORE_LINK--- PDG Commerce -- Technical Reference Guide 153 Chapter 4 -- HTML Template Files <!---ITEMRETURNURL---> Tag This tag is replaced by a hidden field. It informs PDG Commerce of the “reference page” for the shopper. The reference page is the page which was being viewed prior to the AddItem page. Note that any URL entered into the “Destination of Shop Some More Button” field in the Cart Options section of the Merchant Administrator will override this reference page identifier. However, if the page was created dynamically, the user will be returned to the last statically created page. The tag must appear in the template file as: <!---ITEMRETURNURL---> Search Results Empty Template The Search Results Empty Template is displayed in place of the Search Results Template when there are no items that match the customer’s search. Instead of inserting tags for formatting items, you should put some text that notifies that the customer that there are no products which fit his query. You may also use the following tag to display this message: <!---SEARCH_FAIL_MESSAGE---> Tag This tag is replaced with the text message that is to be displayed if the customer’s search failed. This message will be automatically generated by the Cart, depending upon the reason for the search failure. The tag must appear in the template file as: <!---SEARCH_FAIL_MESSAGE---> The SearchResultEmpty HTML template will be used whenever the SEARCH action is called and there are no items to return. Site Design Templates The following templates are used in the Site Design functionality of PDG Commerce. Please see the PDG Software Site Design guide for further information on these templates. • • • • 154 UPS Tracking Request template Advanced Search template Top Navigation template Left Navigation template PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files • • • • • • • • Right Navigation template Bottom Navigation template About Us template Contact template Home template User 1 template User 2 template User 3 template The following universal tags are available in any PDG Commerce templates if Site Design is enabled. Please see the PDG Software Site Design guide for further information on these tags. • • • • • • • • • • • <!---VIEW_CART_LINK---> <!---TRACK_ORDER_LINK---> <!---SEARCH_SUBMIT---> <!---HOME_LINK---> <!---SEARCH_LINK---> <!---PRODUCTS_LINK---> <!---CONTACT_LINK---> <!---ABOUT_US_LINK---> <!---USER_1_LINK---> <!---USER_2_LINK---> <!---USER_3_LINK---> User Database Templates In addition to the previously discussed templates, PDG Commerce also has nine other templates that are used when customers log in or out, register, or update their account information. These templates are: • • • Guest Template : This template is displayed whenever a customer is prompted to login, but instead chooses to shop anonymously. This template is to be used as a general welcoming template. Login Template : This template is displayed whenever a customer requests to login. It displays the log in form. You can design your Login Template to allow customers to shop anonymously and / or register with your web site (your customer categories must be configured to support this). LoginFailure Template : If the customer’s login attempt fails, this template is displayed. It can allow the customer to retry to log in, or optionally register with the site or shop anonymously. PDG Commerce -- Technical Reference Guide 155 Chapter 4 -- HTML Template Files • • • • • • LoginSuccess Template : If the customer’s login attempt succeeds, this template is displayed. This template is to be used as a welcoming template for your registered customers. Register Template : If new customer’s can register for your website, this template can be displayed to allow the new customer to enter in a customer category code. If the code matches any defined customer category codes with PDG Commerce, that customer will be allowed to join themselves (without your intervention) into that customer category. RegistrationSuccess Template : If a registration attempt by a customer is successful, this template is displayed to the newly registered customer. It can be used as a welcoming page. UserUpdate Template : When a new customer registers with your web store, or if a customer needs to update their account information, this template is used to display that information. This information is presented to the customer in a form, which the customer can modify as needed and submit for saving. Checkout Select Template : When a customer is shopping anonymously and begins to checkout, this template is used to allow the customer to log in or register before completing the purchase. This is an optional template. If the template filename is left blank in the Merchant Administrator or cannot be located, this login / registration step is skipped. Unauthorized Action Template : If a customer of your web site attempts to perform an action that is not allowed due to the rights of their customer category, an error page is displayed using this template. The following PDG Commerce tags are available for these templates. !---FORCE_COOKIE_BABBLE--If your customers are shopping anonymously and have items in their cart, and then choose to register or log in, this tag allows PDG Commerce to carry forward their cart so it is available to them after they register or log in. This tag must appear in the form for the Login or Register Template. !---BASKET_SELECT--This tag can be placed in the LoginSuccessful template. When a customer logs in, they may choose to preload thier cart from different sources. They can opt to choose from a new empty cart, the cart of their last unfinished purchase, their last order, or if they were shopping before logging in, the cart from their anonymous shopping. The tag is replaced with an HTML table allowing the customer to select which basket to use. Although the HTML table output itself cannot be modied, the appearance of the elements can be altered through the use of style sheets. 156 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---REGISTER_CODE--This tag is used to pass a provided registration code through the Register template in a hidden field. It generates a hidden form input and is to be placed within a form on the Registration template. It generates its own HTML, and should not placed within an <input> tag. !---REG_ERROR--This tag is replaced with an appropriate error message is a registration attempt has failed. It is used on the Register template, in case a registration attempt fails and the template is redisplayed. !---REG_USERNAME--This tag is replaced with an input box for a customer’s username for the Registration template. !---REG_USER_NAME--This tag is replaced with the value of the customer’s username. !---REG_EMAIL--The tag is replaced with the user’s email address. !---REG_COMPANY--The tag is replaced with the user’s company. !---REG_BILL_FIRST_NAME--The tag is replaced with the user’s first name of the billing information. !---REG_BILL_LAST_NAME--The tag is replaced with the user’s last name of the billing information. !---REG_BILL_STREET1--The tag is replaced with the user’s first line of the street address of the billing information. PDG Commerce -- Technical Reference Guide 157 Chapter 4 -- HTML Template Files !---REG_BILL_STREET2--The tag is replaced with the user’s second line of the street address of the billing information. !---REG_BILL_CITY--The tag is replaced with the user’s city of the billing information. !---REG_BILL_STATE_LIST--The tag is replaced with the <option> list of states, with the user’s state of the billing address selected. It is to be placed inside <select> HTML tags on the Register template: <select name="billstate"> <!---REG_BILL_STATE_LIST---> </select> !---REG_BILL_PROVINCE--The tag is replaced with the user’s province of the billing information. !---REG_BILL_COUNTRY_LIST--The tag is replaced with the <option> list of countries, with the user’s country of the billing address selected. It is to be placed inside <select> HTML tags on the Register template: <select name="billcountry"> <!---REG_BILL_COUNTRY_LIST---> </select> !---REG_BILL_ZIP--The tag is replaced with the user’s postal code of the billing information. !---REG_BILL_PHONE1--The tag is replaced with the user’s first phone number of the billing information. !---REG_BILL_PHONE2--The tag is replaced with the user’s second phone number of the billing information. 158 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---REG_BILL_TEXT--The tag is replaced with the user’s additional comments and text of the billing information. !---REG_BILL_SHIP_TO_BILL--If the customer’s primary shipping address is the same as the billing address, this tag is replaced with the word “checked.” If the addresses are different, this tag is ignored. It is to be used in an HTML checkbox: <input name="shiptobilladdr" type="checkbox" !---REG_BILL_SHIP_TO_BILL--- value="yes"> !---REG_SHIP_FIRST_NAME--The tag is replaced with the user’s first name of the primary shipping information. !---REG_SHIP_LAST_NAME--The tag is replaced with the user’s last name of the primary shipping information. !---REG_SHIP_STREET1--The tag is replaced with the user’s first line of the street address of the primary shipping information. !---REG_SHIP_STREET2--The tag is replaced with the user’s second line of the street address of the primary shipping information. !---REG_SHIP_CITY--The tag is replaced with the user’s city of the primary shipping information. !---REG_SHIP_STATE_LIST--The tag is replaced with the <option> list of states, with the user’s state of the primary shipping address selected. It is to be placed inside <select> HTML tags on the Register template: <select name="shipstate"> <!---REG_SHIP_STATE_LIST---> </select> PDG Commerce -- Technical Reference Guide 159 Chapter 4 -- HTML Template Files !---REG_SHIP_PROVINCE--The tag is replaced with the user’s province of the primary shipping information. !---REG_SHIP_COUNTRY_LIST--The tag is replaced with the <option> list of countries, with the user’s country of the primary shipping address selected. It is to be placed inside <select> HTML tags on the Register template: <select name="shipcountry"> <!---REG_SHIP_COUNTRY_LIST---> </select> !---REG_SHIP_ZIP--The tag is replaced with the user’s postal code of the primary shipping information. !---REG_SHIP_PHONE1--The tag is replaced with the user’s first phone number of the primary shipping information. !---REG_SHIP_PHONE2--The tag is replaced with the user’s second phone number of the primary shipping information. !---REG_SHIP_TEXT--The tag is replaced with the user’s additional comments and text of the primary shipping information. !---USERID--This tag is replaced with the customer’s User ID in the User Update template. It is just the value, and not HTML. !---CUST_COMPANY--The tag is replaced with the user’s company. 160 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---DISPLAY_CONTACT_LIST--PDG Commerce replaces this tag with the HTML code that allows the customer to select which address they are modifying (billing, primary shipping, any defined secondary shipping, or a new secondary shipping). The layout of the form controls created by this tag cannot be modified. However, the text used in by this tag can be translated using the literals file. !---CONTACT_JAVASCRIPT--PDG Commerce replaces this tag with Javascript functions needed to operate the !---DISPLAY_CONTACT_LIST--- tag properly. This tag should go in the <head> portion of the Update User template. !---CUST_EMAIL--The tag is replaced with the user’s email address. !---ERROR--If an error occurs while the customer is updating their contact information using the User Update template, the template is reloaded and this tag is replaced with an appropriate error message. !---UPDATE_CUSTOMER_LINK--This tag is replaced with a submit button on the User Update template that allows the customer to save any non-address information for thier account, such as email address or company name. It will be a standard grey form button unless you have a custom image specified for it in the Merchant Administrator (see “Custom Buttons” in the PDG Commerce User Guide). !---ADD_CONTACT_LINK--This tag is replaced with a submit button on the User Update template that allows the customer add the current address as a new address (as selected in the !---DISPLAY_CONTACT_LIST--- output). The address information that was initially displayed when it was selected from the !--DISPLAY_CONTACT_LIST--- output will not be modified. It will be a standard grey form button unless you have a custom image specified for it in the Merchant Administrator (see “Custom Buttons” in the PDG Commerce User Guide). PDG Commerce -- Technical Reference Guide 161 Chapter 4 -- HTML Template Files !---UPDATE_CONTACT_LINK--This tag is replaced with a submit button on the User Update template that allows the customer to modify the current address (as selected in the !--DISPLAY_CONTACT_LIST--- output). It will be a standard grey form button unless you have a custom image specified for it in the Merchant Administrator (see “Custom Buttons” in the PDG Commerce User Guide). !---REGISTER_LINK--This tag is replaced with a submit button on the Register template that allows the customer to submit their contact and address information for registration. It will be a standard grey form button unless you have a custom image specified for it in the Merchant Administrator (see “Custom Buttons” in the PDG Commerce User Guide). !---LOGIN_LINK--This tag is replaced with a submit button on the Login and Login Failure template that allows the customer to submit their login information to PDG Commerce. It will be a standard grey form button unless you have a custom image specified for it in the Merchant Administrator (see “Custom Buttons” in the PDG Commerce User Guide). !---CHECKOUT_LINK--This tag is replaced with the code for a CheckOut button. Please note that this is the complete code for displaying the button image as defined in the Merchatn Administrator as well as the proper form value. !---SECURE_CHECKOUT_LINK--This tag is replaced with the code for a Secure CheckOut button. Please note that this is the complete code for displaying the button image as defined in the Merchant Administrator as well as the proper form value. !---BABBLE_EXPIRE_DATA--If a customer was logged in and was shopping, and then was logged out of the webstore due to idle inactivity, PDG Commerce displays the Login (and Login Failure) template to allow the customer to re-login. If this occurs, this tag will be replaced with text explaining that the user was logged out due to inactivity and prompting them to re-login. Once they are logged in again, they will be able to return to shopping at the same point from which they were 162 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files logged out. If the Login template is displayed for normal logging in (not due to idle inactivity), this tag is ignored. !---CUSTOMER_CAT_NAME--In the User Update template, this tag is replaced with the customer category name to which the customer belongs. !---SHOPPER_POINTS--This tag is replaced with the customer’s current total number of accumulated shopper points. !---LAST_BASKET_STRING--If during a customer’s login, you wish to allow the customer to set their basket to their previous basket but do not wish to use the !---BASKET_SELECT---, they can create a form with the PDG Commerce action of setbasket, and use this tag to enter the previous basket as an option of the form. User Database Template Tags For your reference, please find below the complete list of tags available for use on each user database template. Guest Template The Guest Template cannot utilize any special tags other than the universal tags. Login Template The Login Template can utilize the following tags: • • • <!---FORCE_COOKIE_BABBLE---> <!---BABBLE_EXPIRE_DATA---> <!---LOGIN_LINK---> LoginFailure Template The LoginFailure Template can utilize the following tags: • • • <!---FORCE_COOKIE_BABBLE---> <!---BABBLE_EXPIRE_DATA---> <!---LOGIN_LINK---> PDG Commerce -- Technical Reference Guide 163 Chapter 4 -- HTML Template Files • <!---START_REGISTER_LINK---> LoginSuccess Template The LoginSuccess Template can utilize the following tags: • • • • • • • • • • <!---USERMSG [USER] has successfully logged in---> <!---BASKET_SELECT---> <!---CUST_COMPANY---> <!---USERID---> <!---CUST_EMAIL---> <!---CUSTOMER_CAT_NAME---> <!---SHOPPER_POINTS---> <!---CHECKOUT_LINK---> <!---SECURE_CHECKOUT_LINK---> <!---LAST_BASKET_STRING---> Register Template The Register Template can utilize the following tags: • • • • • • • • • • • • • • • • • • • • • • 164 <!---REGISTER_CODE---> <!---FORCE_COOKIE_BABBLE---> <!---REG_ERROR---> <!---REG_USERNAME---> <!---REG_EMAIL---> <!---REG_COMPANY---> <!---REG_BILL_FIRST_NAME---> <!---REG_BILL_LAST_NAME---> <!---REG_BILL_STREET1---> <!---REG_BILL_STREET2---> <!---REG_BILL_CITY---> <!---REG_BILL_PROVINCE---> <!---REG_BILL_ZIP---> <!---REG_BILL_STATE_LIST---> <!---REG_BILL_COUNTRY_LIST---> <!---REG_BILL_PHONE1---> <!---REG_BILL_PHONE2---> <!---REG_BILL_TEXT---> <!---REG_BILL_SHIP_TO_BILL---> <!---REG_SHIP_FIRST_NAME---> <!---REG_SHIP_LAST_NAME---> <!---REG_SHIP_STREET1---> PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files • • • • • • • • • • <!---REG_SHIP_STREET2---> <!---REG_SHIP_CITY---> <!---REG_SHIP_PROVINCE---> <!---REG_SHIP_ZIP---> <!---REG_SHIP_STATE_LIST---> <!---REG_SHIP_COUNTRY_LIST---> <!---REG_SHIP_PHONE1---> <!---REG_SHIP_PHONE2---> <!---REG_SHIP_TEXT---> <!---REGISTER_LINK---> RegistrationSuccess Template The RegistrationSuccess Template can utilize the following tags: • • • • • • • • • • <!---USERMSG [USER] has successfully logged in ---> <!---BASKET_SELECT---> <!---CUST_COMPANY---> <!---USERID---> <!---CUST_EMAIL---> <!---CUSTOMER_CAT_NAME---> <!---SHOPPER_POINTS---> <!---CHECKOUT_LINK---> <!---SECURE_CHECKOUT_LINK---> <!---LAST_BASKET_STRING---> UserUpdate Template The UserUpdate Template can utilize the following tags: • • • • • • • • • • • • • <!---CONTACT_JAVASCRIPT---> <!---ERROR---> <!---SHOPPER_POINTS---> <!---USERID---> <!---CUST_EMAIL---> <!---CUST_COMPANY---> <!---CUSTOMER_CAT_NAME---> <!---UPDATE_CUSTOMER_LINK---> <!---DISPLAY_CONTACT_LIST---> <!---STATE_LIST---> <!---COUNTRY_LIST---> <!---UPDATE_CONTACT_LINK---> <!---ADD_CONTACT_LINK---> PDG Commerce -- Technical Reference Guide 165 Chapter 4 -- HTML Template Files Checkout Select Template The Checkout Select Template can utilize the following tags: • • • • • • <!---FORCE_COOKIE_BABBLE---> <!---BABBLE_EXPIRE_DATA---> <!---LOGIN_LINK---> <!---START_REGISTER_LINK---> <!---CHECKOUT_LINK---> <!---SECURE_CHECKOUT_LINK---> Unauthorized Action Template The Unauthorized Action Template cannot utilize any special tags other than the universal tags. Multiple Shipping Templates In addition to the previously discussed templates, PDG Commerce also has seven alternate templates that can be used when customers choose to ship an order to more than one recipient. These templates are: • • • • • 166 Multiple Shipment Checkout Template : This is the template that will be displayed for the Checkout action if the customer specified more than one recipient for the items ordered. Multiple Shipment SSL Checkout Template : This is the template that will be displayed for the Secure Checkout action if the customer specified more than one recipient for the items ordered. If no template filename is entered in this field, the Multiple Shipment Check-out Template will be used. Multiple Shipment Verify Template : This is the template that will be displayed for the Verify action if the customer specified more than one recipient for the items ordered. Multiple Shipment SSL Verify Template : This is the template that will be displayed for the Verify action if the customer chose Secure Checkout and if the customer specified more than one recipient for the items ordered. If no template filename is entered in this field, the Multiple Shipment Verify Template will be used. Multiple Shipment ThankYou Template : This is the template that will be displayed for the BuyIt action if the customer chose an offline payment method and if the customer specified more than one recipient for the items ordered. PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files • • Multiple Shipment SSL ThankYou Template : This is the template that will be displayed for the BuyIt action if the customer chose an offline payment method and Secure Checkout, and if the customer specified more than one recipient for the items ordered. If no template filename is entered in this field, the Multiple Shipment Thank You Template will be used. Multiple Shipment Credit Accept Template : This is the template that will be displayed for the BuyIt action if the customer chose an online payment method and if the customer specified more than one recipient for the items ordered. The following PDG Commerce tags are available for these templates. !---FRIENDLYNAME--This tag is replaced by the friendly name entered for this recipient. The friendly name is entered by the customer when this recipient is added to their account, and appears in the recipient drop down menu as well as on the templates displayed during the multiple shipment checkout process. !---FIRST_NAME_ENTRY--This tag is used as the form entry name for the !---FIRST_NAME_VALUE--input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---FIRST_NAME_ENTRY---" value="!--FIRST_NAME_VALUE---"> !---FIRST_NAME_VALUE--This tag is replaced by the first name of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---LAST_NAME_ENTRY--This tag is used as the form entry name for the !---LAST_NAME_VALUE--input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---LAST_NAME_ENTRY---" value="!--LAST_NAME_VALUE---"> PDG Commerce -- Technical Reference Guide 167 Chapter 4 -- HTML Template Files !---LAST_NAME_VALUE--This tag is replaced by the last name of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---ADDRESS1_ENTRY--This tag is used as the form entry name for the !---ADDRESS1_VALUE--input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---ADDRESS1_ENTRY---" value="!--ADDRESS1_VALUE---"> !---ADDRESS1_VALUE--This tag is replaced by the first address line of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---ADDRESS2_ENTRY--This tag is used as the form entry name for the !---ADDRESS2_VALUE--input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---ADDRESS2_ENTRY---" value="!--ADDRESS2_VALUE---"> !---ADDRESS2_VALUE--This tag is replaced by the second address line of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---CITY_ENTRY--This tag is used as the form entry name for the !---CITY_VALUE--- input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this 168 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---CITY_ENTRY---" value="!---CITY_VALUE--"> !---CITY_VALUE--This tag is replaced by the city of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---STATE_ENTRY--This tag is used as the form entry name for the <!--MSHIP_STATE_SELECT---> selection menu field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the selection chosen in this field is saved for the appropriate recipient. This tag should appear in the template as: <select name="!---STATE_ENTRY---"> <!---MSHIP_STATE_SELECT--></select> !---MSHIP_STATE_SELECT--This tag is replaced by the state of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form selection menu field that can be modified by the customer. !---PROV_ENTRY--This tag is used as the form entry name for the !---PROV_VALUE--- input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---PROV_ENTRY---" value="!---PROV_VALUE--"> !---PROV_VALUE--This tag is replaced by the province of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. PDG Commerce -- Technical Reference Guide 169 Chapter 4 -- HTML Template Files !---ZIP_ENTRY--This tag is used as the form entry name for the !---ZIP_VALUE--- input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---ZIP_ENTRY---" value="!---ZIP_VALUE---"> !---ZIP_VALUE--This tag is replaced by the zip code of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---COUNTRY_ENTRY--This tag is used as the form entry name for the <!--MSHIP_COUNTRY_SELECT---> selection menu field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the selection chosen in this field is saved for the appropriate recipient. This tag should appear in the template as: <select name="!---COUNTRY_ENTRY---"> <!--MSHIP_COUNTRY_SELECT---></select> !---MSHIP_COUNTRY_SELECT--This tag is replaced by the country of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form selection menu field that can be modified by the customer. !---PHONE_ENTRY--This tag is used as the form entry name for the !---PHONE_VALUE--- input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---PHONE_ENTRY---" value="!--PHONE_VALUE---"> 170 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---PHONE_VALUE--This tag is replaced by the phone number of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. !---TEXT_ENTRY--This tag is used as the form entry name for the !---TEXT_VALUE--- input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=text name="!---TEXT_ENTRY---" value="!---TEXT_VALUE--"> !---TEXT_VALUE--This tag is replaced by special comments for the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a form field that can be modified by the customer. This field may be used to contain any extra information you wish for the customer to enter. !---SHIP_METHOD_ENTRY--This tag is used as the form entry name for the <!--SHIP_METHOD_SELECT---> selection menu field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the selection chosen in this field is saved for the appropriate recipient. This tag should appear in the template as: <select name="!---SHIP_METHOD_ENTRY---"> <!--SHIP_METHOD_SELECT---></select> !---SHIP_METHOD_SELECT--This tag is replaced by a form selection menu that will allow the customer to choose from the available shipping methods for the current recipient. !---FRIENDLYNAME_ENTRY--This tag is used as the form entry name for the !--FRIENDLYNAME_VALUE--- hidden input field. This tag will be replaced with a form entry name that corresponds to the index of the current recipient PDG Commerce -- Technical Reference Guide 171 Chapter 4 -- HTML Template Files to ensure that the information in this field is passed for the appropriate recipient. This tag should appear in the template as: <input type=hidden name="!---FRIENDLYNAME_ENTRY---" value="!--FRIENDLYNAME_VALUE---"> !---FRIENDLYNAME_VALUE--This tag is replaced by the friendly name of the current recipient, if the customer is logged in and this recipient’s information has been previously saved. Note that this is a hidden form field and will not be displayed on the page. !---SAVE_CONTACT_BUTTON--This tag is used as the form entry name for a checkbox input field. This checkbox will indicate whether or not the current recipient’s shipping address should be saved to the customer’s account on your web site. This tag will be replaced with a form entry name that corresponds to the index of the current recipient to ensure that the information entered in this field is saved for the appropriate recipient. This tag should appear in the template as: <input type=checkbox name="!---SAVE_CONTACT_BUTTON---"> !---FIRST_NAME--This tag is replaced by the first name of the current recipient. !---LAST_NAME--This tag is replaced by the last name of the current recipient. !---ADDRESS1--This tag is replaced by the first address line of the current recipient’s shipping address. !---ADDRESS2--This tag is replaced by the second address line of the current recipient’s shipping address. !---CITY--This tag is replaced by the city of the current recipient’s shipping address. 172 PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files !---STATE--This tag is replaced by the state of the current recipient’s shipping address. !---ZIP--This tag is replaced by the zip code of the current recipient’s shipping address. !---COUNTRY--This tag is replaced by the country of the current recipient’s shipping address. !---PHONE--This tag is replaced by the phone number of the current recipient. !---TEXT--This tag is replaced by the special text entered for the current recipient. !---SHIP_METHOD--This tag is replaced by the shipping method chosen for the current recipient. !---SUBTOTAL--This tag is replaced by the subtotal for the current recipient’s order. !---SHIPPING--This tag is replaced by the shipping cost for the current recipient’s order. !---TAX--This tag is replaced by the tax for the current recipient’s order. !---TOTAL--This tag is replaced by the total cose of the current recipient’s order. PDG Commerce -- Technical Reference Guide 173 Chapter 4 -- HTML Template Files Multiple Shipping Template Tags For your reference, please find below the complete list of tags available for use on each multiple shipping template. Multiple Shipment Checkout Template The Multiple Shipment Checkout Template can utilize the RECIPIENT tags, as well as the following tags: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 174 <!---FRIENDLYNAME---> <!---FIRST_NAME_ENTRY---> <!---FIRST_NAME_VALUE---> <!---LAST_NAME_ENTRY---> <!---LAST_NAME_VALUE---> <!---ADDRESS1_ENTRY---> <!---ADDRESS1_VALUE---> <!---ADDRESS2_ENTRY---> <!---ADDRESS2_VALUE---> <!---CITY_ENTRY---> <!---CITY_VALUE---> <!---STATE_ENTRY---> <!---MSHIP_STATE_SELECT---> <!---PROV_ENTRY---> <!---PROV_VALUE---> <!---ZIP_ENTRY---> <!---ZIP_VALUE---> <!---COUNTRY_ENTRY---> <!---MSHIP_COUNTRY_SELECT---> <!---PHONE_ENTRY---> <!---PHONE_VALUE---> <!---TEXT_ENTRY---> <!---TEXT_VALUE---> <!---SHIP_METHOD_ENTRY---> <!---SHIP_METHOD_SELECT---> <!---FRIENDLYNAME_ENTRY---> <!---FRIENDLYNAME_VALUE---> <!---SAVE_CONTACT_BUTTON---> <!---SUBTOTAL---> <!---SAVE_CONTACT_BUTTON---> PDG Commerce -- Technical Reference Guide Chapter 4 -- HTML Template Files Multiple Shipment SSL Checkout Template The Multiple Shipment SSL Checkout Template can utilize the same tags as those available for the Multiple Shipment Checkout Template. Multiple Shipment Verify Template The Multiple Shipment Verify Template can utilize the RECIPIENT tags, as well as the following tags: • • • • • • • • • • • • • • • • <!---FRIENDLYNAME---> <!---FIRST_NAME---> <!---LAST_NAME---> <!---ADDRESS1---> <!---ADDRESS2---> <!---CITY---> <!---STATE---> <!---ZIP---> <!---COUNTRY---> <!---PHONE---> <!---TEXT---> <!---SHIP_METHOD---> <!---SUBTOTAL---> <!---SHIPPING---> <!---TAX---> <!---TOTAL---> Multiple Shipment SSL Verify Template The Multiple Shipment SSL Verify Template can utilize the same tags as those available for the Multiple Shipment Verify Template. Multiple Shipment ThankYou Template The Multiple Shipment ThankYou Template can utilize the RECIPIENT tags, as well as the following tags: • • • • • • • <!---FRIENDLYNAME---> <!---FIRST_NAME---> <!---LAST_NAME---> <!---ADDRESS1---> <!---ADDRESS2---> <!---CITY---> <!---STATE---> PDG Commerce -- Technical Reference Guide 175 Chapter 4 -- HTML Template Files • • • • • • • • • <!---ZIP---> <!---COUNTRY---> <!---PHONE---> <!---TEXT---> <!---SHIP_METHOD---> <!---SUBTOTAL---> <!---SHIPPING---> <!---TAX---> <!---TOTAL---> Multiple Shipment SSL ThankYou Template The Multiple Shipment SSL ThankYou Template can utilize the same tags as those available for the Multiple Shipment ThankYou Template. Multiple Shipment Credit Accept Template The Multiple Shipment Credit Accept Template can utilize the same tags as those available for the Multiple Shipment ThankYou Template. 176 PDG Commerce -- Technical Reference Guide Chapter 5 PDG Commerce Actions P DG Commerce Actions describe the various actions that customers can perform on their cart. These actions include adding items, removing items, performing searches and checking out. Because PDG Commerce is a CGI product, it must be called from either a form or a hyperlink within an HTML Web page. This section assumes that the installer or maintainer of the Web store has some knowledge of HTML and HTML forms. Each action has a predefined code that is passed to PDG Commerce via a form embedded in the HTML page. This section explains each action code and the required HTML form inputs that PDG Commerce needs to perform the action. There is also a listing and explanation of the optional form inputs that can be used with each action. Actions are submitted to PDG Commerce through the “submit” type of form input for HTML. A unique string of text identifies each PDG Commerce action. This string of text must be the “name” parameter used in the “submit” input statement. Many actions also require additional information to be passed to PDG Commerce through other form inputs. Here is an example of embedding an action in an HTML file: <form action="[location of PDG Commerce executable]" method="post"> [input fields (both required and optional)...] <input type="submit" name="[predefined action text]" value="[text to appear on button]"> [other submit inputs...] </form> The rest of this section defines each action and any form inputs that go with it. PDG Commerce -- Technical Reference Guide 177 Chapter 5 -- Cart Actions Pricing Category Code This action allows you to create a customer category to be used as a coupon. This category must be created with a registration code, and you should configure the discount for that category. When customers access your web site using an appropriate link to your web site with the code included, they will temporarily be moved to that category to obtain the discount. To create the coupon link, you will call the redirect executable. On a Windows server, the file will be called Redirect.exe. On a UNIX server, the file will be called redirect.cgi or just redirect. You must also include the coupon code specified as the customer category's registration code. You must include a goto link, which points to a specific page on your web site. Consider the following example: http://www.mywebstore.com/cgi-bin/redirect?code=12345&goto=/salepage.html In this example, the coupon customer category code is 12345, and the goto link takes the customer to the page salepage.html on your site. The above example shows how to use a url to link to a specific code. If you would prefer that your customer enter a special code, you may use a form similar to the following: <form method="post" action="/cgi-bin/redirect.cgi"> <input type="hidden" name="goto" value="/salepage.html"> Discount code: <input type="text" name="code" value=""> <input type="submit" name="submit" value="submit"> </form> This form contains an input named “code” to accept the coupon customer category code, and passes the “goto” link as a hidden field. This form may be used on any page on your web site. Search Action This action instructs PDG Commerce to search the product database for specific keywords and return all of the products that match the query. The resulting page can then have thumbnails with PreAdd links, catalog listings with Add links or they may be custom formatted (See the ‘Search Settings’ section in the PDG Commerce User Guide or the ‘Search Results template’ section of this Technical Reference Guide for more information). 178 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Here is the syntax for using the SEARCH action: <form action="[location of PDG Commerce executable]" method="post"> <input type="text" name="KEYWORDS"> <input type="submit" name="SEARCH" value="[text to appear on button]"> </form> The submit input's name must be “Search.” The Keywords form input is required in order for PDG Commerce to know what to look for. The Keywords form input may be a hidden field with a hard-coded value for pre-determined searches. You may also choose a field by which to sort the search results, as well as specify the order in which they should be sorted. The syntax for these inputs is similar to the keywords input. The SortKey field must have a value of “price”, “sku”, “description”, or “order”. The SortOrder field must have a value of “descending” or “ascending”. The SortKey field must be passed for the search results to be sorted. If the SortOrder field is not passed, the search results will be sorted by the SortKey field in ascending order. An example of the use of these tags: <input type=”text” name=”SORTKEY” value=”price”> <input type=”text” name=”SORTORDER” value”descending”> New in PDG Commerce is the ability to search fields other than products’ keywords and descriptions. Customers now have the option of searching product SKU’s or product categories. You may also allow your shoppers to search for products using a desired price range. The syntax for these inputs is essentially the same as the keywords input: <input type="text" name="SKU"> <input type="text" name="CATEGORY"> <input type="text" name="PRICERANGE"> Note: As with the Keywords form input, any of these inputs may also be hard-coded into the template as “hidden” input types. Note: The SortKey, SortOrder, SKU, CATEGORY, KEYWORDS, and PRICERANGE fields may all be used as hard-coded drop down menus. PDG Commerce uses the SearchResult HTML Template File to generate the Web page that allows customers to view the products that matched their query. For information on this template file and others, refer to the ‘HTML Template Files’ of this Technical Reference Guide. The template that is used to display the search results may also be overridden with one of the following tags depending upon which layout you have selected for returning search results (see ‘Search Settings’ in the PDG Commerce User Guide for more information): <input type="hidden" name="TEMPLATE" value="[location of custom template relative to PDG_Commerce directory]"> PDG Commerce -- Technical Reference Guide 179 Chapter 5 -- Cart Actions <input type="hidden" name="ITEMTEMPLATE" value="[location of custom template relative to PDG_Commerce directory]"> Searches can also be hard-coded in URL form, such as: <a href=”/cgi-bin/commerce.cgi?search=action&category=A0001”>Widgets</a> This search has one additional arguement, ‘category’ which instructs PDG Commerce to list all of the product category A0001’s products. See below for more information on the usage of these form inputs. Keywords form input (required) PDG Commerce uses this data field to know what to search for. This field may be a text input field, allowing users to specify their own keywords. Alternatively, this may be a hidden input field, with a hard-coded value. This hard-coding allows dynamic category pages of products to be generated. A hyperlink can be created which performs a search for a specific keyword and thus produces dynamic category pages. Note: Customers should be informed that “and,” “or” and “not” may be used in this input field for yielding a broader or more narrow range of search results. The Keywords form input is only required for the Search action if none of the following form inputs are going to be used. SKU form input (optional) PDG Commerce uses this data field to know what to search for. This field should be a text input field, allowing users to specify their own SKU or product code for which to search. Category form input (optional) PDG Commerce uses this data field to know what to search for. This may be a text input field, allowing users to specify their own category. Alternatively, this field may be a drop-down menu, with hard-coded values from which the customer may choose. This hard-coding allows for dynamic searches. A hyperlink can also be created which performs a search for a specific category and thus produces dynamic category pages. PriceRange form input (optional) PDG Commerce uses this data field to know what to search for. This field will generally be a text input field, allowing users to specify their own price 180 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions range for products. Or this input may be a hidden input field, with a hardcoded value. This hard-coding can allow for dynamic pages of “bargain” products to be generated. Note: The shopper should be informed of the syntax that may be used when searching for products within a price range (i.e.: >,<,=,x-y). Note: While the above three form inputs all indicate that they are optional, at least one form input is required for every Search action called from your Web store. ItemTemplate form input (optional) If you have the search results being returned in catalog page form, as described in “Search Settings” of the PDG Commerce User Guide, then the sample-item template will be used. However you can override this with the ItemTemplate form input. This field must be named “ItemTemplate,” and the value is the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. Template form input (optional) By default, the results of the Search action are returned in the SearchResult Template File. You may specify a different template file by creating a hidden input field. This field must be named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. PreAdd Action This action instructs PDG Commerce to generate a Web page from the product database files allowing the customer to indicate quantity and options for a specific product. PreAdd instructs PDG Commerce to automatically create an HTML page that contains a call to PDG Commerce with the Add action. The PreAdd action will generate a Web page with the product's image, description, price and drop-down menus for each product option. It is from this “Add Item” page that the customer can then select options and indicate a desired quantity. The user will then submit this data back to PDG Commerce, via the Add action. The generated HTML page is divided into two sections. The first section contains the product's image, as specified by the Image URL in the product's definition in the corresponding product database file. The second section contains the product's description, pricing, and all form inputs for selecting quantity and options. PDG Commerce -- Technical Reference Guide 181 Chapter 5 -- Cart Actions If you do not want PDG Commerce to automatically create an Add Item page for a product, then use the Add action. Here is the syntax for using the PreAdd action: <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="KEY" value="[product code]"> <input type="submit" name="PREADD" value="[text to appear on button]"> </form> The submit input's name must be “PreAdd.” The Key form input is required. PDG Commerce uses the AddItem Template File to generate the Web page that allows customers to select options and quantities. This template should contain the !---ITEM--- tag in order to call the sample Item template that comes with PDG Commerce. For more information on these template files, refer to the ‘HTML Template Files’ section of this Technical Reference Guide. The templates that are used may also be overridden with one of the following tags depending upon which layout you will be using for viewing the product’s details. <input type="hidden" name="TEMPLATE" value="[location of custom template]"> will override the standard AddItem HTML template. <input type="hidden" name="ITEMTEMPLATE" value="[location of custom template]"> will override the standard Item HTML template. See below for more information on the usage of these form inputs. Key form input (required) PreAdd knows which product the customer wants to add from the Key form input. It is a hidden key. This code should be the same code as the product code found in the product definition in the product database file. This input should be generated automatically by the Cart when the Item template is drawn. For more information on product codes and product definitions, refer to the ‘Maintaining Products’ section of the PDG Commerce User Guide. Template form input (optional) By default, the PreAdd action calls the standard AddItem template located in your ‘PDG_Commerce’ directory. You may specify a different template file by creating a hidden input field. This field must be named “Template,” and 182 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. ItemTemplate form input (optional) The AddItem HTML template generally contains a call to the Item template in order to display the products to be added. However you can override this with the ItemTemplate form input. This field must be named “ItemTemplate,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. MultiPreAdd Action This action instructs PDG Commerce to generate a Web page from the product database file. This page will allow the customer to select options and quantities for several products at once. MultiPreAdd instructs PDG Commerce to create an HTML page automatically with a call to PDG Commerce with the MultiAdd action. The MultiPreAdd action will generate a Web page with multiple listings for a single product or a listing of multiple products, depending upon the form inputs that are submitted with it. These listings can be customized to include the product's image, price, weight and all available option selections for a specific product (See the ‘Item Template File’ section of this Technical Reference Guide for more information). The user can then select options and quantities for each entry and submit the data back to PDG Commerce through the MultiAdd action. On the generated HTML page, the data that is to be displayed for the selected product is fully customizable. If you do not want PDG Commerce to automatically create an option selection Web page for a product, then use the Add or MultiAdd action. Here is the syntax for using the MultiPreAdd action: <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="KEYS" value="[product code 1],[product code 2],[product code n]"> <input type="submit" name="MULTIPREADD" value="[text to appear on button]"> </form> The submit input's name must be “MultiPreAdd.” The Keys form input is required. PDG Commerce uses the MultiAdd Template File to generate the Web page that allows customers to select options and quantities. For information on this PDG Commerce -- Technical Reference Guide 183 Chapter 5 -- Cart Actions template file, refer to the ‘HTML Template Files’ section of this Technical Reference Guide. Note: PDG Commerce’s locked options feature will not be enabled when the MultiAdd template is called from the MultiPreAdd action. Keys form input (required) The MultiPreAdd action knows which products the customer wants to display from the Keys form input. This is a hidden input. The value for this input should be the SKUs of the products you wish to display, each separated by a comma. These codes should be the same codes as the product codes found in the product definition in the product database file. For more information on product codes and product definitions, refer to the ‘Maintaining Products’ section of the PDG Commerce User Guide. The input’s name must be “Keys.” Template form input (optional) By default, the MultiPreAdd action calls the standard MultiAdd template located in your ‘PDG_Commerce’ directory. You may specify a different template file by creating a hidden input field. This field must be named “Template,” and the value is the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. Add Action This action will actually add a product to the customer's cart. Unlike the PreAdd, this action requires quantity, price, and any available option selections passed to it via form inputs. If you would like PDG Commerce to generate an HTML page with the Add action in it and all the proper form inputs for the product as defined in your product database files, then use the PreAdd action. Here is the syntax for using the Add action. For non-hidden form inputs, a sample input type is shown. However, it is up to the Webmaster to determine what type of inputs to use. For pregenerated Web pages from the PreAdd action, the input types used are shown in the example. <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="KEY" value="[product code]"> <input type="hidden" name="REFERENCE" value="[link URL]"> <input type="text" name="QTY" value="[initial value]" size="[size of field]"> 184 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions <select name="OPT0"> <option value="[Selection 1 for Option 0]"> [more option selections...] </select> [more options...] <select name=singlerecipient><!---RECIPIENT_SELECT_OPTIONS---></ select> <input type=text name=singlerecipientname> <input type=text name="price"> <input type="submit" name="ADD" value="[text to appear on button]"> <input type=text name=numrecipients value="!--NUMBER_OF_RECIPIENTS---" size=3> <input type=submit name=preadd value="Redraw Recipient Table"> </form> Note that the options are indexed starting with the number ‘0.’ Number ‘0’ refers to the first option definition in the product definitions, number 1 refers to the second option definition, and so forth. The submit input's name must be “Add.” The Key and Qty form inputs are required. All other form inputs are optional. PDG Commerce will use the Basket Template File to display the contents of the customer's cart after adding a product to the basket. For more information on this and other template files, refer to the ‘HTML Template Files’ section of the PDG Commerce User Guide and in this Technical Reference Guide. Key form input (required) The Add action knows which product the customer wants to add to his cart from the Key form input. It is a hidden input. The value for this input should be the SKU of the product you wish to display. This code should be the same code as the product code found in the product definition in the product database file. For more information on product codes and product definitions, refer to the ‘Maintaining Products’ section of the PDG Commerce User Guide. The input's name must be “Key.” Reference form input (optional) This form input allows PDG Commerce to create a Return action call embedded in the Web page that results from the Add action. The value of this input should be a URL. The input's name must be “Reference.” PDG Commerce -- Technical Reference Guide 185 Chapter 5 -- Cart Actions Quantity form input (required) This form input specifies the amount of the product to add to the customer's cart. If this value is ‘0’ or negative, then no product will be added to the cart. The input's name must be “Qty.” While this form input is listed as required, if PDG Commerce does not receive a quantity input, it will assume 1. Note: “Qty” should be a text form input in order to allow the customer to change the quantity before adding the product to his cart. Opt[#] form inputs (optional) The Options form inputs allow the customer to choose option selections for the product to be added to the cart. Option values available for each selection should match the options defined in the product database files. The Options form input's name must follow this syntax: Opt[zero-based index of the option] PDG Commerce will generate these inputs automatically if the PreAdd action is used to generate this page. The inputs are generated from the product and option definitions in the product database files. For more information on defining product options, refer to the ‘Maintaining Products’ section of the PDG Commerce User Guide. Dynamic Pricing input (optional) If you are using Dynamic Pricing for a product, you can use this field on its Item page to collect the dynamic price for the product’s add action. The Dynamic Pricing input’s name must follow this syntax: <input type=text name="price"> Note: Dynamic product pricing must be configured in the details section for your product. Please see the “Maintaining Products” chapter of the PDG Commerce User Guide for instructions on configuring your products to accept dynamic pricing. Template form input (optional) By default, the Add action calls the standard Basket template (to display the new cart’s contects after the add). This template is located in your ‘PDG_Commerce’ directory. You may specify a different template file to be used for the basket display by creating a hidden input field. This field must be named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. 186 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Single Recipient form input (optional) If you allow customers to choose multiple shipping recipients for a single order, you may use either a single form input, a drop down menu, or both to allow your customer to choose a single recipient for the particular product being ordered from this page. Number of Recipients form input (optional) If you allow customers to choose multiple shipping recipients for a single order, you may allow them to enter a number in this field. They will then choose to redraw the recipient table, which will display fields to allow the customer to enter the requested number of recipients for the particular product being ordered from this page. MultiAdd Action This action actually adds a wide array of products to the customer's cart. The MultiAdd action allows shoppers to select options and quantities for several different products and add them to their cart with a single click. Like the Add action, this action requires product codes, quantities, and any available options passed to it in form inputs. A page with the MultiAdd action will be automatically generated whenever the MultiPreAdd action is called. However, you can also customize the Item template to contain the MultiAdd action if you are using the REPEAT or REPEAT NUMBER tags. Here is an example of a sample Item template with REPEAT NUMBER tags followed by the HTML that it will generate: <form action="[location of PDG Commerce executable]" method="post"> <!---BEGIN_REPEAT1---> <tr> Qty: <input type="edit" name="MQTY1" value="[initial value]" size="[size of field]"> Item Options: <!---ITEM_OPT0--->[more options...] <input type="submit" name="!---ADD_BUTTON---" value="Add Me"> </tr> <!---END_REPEAT2---> <input type="submit" name="MULTIADD" value="Add the Whole Page"> </form> Generates the following HTML on the page: PDG Commerce -- Technical Reference Guide 187 Chapter 5 -- Cart Actions <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="MSKU1" value="[product code]"> <tr> Qty: <input type="edit" name="MQTY1" value="[initial value]" size="[size of field]"> Item Options: <select name="MOPT1_0"> <option value="0">[selection 0 for option 0]</option> <option value="1">[selection 1 for option 0]</option> <option value="2">[selection 2 for option 0]</option> </select> [more options...] <input type="submit" name="MADD.1" value="[text to appear on button]"> </tr> <tr> <input type="hidden" name="MSKU2" value="[product code]"> Qty: <input type="edit" name="MQTY2" value="[initial value]" size="[size of field]"> Item Options: <select name="MOPT2_0"> <option value="0">[selection 0 for option 0]</option> <option value="1">[selection 1 for option 0]</option> <option value="2">[selection 2 for option 0]</option> </select> [more options...] <input type="submit" name="MADD.2" value="[text to appear on button]"> </tr> <input type="submit" name="MULTIADD" value="[text to appear on button]"> </form> Note: If you are displaying different products altogether using the REPEAT tags, the output will be similar to what is shown above. However, for displaying options using the REPEAT tags, you will need to utilize the OPTIONS tags. For more information on the OPTIONS, REPEAT and REPEAT NUMBER tags please see ‘HTML Template Files’ in this Technical Reference Guide. The index numbers on the product codes correspond to the numbers entered in the !---BEGIN_REPEATx--- and !---END_REPEATy--- tags. This range (x to y, inclusive) determines how many instances of the product will appear on the page. You must also note that options and option selections are indexed beginning with zero. This is so PDG Commerce knows which selection goes with which option, and likewise which options and quantities go with which instance of the product on the template. 188 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions The submit input's name must be “MultiAdd.” The MSKU[#], MQTY[#] and MOPT[#]_[#] inputs are all required. These inputs will be automatically generated from the tags within the REPEAT NUMBER tags. If a product has no options, the tag that creates that input will be ignored. All other form inputs are optional. You may also notice the MADD.[#] form inputs, one for each product instance on the template. These are generated by the !---ADD_BUTTON--tag. These are for adding a single line or instance of the product instead of the entire page. This action will be covered in its own section, following this one. PDG Commerce uses the Basket Template File to display the contents of the customer's cart after adding the products to the basket. For information on this template file, refer to the ‘HTML Template Files’ sections in this Technical Reference Guide. MSKU[#] form input (required) The MultiAdd action knows which product the customer wants to add from the MSKU[#] form input. The [#] is the index number that will be applied to all of the inputs which pertain to each particular instance of the product on the MultiAdd template. This is a hidden input. The value for this input should be the same code as the product code found in the product definition in the product database file. For more information on product codes and product definitions, refer to the ‘Maintaining Products’ section in the PDG Commerce User Guide. The input's name must be “MSKU[#].” MQty[#] form input (required) The MultiAdd action uses these form inputs to know the quantities of each product to add to the basket. This input should be a text field so the shopper can modify quantities on the MultiAdd page. The [#] corresponds to the index number on the MSKU[#] input for the particular product instance. The input's name must be “MQty[#].” MOpt[#]_[#] form input (required) A page containing the MultiAdd action also allows a shopper to select all of the options for several product listings. The MOpt[#]_[#] input will generally be a drop-down menu containing all of the option selections for a particular option. When this input is passed with the MultiAdd action, PDG Commerce distinguishes it from others by the index numbers. The first [#] corresponds to the index number for the product’s instance on the page (same as MSKU[#] and MQty[#]). The second [#] indicates which option for the particular product is being configured. Finally, the number of the customer’s option selection is passed as the input’s ‘value.’ The input’s name must be “MOpt[#]_[#].” PDG Commerce -- Technical Reference Guide 189 Chapter 5 -- Cart Actions Reference form input (optional) This form input allows PDG Commerce to create a Return action call embedded in the Web page that results from the MultiAdd action. This should be a hidden input and the value of this input should be a URL. The input's name must be “Reference.” Template form input (optional) By default, the MultiAdd action calls the standard Basket template (to display the new cart’s contects after the add). This template is located in your ‘PDG_Commerce’ directory. You may specify a different template file to be used for the basket display by creating a hidden input field. This field must be named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. MAdd.[#] Action As described in the ‘MultiAdd Action’ section, the MAdd.[#] action may also be used on sample-Item pages which utilize the REPEAT or REPEAT NUMBER tags. There will be a MAdd.[#] input that corresponds to each and every product listing on these sample-Item pages. Instead of adding the entire page, the MAdd.[#] action only adds the product listing that corresponds to the MSKU[#] input of the same index number. The MAdd.[#] and the MultiAdd actions may be used on the same page because they take the same form inputs. Here is an example of how the MAdd.[#] action may be used: <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="MSKU1" value="[product code]"> <tr> <input type="edit" name="MQTY1" value="[initial value]" size="[size of field]"> <select name="MOPT1_0"> <option value="0">[selection 0 for option 0]</option> [more option selections] </select> [more options...] <input type="submit" name="MADD.1" value="[text to appear on button]"> ... </form> Note: If you are displaying different products altogether using the REPEAT tags, the output will be similar to what is shown above. For more information 190 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions on the REPEAT and REPEAT NUMBER tags please see the section on ‘HTML Templates’ in this Technical Reference Guide. MSKU[#] form input (required) The MultiAdd action “knows” which product the customer wants to add from the MSKU[#] form input. The [#] is the index number that will be applied to all of the form inputs pertaining to each particular instance of the product on the sample-Item template. MSKU[#] is a hidden input. The value for this input should be the same code as the product code found in the product definition in the product database file. For more information on product codes and product definitions, refer to the ‘Maintaining Products’ section of the PDG Commerce User Guide. The input's name must be “MSKU[#].” MQty[#] form input (required) The MultiAdd action “knows” what quantity of which product to add by this input. This input should be a text field so that the shopper can modify quantities on the sample-Item page. The [#] corresponds to the index number on the MSKU[#] form input for each particular product instance. The input's name must be “MQty[#].” MOpt[#]_[#] form input (required) A page containing the MAdd.[#] action also allows a shopper to select the options for any product instance on the sample-item page. The MOpt[#]_[#] input will generally consist of a drop-down menu containing all of the option selections for a particular option. When this input is passed with the MultiAdd action, PDG Commerce distinguishes it from others by the index numbers. The first [#] corresponds to the index number for the product’s instance on the page (same as MSKU[#]). The second [#] indicates which option for the particular product is being configured. Finally, the number of the customer’s option selection is passed as the input’s value. The input’s name must be “MOpt[#]_[#].” Reference form input (optional) This form input allows PDG Commerce to create a Return action call embedded in the Web page resulting from the MultiAdd action. This should be a hidden input and the value of this input should be a URL. The input's name must be “Reference.” PDG Commerce -- Technical Reference Guide 191 Chapter 5 -- Cart Actions Template form input (optional) By default, the MAdd action calls the standard Basket template (to display the new cart’s contects after the add). This template is located in your ‘PDG_Commerce’ directory. You may specify a different template file to be used for the basket display by creating a hidden input field. This field must be named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. OptFullAdd Action This action is generally invoked from the PreAdd action. When the sampleItem template that is called from a PreAdd action utilizes the OPTIONS tags, all of the possible option combinations for a single product will be displayed on that page. For instance, suppose a product has two options with three possible selections for each. With the OPTIONS tags utilized, the Item page will display nine instances of the product, each with a unique combination of option selections. The customer will still be able to indicate quantities for each product display, depending upon his preference. The OptFullAdd action will then be used to add all of the selected quantities from that page with a single click. Note: It should be noted that an Item page with the OptFullAdd action is only able to display the option selections for a single product as entered in the Merchant Administrator. Like the Add and MultiAdd actions, this action requires at least one quantity input. Unlike the Add and MultiAdd actions, however, the product code and option selections will be appended to the quantity input when the page is drawn. Thus, each quantity input will contain the product code and the index numbers for the corresponding option combination.. The following is an example of an Item template with OPTIONS tags followed by the HTML that it will generate: <form action="[location of PDG Commerce executable]" method="post"> <td>Full SKU</td><td>Quantity<td></td><td><!---DESC_OPT0---> </td><td><!---DESC_OPT1---></td><td><!---OPT_LINE_PRICE---></td> <!---BEGIN_OPTIONS---> <tr> <td><!---OPT_LINE_SKU---></td> <td><input type="edit" name="!---OPT_LINE_QTY---" value="[initial value]" size="[size of field]"></td> <td><!---VALUE_OPT0---></td><td><!---VALUE_OPT1---></td> 192 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions <input type="submit" name="!---OPT_LINE_ADD---" value="Add Me"> </tr> <!---END_OPTIONS---> <input type="submit" name="OPTFULLADD" value="Add the Whole Page"> </form> Generates the following HTML code on your Web page: <form action="[location of PDG Commerce executable]" method="post"> <td>Full SKU</td><td>Quantity<td></td><td><!---DESC_OPT0---></ td><td><!---DESC_OPT1---></td><td><!---OPT_LINE_PRICE---></td> <tr> <td>[full product code]</td> <td><input type="edit" name="OQTY.[product code],0,0" value="[initial value]" size="[size of field]"></td> <td>[selection 0 for option 0]</td> <td>[selection 0 for option 1]</td> <input type="submit" name="OADD.[product code],0,0" value="Add Me"> </tr> <tr> <td>[full product code]</td> <td><input type="edit" name="OQTY.[product code],1,0" value="[initial value]" size="[size of field]"></td> <td>[selection 1 for option 0]</td> <td>[selection 0 for option 1]</td> <input type="submit" name="OADD.[product code],1,0" value="Add Me"> </tr> [more product instances] <input type="submit" name="OPTFULLADD" value="Add the Whole Page"> </form> The number of product instances that appear on this page depends solely on the number of options and their corresponding selections. As stated above, if your product has two options with three possible selections each, then the Item page will contain nine product instances. Likewise if your product has three options, each with two possible selections, The Item page will contain eight product instances. In the above example, each instance is formatted in a single row. The index numbers attached to the quantity inputs correspond to the selection numbers for the particular options. The submit input's name must be “OptFullAdd.” At least one OQTY input is required. These OQty inputs will be automatically generated from the !---OPT_LINE_QTY--- tag within the OPTIONS tags on the Item template. All other form inputs are optional. PDG Commerce -- Technical Reference Guide 193 Chapter 5 -- Cart Actions You may also notice the OADD.[#] form inputs, one for each product instance on the template. These are generated by the !---OPT_LINE_ADD--- tag. These are for adding a single line or instance of the product instead of the entire page. This action will be covered in its own section, following this one. PDG Commerce uses the Basket Template File to display the contents of the customer's cart after adding the products to the basket. For information on this template file, refer to the ‘HTML Template Files’ section of this Technical Reference Guide. OQTY form input (required) The OptFullAdd action “knows” which product instance the customer wants to add from the OQTY form input. This input also carries the product code and the option selection numbers that pertain to that product instance. Thus, the input’s name is unique for each product instance on the template. The input's name must follow the format: OQTY.[SKU],[zero based index of option selection],[zero based index of option selection]... There will be as many numbers following the product code as there are available options for the selected product. As stated before, these inputs will be automatically generated from the !---OPT_LINE_QTY--- tag within the OPTIONS tags on the Item template. Reference form input (optional) This form input allows PDG Commerce to create a Return action call embedded in the Web page that results from the OptFullAdd action. This should be a hidden input and the value of this input should be a URL. The input's name must be “Reference.” Template form input (optional) By default, the OptFullAdd action calls the standard Basket template (to display the new cart’s contects after the add). This template is located in your ‘PDG_Commerce’ directory. You may specify a different template file to be used for the basket display by creating a hidden input field. This field must be named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. 194 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions OAdd Action As described in the OptFullAdd action section, the OAdd action may also be used on sample-item pages which utilize the OPTIONS tags. There will be an OAdd input that corresponds to each product listing on these Item pages. Instead of adding the entire page, the OAdd action only adds the indicated quantity of the corresponding product instance. The OAdd and the OptFullAdd actions may be used on the same page because they take the same form inputs. Here is an example of how the OAdd action may be used: <form action="[location of PDG Commerce executable]" method="post"> <input type="edit" name="OQTY.[product code],0,0" value="[initial value]" size="[size of field]"> <input type="submit" name="OADD.[product code],0,0" value="[text to appear on button]"> </form> OQTY form input (required) The OptFullAdd action “knows” which product instance the customer wants to add from the OQTY form input. This input will also carry the product code and the option selection numbers that pertain to that product instance. Thus, the input’s name is unique for each product instance. The input's name must follow the format: OQTY.[SKU],[zero based index of option selection],[zero based index of option selection]... There will be as many numbers following the product code as there are available options for the selected product. As stated before, these inputs will be automatically generated from the !---OPT_LINE_QTY--- tag within the OPTIONS tags. Reference form input (optional) This form input allows PDG Commerce to create a Return action call embedded in the Web page resulting from the MultiAdd action. This should be a hidden input and the value of this input should be a URL. The input's name must be “Reference.” Template form input (optional) By default, the OAdd action calls the standard Basket template (to display the new cart’s contects after the add). This template is located in your ‘PDG_Commerce’ directory. You may specify a different template file to be used for the basket display by creating a hidden input field. This field must be named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. PDG Commerce -- Technical Reference Guide 195 Chapter 5 -- Cart Actions Remove Action This action removes one product from a customer's cart. In almost all cases, this action should only be called from a Web page displaying the cart contents pregenerated by PDG Commerce. Here is the syntax of the Remove action used in an HTML document. This action will remove the first item in the customer's cart. <form action="[location of PDG Commerce executable]" method="post"> <input type="submit" name="REMOVE0" value="[text to appear on button]"> </form> The submit input's name must follow this syntax: Remove[zero-based index of the product to remove] This action results in the cart being re-displayed, with the first item removed and totals updated. PDG Commerce uses the Basket Template File to display the contents of the customer's cart after removing the specified product. Because the contents of a customer's cart can vary, Remove actions should only be called in situations where the product is known to be in the Cart. PDG Commerce will automatically generate the appropriate Remove calls when displaying the Cart's contents. RemoveAll Action This action allows a user to completely empty their cart. This action may be called from PDG’s pregenerated cart display or from a static page, such as your Web store’s home page. Here is the syntax for using the RemoveAll action in an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="submit" name="REMOVEALL" value="[text to appear on button]"> </form> The submit input's name must be “RemoveAll.” This action results in the customer's current cart being displayed (which is empty). PDG Commerce uses the Basket Empty Template File to display the contents of the customer's cart after removing all products. For more informa- 196 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions tion on this template file, refer to the ‘HTML Template Files’ section of this Technical Reference Guide. Display Action This action allows a customer to display the current contents of his cart. In addition to the content display, PDG Commerce also allows the customer to modify the contents of his Cart. From the cart display, a customer can remove a specific item, remove all of the items, recalculate the Cart's contents (assuming that the customer changed item quantities), or submit the contents for purchase. Here is the syntax for calling the Display action from an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="submit" name="DISPLAY" value="[text to appear on button]"> </form> The submit input's name must be “Display.” This action results in the customer's current cart being displayed. PDG Commerce uses the Basket Template File to display the contents of the customer's cart. For information on this template file, refer to the ‘HTML Template Files’ section of the PDG Commerce User Guide. When Site Design mode is enabled, eight new display actions become available, as listed below. Please see the PDG Software Site Design guide for further information on these display actions. • • • • • • • • http://www.mywebstore.com/cgi-bin/commerce?display=tracking http://www.mywebstore.com/cgi-bin/commerce?display=contact http://www.mywebstore.com/cgi-bin/commerce?display=aboutus http://www.mywebstore.com/cgi-bin/commerce?display=search http://www.mywebstore.com/cgi-bin/commerce?display=home http://www.mywebstore.com/cgi-bin/commerce?display=user1 http://www.mywebstore.com/cgi-bin/commerce?display=user2 http://www.mywebstore.com/cgi-bin/commerce?display=user3 Template form input (optional) By default, the Display action calls the standard Basket template (to display the new cart’s contects after the add). This template is located in your ‘PDG_Commerce’ directory. You may specify a different template file to be used for the basket display by creating a hidden input field. This field must be PDG Commerce -- Technical Reference Guide 197 Chapter 5 -- Cart Actions named “Template,” and the value must be the path to the new template file. This path is assumed to be relative to the ‘PDG_Commerce’ directory. Recalc Action This action allows a customer to recalculate his cart's totals if they have modified any of the quantities. If the user has changed any of the quantity fields from a PDG Commerce Basket page, this action instructs PDG Commerce to recalculate the customer's totals and create a new Basket page with the new quantities in effect. Here is the syntax for calling the Recalc action from an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="text" name="QTY[zero-based index of product]" value="[current quantity for product value]" size="[size of field]"> [other QTY[#] inputs...] <input type="submit" name="RECALC" value="[text to appear on button]"> </form> The submit input's name must be “Recalc.” At least one Qty input is required for the Recalc action. This action results in the customer's current cart being recalculated considering the updated quantities and re-displayed. PDG Commerce uses the Basket Template File to display the contents of the customer's cart. Quantity form inputs (required) These form inputs allow the customer to specify new quantities for products that are currently in their cart. If a quantity form input is omitted from the form for a specific product, then PDG Commerce will not change the item's quantity. The form input's name must follow this syntax: Qty[zero-based index of the product in the Cart] PDG Commerce will generate these inputs automatically if the Display action is used to display the contents of the customer's cart. The inputs are generated from the current contents of the customer's cart. 198 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Return Action This action allows a customer to return to browsing your Web store after adding an item to his cart. If the customer's basket was displayed as a result of an Add or PreAdd action, this action instructs PDG Commerce to reload the Web page that contained the Add or PreAdd action. However, this may be overridden in one of two ways. If you have specified a “Destination of Shop Some More Button” (see the ‘Custom Buttons’ section of the PDG Commerce User Guide for more information) in the Merchant Administrator, then this URL will be loaded. Also, if the ‘reference’ input is used (as shown below), then its value will be the page that is loaded instead. Here is the syntax for calling the Return action from an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="REFERENCE" value="[URL to load]"> <input type="submit" name="RETURN" value="[text to appear on button]"> </form> The submit input's name must be “Return.” The Reference form input is optional for this action. PDG Commerce loads the URL specified by the Reference form input when executing the Return action. Reference form input (optional) This form input allows PDG Commerce to specify the page to which the Return action call directs your customers. The value of this input should be a complete URL. The input's name must be “reference.” Checkout Action When a customer is ready to proceed to checkout with all of the items in his cart, this action initiates the purchase process. The resulting Web page of the Checkout action should request shipping and billing information from the customer. Credit card information will not be acquired from the customer at this time. The response Web page generated from a Checkout action should contain a call to PDG Commerce with the Verify action. PDG Commerce -- Technical Reference Guide 199 Chapter 5 -- Cart Actions Here is an example of the syntax used for calling the Checkout action from an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="submit" name="CHECKOUT" value="[text to appear on button]"> </form> The submit input's name must be “Checkout.” The page produced by this action will display all of the order information, as well as request the shipping and billing address information from the customer. PDG Commerce uses the Checkout Template File to display the Cart and obtain the shipping and billing information. For information on this and other template files, refer to the ‘HTML Template Files’ section of this Technical Reference Guide. Verify Action The Verify action receives the customer's shipping and billing information. In response to this action, PDG Commerce will display the customer's current order and all entered shipping and billing information for verification by the customer. If the customer has indicated that they will purchase online with a credit card, PDG Commerce will now request the credit card information from the customer. The response Web page generated from a Verify action should contain a call to PDG Commerce with the BuyIt action. There are several input fields that the Verify action needs to process an order properly. Here they are along with the syntax for calling the Verify action from an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="text" name="contactname"> <input type="text" name="contactemail"> <input type=”text” name=”company”> <input type="text" name="billfirstname"> <input type="text" name="billlastname"> <input type="text" name="billstreet1"> <input type="text" name="billstreet2"> <input type="text" name="billcity"> <input type="text" name="billstate"> <input type="text" name="billprovince"> <input type="text" name="billzip"> <input type="text" name="billcountry"> <input type="text" name="billtext"> 200 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions <input type="text" name="contactname"> <select name="shipmethod"> <option value="[shipping method 1]"> [...more shipping methods] </select> <input type="checkbox" name="shiptobilladdr" value="yes"> <input type="text" name="shipname"> <input type="text" name="shipstreet1"> <input type="text" name="shipstreet2"> <input type="text" name="shipcity"> <input type="text" name="shipstate"> <input type="text" name="shipprovince"> <input type="text" name="shipzip"> <input type="text" name="shipcountry"> <!---BEGIN_RECIPIENT---> <input type=text name="!---FIRST_NAME_ENTRY---" value="!--FIRST_NAME_VALUE---"></td> <select name="!---STATE_ENTRY---"> <!---MSHIP_STATE_SELECT--></select> <input type=text name="!---LAST_NAME_ENTRY---" value="!--LAST_NAME_VALUE---"></td> <input type=text name="!---PROV_ENTRY---" value="!---PROV_VALUE--"> <input type=text name="!---ADDRESS1_ENTRY---" value="!--ADDRESS1_VALUE---"> <input type=text name="!---ZIP_ENTRY---" value="!---ZIP_VALUE---"> <input type=text name="!---ADDRESS2_ENTRY---" value="!--ADDRESS2_VALUE---"> <input type=text name="!---PHONE_ENTRY---" value="!--PHONE_VALUE---"> <input type=text name="!---CITY_ENTRY---" value="!---CITY_VALUE--"> <input type=text name="!---TEXT_ENTRY---" value="!---TEXT_VALUE--"> <select name="!---COUNTRY_ENTRY---"> <!--MSHIP_COUNTRY_SELECT---></select> <input type=checkbox name="!---SAVE_CONTACT_BUTTON---"> <select name="!---SHIP_METHOD_ENTRY---"> <!--SHIP_METHOD_SELECT---></select> <input type=hidden name="!---FRIENDLYNAME_ENTRY---" value="!--FRIENDLYNAME_VALUE---"> <!---END_RECIPIENT---> <input type="submit" name="VERIFY" value="[text to appear on button]"> <input type="text" name="pass..."> </form> PDG Commerce -- Technical Reference Guide 201 Chapter 5 -- Cart Actions The following input fields are required under all circumstances: contactname, contactemail, billfirstname, billlastname, billstreet1, billcity, billstate, billzip, billcountry, shipmethod. If the chosen shipping method does not have the <NoShipInfo> tag, then the following fields are required: shipname, shipstreet1, shipcity, shipstate, shipzip, shipcountry. However these fields become optional if the “shiptobilladdr” checkbox has been checked. The following input fields are optional under all circumstances: billmiddleinit, billprovince, billstreet2, billtext, shipprovince, shipstreet2, shiptext, phone1, phone2, and any pass-through fields. ContactName form input (required) This is the customer's name as it will appear on the invoice and in e-mail notifications. It should contain both the first and last name of the customer. The input’s name must be “contactname.” ContactEmail form input (required) This is the customer's e-mail address. It appears on the invoice and in verification e-mails. It is also used as the e-mail address to which the automatic invoice e-mail is sent after verification of the order. The input’s name must be “contactemail.” Company form input (optional) This is the customer’s company. It appears on the invoice and in verification e-mails. The input’s name must be “company.” BillFirstName form input (required) This is the first name of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the first name of the name on the credit card. If the customer intends to pay by check, then this should be the first name of the person signing the check. The input’s name must be “billfirstname.” BillMiddleInit form input (optional) This optional field can hold the middle initial of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the middle initial of the name on the credit card. If the customer intends to pay by check, then this should be the middle initial of the person signing the check. The input’s name must be “billmiddleinit.” 202 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions BillLastName form input (required) This is the last name of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the last name of the name on the credit card. If the customer intends to pay by check, then this should be the last name of the person signing the check. The input’s name must be “billlastname.” BillStreet1 form input (required) This is the first of two lines for providing the street address of the billing address. If the customer intends to pay by credit card, this should be the street address to which the credit card bill is sent. If the customer intends to pay by check, then this should be the street address of the person signing the check. The input’s name must be “billstreet1.” BillStreet2 form input (optional) This is the second of two lines for providing the street address of the billing address. If the customer intends to pay by credit card, this should be the street address to which the credit card bill is sent. If the customer intends to pay by check, then this should be the street address of the person signing the check. The customer may leave this field input blank if two lines are not needed. The input’s name must be “billstreet2.” BillCity form input (required) This is the city of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this city should be the city to which the credit card bill is sent. If the customer intends to pay by check, then this should be the city of the person signing the check. The input’s name must be “billcity.” BillState form input (required) This is the two-letter state code of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the state to which the credit card bill is sent. If the customer intends to pay by check, then this should be the state of the person signing the check. If you are using UPS costing, then this field must be the two letter code for the state of destination. If this field is ‘ZZ,’ then the BillProvince field is used instead of the BillState field in the billing address. The input’s name must be “billstate.” PDG Commerce -- Technical Reference Guide 203 Chapter 5 -- Cart Actions BillProvince form input (optional) This optional field is the province of the address of the person who will be billed for the purchase. This field can be filled in by non-US and non-Canadian customers (Canada’s provinces appear in the BillState list). This field is only applicable if BillState is ‘ZZ.’ If the customer intends to pay by credit card, then this should be the province to which the credit card bill is sent. If the customer intends to pay by check, then this should be the province of the person signing the check. The input’s name must be “billprovince.” BillZip form input (required) This is the postal code of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this Postal Code should be the ZIP Code to which the credit card bill is sent. If the customer intends to pay by check, then this should be the ZIP code of the person signing the check. The input’s name must be “billzip.” BillCountry form input (required) This is the country of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this country should be the country to which the credit card bill is sent. If the customer intends to pay by check, then this should be the country of the person who is signing the check. The data for this field must be PDG Commerce’s numeric country codes. PDG Commerce will convert this number back to the country's full name when producing shipping and billing addresses. The input’s name must be “billcountry.” BillText form input (optional) This form input can be used to collect any additional information that may be needed for customer billing. You have the option of labeling this field whatever you want on the Checkout page. An example of what this may be used for is the customer’s county. The input’s name must be “billtext.” ShipMethod form input (required) This form input allows the customer to decide which method of shipping (from your Web store’s available methods) to use to ship the products. The value passed to PDG Commerce through the form should be the zero-based index of the chosen method as listed in the ‘Shipping Rules’ section of your Merchant Administrator. PDG Commerce will automatically generate and place this form input in the customer's HTML page through the use of a tag of the Checkout Template 204 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions File. This form input may also be placed manually in the template. Refer to the ‘HTML Template Files’ sections of this Technical Reference Guide, for more information on the Checkout Template File. Depending upon the choice of shipping method and configuration of the chosen shipping method, the rest of the fields may or may not be required. If the chosen shipping method has the tag <NoShipInfo> in the Shipping.conf file, then all other fields beginning with the letters “SHIP” are ignored and not required. For more information on the <NoShipInfo> tag and the Shipping.conf file, refer to the ‘Configuring Shipping Options’ section in the PDG Commerce User Guide. ShipToBillAddr form input (required) The form input allows the customer to use the data entered for the billing address as the shipping address for the purchase. This input should be a checkbox input. If it is checked, then PDG Commerce will ignore and not validate the contents of any other form input beginning with the letters SHIP. If this checkbox is checked, then PDG Commerce will use BillState to determine if sales tax is applicable. ShipName form input (required or optional) This is the name to which the products should be shipped. This field will be ignored if the “shiptobilladdr” box is checked, or if there is no shipping information required for the selected shipping method. The input’s name must be “shipname.” ShipStreet1 form input (required or optional) This is the first of two lines provided for the street address to which the products will be shipped. This field will be ignored if the “shiptobilladdr” box is checked, or if there is no shipping information required for the selected shipping method. The input’s name must be “shipstreet1.” ShipStreet2 form input (optional) This is the second of two lines provided for the street address to which the products will be shipped. The input’s name must be “shipstreet2.” ShipCity form input (required or optional) This is the city to which the products will be shipped. This field will be ignored if the “shiptobilladdr” box is checked, or if there is no shipping information required for the selected shipping method. The input’s name must be “shipcity.” PDG Commerce -- Technical Reference Guide 205 Chapter 5 -- Cart Actions ShipState form input (required or optional) This is the two-letter state code to which the products will be shipped. This field's data is also used normally to determine if sales tax is applicable to the order. If you are using UPS to obtain shipping costs, this field must be the two-letter code for the state. If this field is ‘ZZ,’ then the ShipProvince field is used instead of ShipState when producing address information. This field will be ignored if the “shiptobilladdr” box is checked, or if there is no shipping information required for the selected shipping method. The input’s name must be “shipstate.” ShipProvince form input (optional) This field provides an entry for the province of the destination address. PDG Commerce only uses this field if ShipState is ‘ZZ.’ The input’s name must be “shipprovince.” ShipZIP form input (required or optional) This is the Postal Code to which the products will be shipped. This field will be ignored if the “shiptobilladdr” box is checked, or if there is no shipping information required for the selected shipping method. The input’s name must be “shipzip.” ShipCountry form input (required or optional) This is the country to which the products will be shipped. The data for this field must be the PDG Commerce numeric country codes. PDG Commerce will convert the numeric code back into the country's full name when producing address information. This field will be ignored if the “shiptobilladdr” box is checked, or if there is no shipping information required for the selected shipping method. The input’s name must be “shipcountry.” ShipText form input (optional) This form input can be used to collect any additional information that may be needed for customer shipping. You have the option of labeling this field whatever you want on the Checkout page. The field can be used, for example, to allow the customer to provice any special shipping or packaging instructions. The input’s name must be “billtext.” 206 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Phone1 form input (optional) This form input can be used to collect a phone number for your customer. The format for this field is not restricted, and so your customers can put in phone extensions, international numbers, or other dialing instructions. The input’s name must be “phone1.” Phone2 form input (optional) This form input can be used to collect a second phone number for your customer. The format for this field is not restricted, and so your customers can put in phone extensions, international numbers, or other dialing instructions. The input’s name must be “phone2.” Pass form inputs (optional) (Passthrough Variables) Any form input whose name begins with the letters “PASS” is passed on through PDG Commerce into the output without any additional processing. These form inputs allow for the collection of customer data that is needed by the merchant to process the order, but not required by PDG Commerce. Recipient inputs (required or optional) These inputs will not be displayed unless the customer has chosen to ship the order to multiple recipients. The form inputs inside of the <!--BEGIN_RECIPIENT---> and <!---END_RECIPIENT---> tags will be displayed with each recipient’s basket contents, so the customer can enter a shipping address and shipping method for each individual basket. The Save Contact Button checkbox will allow the customer to specify whether or not to save the recipient’s shipping information to the customer’s account with your Web store. The friendly name must be passed as a hidden field so Commerce may distinguish between the multiple shipping addresses. BuyIt Action The BuyIt action receives the customer's complete shipping, billing, and payment information. At this point an invoice is generated, and a copy of the invoice can be e-mailed to the customer and vendor, as well as stored in a log for later processing. In addition to the logging and e-mails, PDG Commerce can authorize credit card orders by communicating with a payment authorization service. At this time, PDG Commerce also decrements inventory appropriately, if inventory is being tracked. PDG Commerce -- Technical Reference Guide 207 Chapter 5 -- Cart Actions Here is the syntax for calling the BuyIt action from an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="contactname"> <input type="hidden" name="contactemail"> <input type="hidden" name="billfirstname"> <input type="hidden" name="billlastname"> <input type="hidden" name="billstreet1"> <input type="hidden" name="billstreet2"> <input type="hidden" name="billcity"> <input type="hidden" name="billstate"> <input type="hidden" name="billprovince"> <input type="hidden" name="billzip"> <input type="hidden" name="billcountry"> <input type="hidden" name="billtext"> <input type="hidden" name="contactname"> <input type="hidden" name="shipmethod"> <input type="hidden" name="shipname"> <input type="hidden" name="shipstreet1"> <input type="hidden" name="shipstreet2"> <input type="hidden" name="shipcity"> <input type="hidden" name="shipstate"> <input type="hidden" name="shipprovince"> <input type="hidden" name="shipzip"> <input type="hidden" name="shipcountry"> <input type="hidden" name="pass..."> <select name="billmethod"> <input type=”text” name=”giftcertificate”> <option> Option 1 <option> Option 2 [other bill methods accepted...] </select> <select name="cardtype"> <option value="[some card type]"> [other card types accepted] </select> <input type="text" name="cardnumber"> <input type="text" name="cardexp"> <input type="submit" name="BUYIT" value="[text to appear on button]"> </form> 208 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Invoice Generation The BuyIt action causes PDG Commerce to generate an invoice for the order. When the invoice is generated, a unique invoice number is generated to identify the invoice. The invoice number is comprised of some predefined text and a unique five digit number. The text is prefixed to the five digit number, and is defined in the ‘Order Logging/Retrieval’ section of the Merchant Administrator. The five digit number is generated from the contents of the Invoice Counter File, whose location is specified in Shopper.conf. For more information on the Shopper.conf file, you will need to contact PDG. If inventory is being tracked, then products are taken out of inventory when an invoice is created for the order. ContactName form input (required) This is the customer's name as it will appear on the invoice and in e-mails. It should contain both the first and last name of the customer. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “contactname.” ContactEmail form input (required) This is the customer's e-mail address. It appears on the invoice and in verification e-mails. It is also used as the e-mail address to use when sending the automatic invoice e-mail after accepting the order. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “contactemail.” BillFirstName form input (required) This is the first name of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the first name on the credit card. If the customer intends to pay by check, then this should be the first name of the person signing the check. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. BillLastName form input (required) This is the last name of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the last name of the name on the credit card. If the customer intends to pay by check, then this should be the last name of the person signing the check. The input’s name must be “billlastname.” PDG Commerce -- Technical Reference Guide 209 Chapter 5 -- Cart Actions BillStreet1 form input (required) This is the first of two lines for providing the street address of the billing address. If the customer intends to pay by credit card, this should be the street address to which the credit card bill is sent. If the customer intends to pay by check, then this should be the street address of the person signing the check. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “billstreet1.” BillStreet2 form input (optional) This is the second of two lines for providing the street address of the billing address. If the customer intends to pay by credit card, this should be the street address to which the credit card bill is sent. If the customer intends to pay by check, then this should be the street address of the person signing the check. The customer may have left this field input blank if two lines were not needed. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “billstreet2.” BillCity form input (required) This is the city of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this city should be the city to which the credit card bill is sent. If the customer intends to pay by check, then this should be the city of the person signing the check. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “billcity.” BillState form input (required) This is the two-letter state code of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this state should be the state to which the credit card bill is sent. If the customer intends to pay by check, then this should be the state of the person signing the check. If this field is ‘ZZ,’ then the BillProvince field is used instead of BillState when producing address information. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “bill state.” BillProvince form input (optional) This optional field provides the province of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this should be the province to which the credit card bill is sent. If the customer intends to pay by check, then this should be the province of the 210 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions person signing the check. This field is only applicable if BillState is ‘ZZ.’ The input’s name must be “billprovince.” BillZip form input (required) This is the ZIP Code of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this ZIP Code should be the ZIP Code to which the credit card bill is sent. If the customer intends to pay by check, then this should be the ZIP code of the person signing the check. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “billzip.” BillCountry form input (required) This is the country of the address of the person who will be billed for the purchase. If the customer intends to pay by credit card, then this country should be the country to which the credit card bill is sent. If the customer intends to pay by check, then this should be the country of the person signing the check. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “billcountry.” BillText form input (optional) This form input may contain whatever was entered by the customer in this field on the Checkout page. An example of what this may be used for might be the customer’s county of residence. The input’s name must be “billtext.” ShipMethod form input (required) This hidden form input indicates the customer's choice of shipment methods to be used to ship his order. The value of this field will be the zero-based index of the shipping method chosen as listed in the ‘Shipping Rules’ section of the Merchant Administrator. Depending on the choice of shipping method and configuration of the chosen shipping method, the rest of the fields may not be required. If the chosen shipping method has the tag <NoShipInfo> in the Shipping.conf file, then PDG Commerce will not place any more hidden input fields in the HTML page. The input’s name must be “shipmethod.” ShipName form input (required or optional) This is the name to which the products should be shipped. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipname.” PDG Commerce -- Technical Reference Guide 211 Chapter 5 -- Cart Actions ShipStreet1 form input (required or optional) This is the first of two lines provided for the street address to which the products will be shipped. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipstreet1.” ShipStreet2 form input (optional) This is the second of two lines provided for the street address to which the products will be shipped. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipstreet2.” ShipCity form input (required or optional) This is the city to which the products will be shipped. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipcity.” ShipState form input (required or optional) This is the two-letter state code to which the products will be shipped. This field's data may also be used to determine if sales tax is applicable to the order. If this field is ‘ZZ,’ then the ShipProvince field is used instead of ShipState when producing address information. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipstate.” ShipProvince form input (optional) This field provides an optional entry for the province of the destination address. PDG Commerce only uses this field if ShipState is ‘ZZ.’ The input’s name must be “shipprovince.” ShipZIP form input (required or optional) This is the ZIP Code to which the products will be shipped. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipzip.” 212 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions ShipCountry form input (required or optional) This is the country to which the products will be shipped. This is a hidden field, and should have been placed in the HTML page by the Checkout action of PDG Commerce. The input’s name must be “shipcountry.” BillMethod form input (required) The BillMethod form input allows the customer to determine how they want to pay for the products out of the given payment methods. The Web store may list as many payment options as they would like. PDG Commerce checks the value of this form input. The value for this form must be the zero-based index of the payment method, as listed in the Merchant Administrator. So the value of the first payment method listed in your Commerce Administrator should be “0”, the second method should be “1”, etc. The payment method for a gift certificate is automatically created by PDG Commerce, and the value for that method must be “GC”, instead of a numeric index value. GiftCertificate form input (optional) This text input will be where the customer enters his gift certificate key code if he is paying for all or part of the order with a previously purchased gift certificate. This input’s name must be “giftcertificate”. CardType form input (required or optional) This input should be a drop-down menu that lists the credit card types that your Web store accepts. This field will be required if the customer has selected a credit card payment method. The input’s name must be “cardtype.” CardNumber form input (required or optional) This text input will be where the customer enters his credit card number. This field will be required if the customer has selected a credit card payment method. The input’s name must be “cardnumber.” CardExp form input (required or optional) This text input will be where the customer enters his credit card’s expiration date. This field will be required if the customer has selected a credit card payment method. The input’s name must be “cardexp.” PDG Commerce -- Technical Reference Guide 213 Chapter 5 -- Cart Actions CCV2 form input (required or optional) This text input will be where the customer enters his credit card’s verification value. This field may be required if the customer has selected a credit card payment method and your real-time credit card processor requires it. The input’s name must be “ccv2.” BankName form input (required or optional) This text input will be where the customer enters the bank name with which he has a checking account. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the Verify page after the Verify action has been submitted. The input’s name must be “bankname.” RouteNumber form input (required or optional) This text input will be where the customer enters the routing number that corresponds with his bank. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the Verify page after the Verify action has been submitted. The input’s name must be “routenumber.” CheckNumber form input (required or optional) This text input will be where the customer enters the number of the check with which he wishes to pay. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the Verify page after the Verify action has been submitted. The input’s name must be “checknumber.” AccountNumber form input (required or optional) This text input will be where the customer enters his checking account number. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the Verify page after the Verify action has been submitted. The input’s name must be “accountnumber.” DriverLicenseNum form input (required or optional) This text input will be where the customer enters his valid driver license number. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the 214 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Verify page after the Verify action has been submitted. The input’s name must be “driverlicensenum.” DriverLicenseState form input (required or optional) This text input will be where the customer enters the state for his valid driver license. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the Verify page after the Verify action has been submitted. The input’s name must be “driverlicensestate.” PhoneNumber form input (required or optional) This text input will be where the customer enters his phone number, area code first. This field will be required if the customer has selected to pay by online check. PDG Commerce will automatically create this text field on the Verify page after the Verify action has been submitted. The input’s name must be “phonenumber.” Pass-- form inputs (optional) (Passthrough Variables) Any form input whose name begins with the letters “PASS” is passed on through PDG Commerce into the submitted invoice without any additional processing. These form inputs allow for the collection of customer data that may be needed by the merchant to process the order, but not required by PDG Commerce. If nothing is entered in the passthrough fields, then these form inputs will not be displayed on successive pages. ListCategories Action The ListCategories action will return the Category HTML template. The Category template is essentially a listing of all of your Web store’s product categories. This page contains the category code, image, name, as well as a long description for each product category in your Web store. Each category listing also contains a link to a page that lists all of the products in the category and acts as that category’s “home page.” Here is the syntax for calling the ListCategories action in an HTML page: <form action="[location of PDG Commerce executable]" method="post"> <input type="hidden" name="TEMPLATE" value="[location of custom template]"> PDG Commerce -- Technical Reference Guide 215 Chapter 5 -- Cart Actions <input type="submit" name="LISTCATEGORIES" value="[text to appear on button]"> </form> The submit input's name must be “ListCategories.” Template form input (optional) By default, the ListCategories action calls the standard Category HTML template located in your ‘PDG_Commerce’ directory. You may specify a different template file by creating a hidden input field. This field must be named “Template,” and the value is the path to the new template file. This path is must be relative to the ‘PDG_Commerce’ directory. Login Action The Login Action is the heart of the customer login process for PDG Commerce. Called by itself with no arguments, it will display the Login Template, which can allow customers with existing accounts to log in, and others to either shop anonymously and/or register with the web store. An example of an HTML link which would begin the login process would be: <a href=”/cgi-bin/commerce.exe?login=action”>Log In</a> An example of an HTML form that allows direct login (bypassing the Login Template) would be as follows. Note that this is the same type of form that is embedded on the Login Template and the Login Failure Template. <form method=post action=”/cgi-bin/commerce.exe”> <input type=text name=”username”> <input type=password name=”password”> <input type=submit name=”login” value=”Log In”> </form> When PDG Commerce receives this action with ‘username’ and ‘password,’ it will then attempt to log the user in. If log in is successful, PDG Commerce will display the Login Successful Template. If log in is not successful, PDG Commerce will display the Login Failure Template. 216 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions UPS Tracking Action You can embed a form call directly into your web pages to get UPS tracking information from PDG Commerce. The following form fields are used in this form, and are marked as either required or optional. An HTML example is provided after the field descriptions. trackno (Required) This form field should contain the order reference number provided to the customer. The reference number is specified by you when the packages are originally shipped. Your customer will then need this reference number to track the packages. PDG Software recommends that you use the order’s invoice number for the UPS reference number. However, you are not restricted to solely using the invoice number, and can use any other numbering system you see fit. Note: This field is used to track orders by your reference number, not by standard UPS tracking numbers. To enable shipment tracking for standard UPS tracking numbers for your customers, you should utilize the web-based tracking tools provided by UPS outside of PDG Commerce. rqstopt (Required) This field specifies the amount of tracking information to return. If this field is ‘activity’, UPS will return with the entire shipping history of the package. If this field is set to ‘none’, UPS will return with only the last shipping activity of the package. This form field should either be a select box if you wish to offer a choice to your customers, or set to a hidden field if you only want to return one type of information. destcntry (Required) This field must contain the PDG Commerce’s country code index for the package’s destination country. This form field can be a select box for selecting a country from a list, or a hidden field to track shipments to a single specific country. If a select box is used, you can specify the country list statically in HTML, or, if the form is embedded in a PDG Commerce template, allow PDG Commerce to dynamically generate the select box contents with the template tag “<!--COUNTRY_LIST-->”. Note: The data for this field is the PDG Commerce’s country code index, not any country code data specific to UPS. PDG Commerce will convert the country code index to the proper country data for UPS. The country code indexes for PDG Commerce can be found previously in this guide. PDG Commerce -- Technical Reference Guide 217 Chapter 5 -- Cart Actions terms (Required) This field must contain the text ‘agree’ for UPS to return tracking information to your customer. This field indicates your customer’s acceptance to all UPS Tracking terms and conditions. This field should be a checkbox or radio button. upstrack (Required) This field is the PDG Commerce ‘action’ field - it tells PDG Commerce to perform the package tracking with UPS. This field can be the submit button to your form, or it can be a hidden field. The value data for this field is ignored - it is the presence of this field that instructs PDG Commerce to track the package with UPS. destzip (Optional) Customers can specify an optional destination postal code. Only shipments to this postal code are then returned by UPS. usedates (Optional) Your customers can specify a date range to further refine UPS tracking results. For PDG Commerce to pass date search information on to UPS, the first character for the value of this field must be either a ‘Y’ or a ‘y’. You can use a checkbox, a radio button, or a select box for this field. beginmon (Optional) This is the two-digit number for the month of the date to use to begin the search range. The numbering starts with 01, for January, and proceeds to 12, for December. If this field is omitted, UPS will ignore the starting date for the search. beginday (Optional) This is the two-digit number for the day of the month to use to begin the search range. If this field is omitted, UPS will ignore the starting date for the search. 218 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions beginyr (Optional) This is the four-digit number for the year to use to begin the search range. Do not pass two digits in this field. If this field is omitted, UPS will ignore the starting date for the search. stopmon (Optional) This is the two-digit number for the month of the date to use to end the search range. The numbering starts with 01, for January, and proceeds to 12, for December. If this field is omitted, UPS will ignore the ending date for the search. stopday (Optional) This is the two-digit number for the day of the month to use to end the search range. If this field is omitted, UPS will ignore the ending date for the search. stopyr (Optional) This is the four-digit number for the year to use to end the search range. Do not pass two digits in this field. If this field is omitted, UPS will ignore the ending date for the search. Register Action PDG Commerce will begin the registration process for a new customer when it receives the Register Action. In response to receiving this action, PDG Commerce first checks to see if new customers can register into any customer categories. PDG Commerce also verifies any registration code passed to it. If registration is allowed and the presented registration code matches a customer category, then PDG Commerce will present the Register Template. This template will collect the customer’s information and complete the registration process. When setting up your customer categories, remember that all customer categories that you create into which customers can register themselves require a customer category registration code. You set this in the Merchant Administrator - see the chapter on ‘Customer Maintanence’ in the PDG Commerce Users Guide. Here is an HTML link example of the Register Action. Note that it passes a registration code of “LETMEIN.” You would need to ensure the customer PDG Commerce -- Technical Reference Guide 219 Chapter 5 -- Cart Actions category for these newly registered customers: 1) allows registration, and 2) has its registration code set to “LETMEIN.” <a href=”/cgi-bin/commerce?register=action&custcatregcode=LETMEIN”> Sign up for store access now! </a> Here is an HTML form example of the Register Action. Note here that the registration code is a form edit field. If you are inviting only certain persons to register into a special customer category code, you can give them that category’s registration code. They can then enter it into this form. <form method=post action=”/cgi-bin/commerce”> <input type=text name=”custcatregcode”> <input type=submit name=”register” value=”Begin Registration”> </form> In either case, if PDG Commerce cannot find a customer category that allows registration and either 1) has a registration code that matches the code given by the customer, or 2) is marked as ‘Default’, then PDG Commerce will display a registration error to the user. If the conditions above are met, PDG Commerce will register the user into the matching customer category, and display the Register Template to collect the customer’s specific information. custcatregcode (Optional) This is the name of the data field that contains the customer registration code. This can be hard-coded or it can be a form field. Note: This field is REQUIRED if you are going to allow customers to register themselves into any customer category that is not marked as ‘Default.’ You also must ensure that the customer category has a registration code definied in the Merchant Administrator. NewGuest Action This action signals to PDG Commerce to allow a non-registered user to begin shopping at your web store. In response to this action, PDG Commerce displays the Guest Template, welcoming the anonymous shopper. Persons shopping anonymously will have the same access as the customer category marked as ‘Default.’ ‘Allow Register’ does not have to be turned on for the ‘Default’ category. If you do not wish for non-registered shoppers to be able to view pricing or to purchase items from your store, turn off these access rights for the ‘Default’ category in your Merchant Administrator. An HTML link for this action might be: <a href=”/cgi/commerce.exe?newguest=action”> Skip Log In and Start Shopping! </a> 220 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions Note that someone may start shopping on your site anonymously and then log in before checking out. When this occurs, the customer may elect to keep their shopping cart from their anonymous browsing. Logout Action This action allows customers to log out of your web store. Once logged out, PDG Commerce displays the Guest Template. From this template, you may opt to allow someone else to re-login. An HTML link for this action might be: <a href=”/cgi/commerce.exe?logout=action”> Sign Off </a> SetBasket Action Once a customer logs in, your Login Successful template may display several different baskets and allow the customer to preset their basket to one. If the customer was shopping anonymously before logging in, they will have the option of continuing with that basket. If they had a previous basket which they did not order, they can continue with that basket. They can set their basket to the last completed order. Or they can set their basket to start empty. This action is almost always embedded in the Login Successful Template, where a customer can select their basket after logging in. You should not need to embed this action manually in a web page. SelectedBasket (Required) This data for the SetBasket Action is the PDG Commerce internal ‘basket string’ to use for the customer’s basket. You should not manually create this let PDG Commerce dynamically create it from the templates. RegisterNewUser Action PDG Commerce uses this action to process a new customer’s information for registration. After the customer has begun the registration process with the Register Action, and optionally passed a correct registration code, PDG Commerce responds by displaying the Register Template. This template allows the new user to fill account information. This information is then submitted to PDG Commerce via the RegisterNewUser Action. The following fields are used for this action. They are the same as the fields named in the CheckOut Template. • • • contactname contactemail billfirstname PDG Commerce -- Technical Reference Guide 221 Chapter 5 -- Cart Actions • • • • • • • • • • • • • • • • • • • billlastname billstreet1 billstreet2 billcity billstate billprovince billzip billcountry billtext shiptobilladdr shipname shipstreet1 shipstreet2 shipcity shipstate shipprovince shipzip shipcountry shiptext In addition to these fields, the following fields are also available: contactpass, contactpass2 (Required) These two fields allow the new customer to specify a password for their account. The password entered in both fields must match exactly and is case sensitive. If the passwords do not match, PDG Commerce will return with an error indicating the passwords need to match. Having two fields allows for the customer to “enter their new password” and to “enter it again to verify it.” generalcompanyname (Optional) The customer can enter their company name into this field. Though it is not specifically collected during check-out, the merchant can access this through the Merchant Administrator if it is needed. billphone1 (Optional) The customer can enter a billing phone number into this field. This field is collected during the check-out process, and is listed under the field name “phone1.” 222 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions billphone2 (Optional) The customer can enter a second billing phone number into this field. Though it is not specifically collected during check-out, the merchant can access this through the Merchant Administrator if it is needed. shipphone1 The customer can enter a phone number for a shipping contact into this field. Though it is not specifically collected during check-out, the merchant can access this through the Merchant Administrator if it is needed. shipphone2 The customer can enter a second phone number for a shipping contact into this field. Though it is not specifically collected during check-out, the merchant can access this through the Merchant Administrator if it is needed. DisplayUser Action This action is used to display the currently logged-in customer’s account information and address information. This output is displayed with the Update User template. The user can modify this data, and add, modify, or remove address information from here as well. An HTML link for this action follows. It requires no additional data values. <a href=”/cgi-bin/commerce.exe?displayuser=action”> Update Account Information </a> UpdateCustDetails Action This action allows the customer to update account specific details. It is called from the Update User template, and is embedded in that template by the !--UPDATE_CUSTOMER_LINK--- tag. It uses the following form inputs: • • • • • • contactemail generalcompanyname custcatregcode contactpass contactpass2 customerid With the exception of “customerid,” these inputs are the same as the inputs for the RegisterNewUser action. “Customerid” should be a hidden field that contains that customer’s ID number. PDG Commerce -- Technical Reference Guide 223 Chapter 5 -- Cart Actions Note that the HTML form that calls this action must be named “pdgcontact” so that embedded dynamic Javascript functions will operate properly. <form method="post" action="!---MODULE_NAME---" name="pdgcontact"> <input name="contactemail" value="!---CUST_EMAIL---"> <input name="generalcompanyname" value="!---CUST_COMPANY---"> <input name="custcatregcode"> <input type=password name="contactpass"> <input type=password name="contactpass2”> <input type=hidden name=”customerid” value=”!---USERID---”> <!---UPDATE_CUSTOMER_LINK---> ... </form> The !---UPDATE_CUSTOMER_LINK--- creates the submit action: <input type=submit name=”updatecustdetails” value="Update Customer"> You should use the tag instead of hardcoding this submit button if you are utilizing PDG Commerce’s custom buttons. UpdateContact Action The UpdateContact Action instructs PDG Commerce to take the information in the contact / address section of the UpdateUser template, and update the currently selected contact, be it the billing contact, the primary shipping contact, or any of the already defined secondary shipping contacts. This action expects the following form inputs: • • • • • • 224 Contactsel : This is a required internal value that UpdateContact action requires, which is used to determine which contact to update. The value for this field is the internal primary key for the contact record in the database. You should let PDG Commerce generate this field for you with the <!---DISPLAY_CONTACT_LIST---> tag. Otherwise you will need a script to manually query your database and retrieve the primary key information. Confirstname : This is the same as billfirstname for the RegisterNewUser Action. Conlastname : This is the same as billlastname for the RegisterNewUser Action. Constreet1 : This is the same as billstreet1 for the RegisterNewUser Action. Constreet2 : This is the same as billstreet2 for the RegisterNewUser Action. Concity : This is the same as billcity for the RegisterNewUser Action. PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions • • • • • • • Constate : This is the same as billstate for the RegisterNewUser Action. Conprovince : This is the same as billprovince for the RegisterNewUser Action. Concountry : This is the same as billcountry for the RegisterNewUser Action. Conphone1 : This is the same as billphone1 for the RegisterNewUser Action. Conphone2 : This is the same as billphone2 for the RegisterNewUser Action. Context : This is the same as billtext for the RegisterNewUser Action. Confriendlyname : This is the identifying name of the contact information. For secondary shipping contact informations, the Friendly Name is what identifies it from the other secondary shipping contacts. For billing and primary shipping contact information, this field is not used. Here is an HTML form example for the UpdateContact action and the AddNewContact action. Note that a lot of the HTML and Javascript code necessary for this is dynamically generated by PDG Commerce on the UserUpdate template. You should not need to add or remove form fields from this template. <form method="post" action="!---MODULE_NAME---" name="pdgcontact"> <!---DISPLAY_CONTACT_LIST---> <input name="Confirstname"> <input name="Conlastname"> <input name="Constreet1"> <input name="Constreet2"> <input name="Concity"> <select name="Constate"> <!---STATE_LIST---> </select> <input name="Conprovince"> <select name="Concountry"> <!---COUNTRY_LIST---> </select> <input name="Conphone1"> <input name="Conphone2”> <input name="Context"> <input name="Confriendlyname"> <!---UPDATE_CONTACT_LINK---> <!---ADD_CONTACT_LINK---> </form> PDG Commerce -- Technical Reference Guide 225 Chapter 5 -- Cart Actions AddNewContact Action The AddNewContact Action adds a new secondary shipping contact to the user’s account based on the data in the form in the UserUpdate template. It does not matter which current contact information you are viewing. This action will always add a new secondary shipping contact with the Friendly Name specified. This friendly name should then appear in the contact list (created by the !---DISPLAY_CONTACT_LIST--- tag). This action uses the same fields as the UpdateContact action. See that action for details on the form inputs and sample HTML. RemoveContact Action The RemoveContact Action is used to remove a secondary shipping contact from the user’s account. This action cannot be used to remove either the billing contact information or the primary shipping contact information - PDG Commerce will return with an error in either case. This action is dynamically embedded in the <!--DISPLAY_CONTACT_LIST---> tag for the UserUpdate Template. You should not need to code this action. Contactsel (Required) This is a required internal value that RemoveContact action requires, which is used to determine which contact to update. The value for this field is the internal primary key for the contact record in the database. You should let PDG Commerce generate this field for you with the <!--DISPLAY_CONTACT_LIST---> tag. Otherwise you will need script to manually query your database and retrieve the primary key information. SplitAddress Action If your customer is currently using the same contact information for both the billing contact and the primary contact, and wishes to have different address information for these two contacts, then they will use this action to split the contact information so that they can modify each individually. This action specifically duplicates the billing contact information for the primary shipping contact information, and turns off “ShipToBillAddr.” Once split, your customer can modify either contact information without affecting the other. You should let PDG Commerce generate this field for you with the <!--DISPLAY_CONTACT_LIST---> tag in the UserUpdate Template. 226 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions UseShipForBill Action If your customer currently has different contact information for their billing contact and their primary shipping contact, and wishes to use their primary shipping contact for both, then they will use this action. Using this action causes PDG Commerce to delete the current billing information, and to set the billing contact to point to the primary shipping contact, and to turn on “ShipToBillAddr.” Once done, any changes made to either the billing or primary shipping contact will automatically affect the other. You should let PDG Commerce generate this field for you with the <!--DISPLAY_CONTACT_LIST---> tag in the UserUpdate Template. UseBillForShip Action If your customer currently has different contact information for their billing contact and their primary shipping contact, and wishes to use their billing contact for both, then they will use this action. Using this action causes PDG Commerce to delete the current primary shipping information, and to set the primary shipping contact to point to the billing contact, and to turn on “ShipToBillAddr.” Once done, any changes made to either the billing or primary shipping contact will automatically affect the other. You should let PDG Commerce generate this field for you with the <!--DISPLAY_CONTACT_LIST---> tag in the UserUpdate Template. EmailAccountInfo Action PDG Commerce is able to send a customer's login information if they have forgotten it. This way, you can provide them the information that they need and eliminate the possibility for your customers to register several different times. You can use the code that follows to send an email to the customer: <form method=post action="!---SCRIPT_NAME---"> <input type=text name=email size=40> <input type=text name=username size=40> <input type=submit name=emailaccountinfo value="email password"> </form> You can send the information based on either the username or the email address. If you choose to use username, PDG Commerce will send an email to the email address associated with that username. Regardless, the email will contain both the username and password. Note: The submit input name must be emailaccountinfo and the text input name must be either email or username. If both the email field and the username field are entered on the page, PDG Commerce will not perform a check PDG Commerce -- Technical Reference Guide 227 Chapter 5 -- Cart Actions to determine if they match. The information entered in the first of these two fields appearing in the form will be used. Commerce Action Examples Below is a list of the available Commerce actions you can link from your web store pages: Remember: If you are using Commerce on a Windows server, these links will be to commerce.exe. If you are on a UNIX server, these links will be to commerce.cgi. 228 • List all products: http://www.mywebstore.com/cgi-bin/commerce?search=action&keywords=all • List all products using the template SearchResult-custom.html: http://www.mywebstore.com/cgi-bin/commerce?search=action&keywords=all&template=Templates/SearchResult-custom.html • List all products with the keyword shoes: http://www.mywebstore.com/cgi-bin/commerce?search=action&keywords=shoes • List all products with the keyword shoes without the keyword brown: http://www.mywebstore.com/cgi-bin/commerce?search=action&keywords=shoes+not+brown • List all products with the keyword shoes in category A000: http://www.mywebstore.com/cgi-bin/commerce?search=action&category=A000&keywords=shoes • List all categories: http://www.mywebstore.com/cgi-bin/commerce?listcategories=action • List all products in category A000: http://www.mywebstore.com/cgi-bin/commerce?search=action&category=A000 • Search for sku A0005: http://www.mywebstore.com/cgi-bin/commerce?search=action &sku=A0005 • Show Preadd page for product A0005: http://www.mywebstore.com/cgi-bin/commerce?pradd=action&key=A0005 • Add product A0005 to cart: http://www.mywebstore.com/cgi-bin/commerce?add=action&key=A0005 • Add product A0005 to cart with a dynamic price of $20.00: http://www.mywebstore.com/cgi-bin/commerce?add=action&key=A0005 &qty=1&price=20.00 • Add 2 products A0005 to cart: http://www.mywebstore.com/cgi-bin/commerce?add=action&key=A0005 &qty=2 • Add 2 different products to cart: http://www.mywebstore.com/cgi-bin/commerce?multiadd=action &msku0=A0001&mqty0=1&msku1=A0005&mqty1=1 PDG Commerce -- Technical Reference Guide Chapter 5 -- Cart Actions • View Cart: http://www.mywebstore.com/cgi-bin/commerce?display=action • View Cart using a specified template (not the default template): http://www.mywebstore.com/cgi-bin/commerce?display=action&template=Templates/Basket-custom.html • Go to CheckOut page: http://www.mywebstore.com/cgi-bin/commerce?checkout=action • Show Preadd page for product A0005 using a specified item template (not the default template): http://www.mywebstore.com/cgi-bin/commerce?preadd=action &key=A0005&itemtemplate=Templates/Sample-Item-custom.html • Show Preadd page for several products at once (A0001, A0002, A0003): http://www.mywebstore.com/cgi-bin/commerce?multipreadd=action &keys=A0001,A0002,A0003 • List all subcategories of a parent category A000: http://www.mywebstore.com/cgi-bin/commerce?listcategories=action&parent=A000 • Display Basket template with no products, instead of BasketEmpty template if basket is empty: http://www.mywebstore.com/cgi-bin/commerce?display=action&emptyoverride=yes PDG Commerce -- Technical Reference Guide 229 Chapter 5 -- Cart Actions 230 PDG Commerce -- Technical Reference Guide Chapter 6 Softgood Data Tags A reference of the special tags that can be placed in the softgood section P DG Commerce is known for it exemplary ability to allow your customers to purchase and download programs, accounts, and other data files. This purchasable data is referred to as “softgoods.” In addition to the standard softgood configurations (which can be set in the Merchant Administrator), PDG Commerce has the ability to customize the output of ThankYou and CreditAccept web pages depending on the purchased softgoods. The HTML code that can be embedded in these pages is called “Softgood Data.” For each softgood product purchased, PDG Commerce will place that product’s associated softgood data into the ThankYou and/or CreditAccept page. In addition to having static HTML code for your Softgood Data, PDG Commerce can change the Softgood Data to contain special information depending on the product and order. This is accomplished through special tags. PDG Commerce, when embedding the Softgood Data into the proper template, parses these tags and performs any action required. This chapter lists and explains the various tags that you can place in Softgood Data fields. !---INVOICE--This tag is replaced with the invoice number of the order. !---SKU--This tag is replaced with the sku of the item being purchase. PDG Commerce -- Technical Reference Guide 231 Chapter 6 -- Softgood Data Tags !---QTY--This tag is replaced with the quantity of the item being purchased. !---SCRIPT-NAME--This tag is replaced with the complete URL for PDG Commerce. This tag can be used to dynamically create PDG actions in the Softgood Data. !---DELIVERPAYLOAD--This tag is replaced with a complete URL that your customer can use to download the purchased softgood, if a payload is defined for the product in the Merchant Administrator. The access to the download will be governed by the restrictions defined for the product in the Merchant Administrator. So if you are only allowing 2 downloads for 60 minutes after the product is purchased, this link will enforce that and will only succeed two times during 60 minutes after download. Note that this tag is exactly the same as placing the following code in your Softgood Data: !---SCRIPT-NAME---?deliver=action&invoice=!---INVOICE---&sku=!--SKU---&qty=!---QTY--- To use this tag to create a download text hyperlink, use something like the following: <a href=”!---DELIVERPAYLOAD---”>Click Here to Download</a> To use this tag to create a clickable image to start the download, use something like the following: <a href=”!---DELIVERPAYLOAD---”><img src=”LOCATION_OF_IMAGE(/images/download.gif)”></a> !---EXEC--This special tag allows you to execute a separate program when the softgood product is purchased. This program can accomplish any other tasks you need completed that PDG Commerce does not complete itself. For example, this program can be used to generate license numbers and log those license numbers into a special license log file. The program can be any executable program for the operating system of the web server, including shell script, perl, or precompiled binaries. Your program must collect any additional inputs from the command line, and these inputs are discussed below. If any ouput from the program is to be displayed 232 PDG Commerce -- Technical Reference Guide Chapter 6 -- Softgood Data Tags back on the ThankYou or CreditAccept template, your program should output this as ‘standard out’, like it was printing the output to the screen. Any output by your program to standard out will be printed in place of the !---EXEC--tag on the template. The program must be located in the PDG_Commerce directory. Note that for Unix servers you must do a ./ if file is in the PDG_Commerce directory and not a subdirectory of PDG_Commerce. As stated earlier, you can pass additional data to the program in the format of command arguments. These arguments appear as special tags that are embedded in the EXEC tag. A list and explanation of these possible inputs for the EXEC program and an example follows: %e This tag is replaced with the customer’s email address. %a This tag is replaced with the invoice number of the order. %ln This tag is replaced with the customer’s last name. %fn This tag is replaced with the customer’s first name. %sku This tag is replaced with the sku of the item being ordered. %ct# If any custom text is collected for the specified option, this tag will be replaced with that custom text. Note that the option number here is 0-based. So the first option will be option #0, the second is option #1, etc. To collect any custom text for the second option, you would use “%ct1”. PDG Commerce -- Technical Reference Guide 233 Chapter 6 -- Softgood Data Tags %o# This tag is replaced with the selected option selection for the specified option number. Note that the option number here is 0-based. So the first option will be option #0, the second is option #1, etc. So if you are selling a software program, and the first option is a list of operating systems and the customer chooses “Macintosh”, then “%o0” will be replaced with “Macintosh.” %passName This tag is replaced with the associated passthrough field with the same name. Example: You have a C program that collects needed inputs and outputs a serial number, and may resemble something like: ... main (int argc, char **argv) { char *email = argv[1]; char *custfirstname = argv[2]; char *custlastname = argv[3]; char *invoice = argv[4]; char serialnumber[20]; ... GenerateSerialNumber (serialnumber, email, custfirstname, custlastname, invoice); ... printf (“%s”, serialnumber); } ... This C program collects the email address, the customer’s name, and the invoice number from the program’s command line. It uses it to create a serial number, and then prints that serial number to standard out. You do not have to use a C program - it is just provided here as an example. This can easily be a perl script or a shell script. This specific example program is next compiled, and stored in the ‘PDG_Commerce’ directory under the name “lic-gen”. Note you do not need a “cgi” extension - this program is not a CGI program. 234 PDG Commerce -- Technical Reference Guide Chapter 6 -- Softgood Data Tags Your Softgood Data may look something like this: <p>You may download the program <a href=”!---DELIVERPAYLOAD--”>Click Here to Download</a>.</p> <p>Your serial number is <b><!---EXEC: ./lic-gen ‘%e %fn %ln %a’ ---> </b>.</p> When a customer purchases the product, this Softgood Data is placed in the Thank You and/or Credit Accept template. When the EXEC tag is encountered, PDG Commerce executes ‘lic-gen’, replacing the ‘%’ arguments with the proper data. The output of the ‘lic-gen’ program is then put in place of the EXEC tag. PDG Commerce -- Technical Reference Guide 235 Chapter 6 -- Softgood Data Tags 236 PDG Commerce -- Technical Reference Guide
© Copyright 2024