PAGEVILLE.COM Homepage
  Home  Help   

Pageville Shopping Cart Editor API

October 18, 2004   Version 1.5.0

 

Overview

The Pageville Shopping Cart Editor can create buy button code that works with PayPal or Pageville shopping carts. The shopping cart editor is available to integrate with HTML and text editors. Offer your users the ability to add e-commerce to their web sites at no additional cost. This will increase sales for both your editor and our shopping cart service.

The regular edition shopping cart editor is free with no time limits. The Pro edition offers minor enhancements for $29. Pageville's primary goal for revenue is not selling the shopping cart editor, but getting merchants to use our shopping cart service. Pageville ranks high in download.com with our shopping cart Plugin for FrontPage. See what one of our users says about our shopping cart. (Click on Pageville e-commerce when the "pronh" page loads.)

Integration can be done (1) using a macro (or extension) with the Interface EXE Programor (2) using the below API.

 
Pageville Shopping Cart Information
 

Integration Using Interface EXE Program

Using Interface EXE Program

Pageville Shopping Cart Editor API

The HTML or text document editors should add two selections to the right mouse click menu and/or add two buttons to the tool bar in the editor. One would be a BUY button and the other a CHECKOUT button. There are functions in the DLL for these buttons that require passing a pointer to a structure. The structures are as follows:

Download API

Definitions

Button Types for nButtonType
#define BUY_BUTTON 1
#define CHECKOUT_BUTTON 2
One or more of the following can be used for fFlags
#define FLAG_CLIPBOARD 1 // Data is to be transferred using the clipboard
#define FLAG_NO_POPUP 2 // No pop up permitted because interface can not insert Javascript function in header
#define FLAG_CALC_SIZE 4 // The data is ASCII string but size needs to be caluclated as the string length.

Button Structure

      typedef struct {
        int   size;   // size of this structure
        int   nButtonType;
        LPSTR pData;
        DWORD dwSize;
        DWORD dwCursorOffset;
        DWORD dwStartOfSelectedText;
        LPSTR pUpdatedData;
        DWORD dwUpdatedSize;
        LPSTR pHtmlFilename;
        DWORD fFlags;
        LPSTR pEditorName;
        LPSTR pAffiliate;
        // added 9/27/04
        LPSTR pWindowTitle;
      } tButtonEditor;
      

The content passed to the function is defined by pData and dwSize. It is strongly recommended that the entire document is used. Then a document with many PayPal buy buttons can be converted to Pageville buy buttons with a single action.

dwCursorOffset is offset in bytes from the start of pData to the location of the cursor.

dwStartOfSelectedText is offset in bytes from the start of pData to the start of selected text. If no text is selected, set dwStartOfSelectedText = -1. dwCursorOffset is to be the offset to the end of selected text.

pUpdatedData will point to memory allocated by the DLL and will have the same data as submitted at pData modified by adding the button code. This memory will be freed or reused next time a DLL function is called. It will also be freed when the DLL is shutdown.

pHtmlFilename is the HTML filename without path and we call it the Product Filename. The user can set the "Product Path" in Pageville Shopping cart administration. The return address after a buyer goes to checkout is the "Product Path" with the "Product Filename" appended. This is not used when PayPal BUY buttons are created.

fFlags can be used to set various flags. None at this time.

pEditorName is the name of the HTML or text editor that called functions in the DLL.

pAffiliate will be AWS (Arlington Web Services, Inc.) when the DLL was downloaded from a web page where AWS has paid advertising. Currently we advertise in download.com and overture.com. Otherwise pAffiliate will normally be the same as pEditorName.

Results Structure (only required with using Method 2 - see below)

      typedef struct {
          int   size;   // size of this structure
          int   nButtonNumber;
          LPSTR pUpdatedData;
          DWORD dwUpdatedSize;
          LPSTR pEditorName;
      } tEditorResults;
      

nButtonNumber is from the start editor function.

pUpdatedData will point to memory allocated by the DLL and will have the same data as submitted at pData modified by adding the button code. This memory will be freed or reused next time a DLL function is called. It will be freed when the DLL is shutdown.

Integration with HTML or text editors
The HTML documents are created and maintained by the HTML or text editor. There needs to be a BUY button for each item being sold. There is normally at least one CHECKOUT button on each product page. Any image can be used for BUY and CHECKOUT images.

The button shopping cart code can be added or modified while the document is being created or afterwards. The user is to position the cursor on or just after a button to add or modify button code. Then the user can edit a BUY button or CHECKOUT button. The HTML or text editor can launch the Shopping Cart Editor by having BUY and CHECKOUT icons on the tool bar and/or from a right mouse click menu.

A pointer to all the document data is to be passed to the DLL. Editing by the HTML or text editor must be suspended while the shopping cart editor is active. A pointer to updated document data will be returned within the passed structure.

Integration Methods
There are two integration methods available. Method 1 has a single function which opens a modal dialog box that has a Cancel button. The shopping cart editor is loaded as a separate application and its window opens in front of the dialog box that has a Cancel button. Data is passed between the dialog box and the shopping cart editor. When editing is complete, data is passed back to the dialog box, shopping cart editor closes and the modal dialog box closes, returning data to the document editor.

Method 2 requires that the HTML or text editor suspend editing and call the DLL. It then waits for the shopping cart editor to post a message.

Method 1 DLL Functions
PagevilleEditor(tButtonEditor *pButton);
    Returns TRUE if successful and FALSE otherwise.
    All memory allocated by the DLL is freed on DLL_PROCESS_DETACH.
Method 2 DLL Functions
PagevilleEditorStart(tButtonEditor *pButton, HWND hWnd, WPARAM wpMessageID);
  • The shopping cart editor will post the wpMessageID to hWnd when users complete editing or cancel. The LPARAM will be 1 if updated data is available and 0 otherwise.
  • The HTML or text editor should suspend editing before calling this function.
  • Return occurs after the shopping cart editor is activated. Return is -1 for failed and Button Number otherwise.

PagevilleEditorResults(tEditorResults *lpResults);

  • This function should be called after receiving the wpMessageID message with a 1 as prescribed by the PagevilleEditorStart().
  • Return is TRUE for success and FALSE otherwise.
  • The document data should be updated when return is TRUE.

PagevilleEditorCancel(int nButtonNumber);

  • This causes the shopping cart editor to close.

All memory allocated by the DLL is freed on DLL_PROCESS_DETACH.

Program Files
pageville-utility.dll
    Our install program copies this file to the windows\system or WINNT\system32 directory. This is incuded in API download.

pveditor.exe

    Currently this must be copied to "Program Files\ShoppingCartEditor" directory. Later, user will be able to select a directory. This is incuded in API download.

Files for sample interface program

    Files included
      win-doc-editor.exe
      win-doc-editor.c
      win-doc-editor.h
      win-dll-link.h
      win-doc-sample.html
    This is a sample interface program. The source, executable, and test files are included in the API download.

    This program loads pageville-utility.dll and loads an HTML file. If a file is not specified on the command line, win-doc-sample.html will be used.

    The right mouse click works for Method 1 and Method 2.

    The only purpose of the files associated with win-doc-editor.exe is to provide a sample integration. You may use any content from these files.

Using the DLL
The editor program can be downloaded and installed separately. In this case the Pageville install script copies pageville-utility.dll to the system directory. The document editor should check for the existence of pageville-utility.dll. If present it should load it and add the functions to the right mouse click menu and/or top menu bar.

Registry Data

The Shopping Cart editor stores setting in the registry in

            HKEY-LOCAL-MACHINE
              SOFTWARE
                Pageville
                  FrontPageAddin
            
          
more information

Affiliate Program

more information