PAGEVILLE.COM Homepage
  Home  Help   

Pageville Shopping Cart Editor
Other Integration Methods

October 11, 2004  Version 1.5.99

 

Integration Using Interface EXE Program

A web editing program can call the shoppingcartinterface.exe program and exchange data. The Intrface program will minimize it self and execute the shopping cart editor. Data can be transferred between the web editing program and the Interface program using a temporary file or the clipboard (copy and paste).

Copy and Paste Integration

An HTML document editor can use a macro (or extension) with copy and paste commands to integrate and get the benefits of the API integration with one exception. The exception is the user cannot convert ALL buy buttons on a web page from PayPal shopping cart to Pageville Shopping Cart with just a few key strokes. Also this is not well suited for text editors.

The macro should add two items to the top menu bar or to the right mouse click menu when the cursor is on an image. One should be "Add/Modify Shopping" and the other "Checkout Shopping".

When the user positions the cursor on an image and clicks on "Add/Modify Shopping" or "Checkout Shopping":

  • If there is a link for the image, it should be copied to the clipboard.
  • The Pageville Interface program should be called. The default location for this program is C:\Program Files\ShoppingCartEditor\shoppingcartinterface.exe. The following arguments should be included: /Task /html=HTMLFilename
    • Task is to be replaced with either AddModify or Checkout. This causes the interface window to be minimized and the AddModify or Checkout to be started.
    • The Filename is to be the name of the HTML file being edited.
  • The argument /AllowPopUp can be added to allow support for Pageville pop up BUY button method. The the pop up windows will show a Javascript error UNLESS the following function is added into the header (before the </HEAD> tag) of the web page:
      <SCRIPT LANGUAGE="JavaScript">
      <!--//
      function PagevilleBuy(){
      return;
      }
      //-->
      </SCRIPT>
  • The document editor should pause until the Shopping Cart Interface returns or until the user clicks on cancel. This can be done by executing the interface program from inside a dialog box. If the web editor cannot pause, it should use the always on top command.
  • The clipboard contents should be pasted as the link for the image.

Suggested Macro Steps For Add/Modify (When Execute Program Command Available)
  • 1. The user selects an image and clicks on Add/Modify either on the top menu bar or in the right mouse click menu.
  • 2. Get filename if it exists.
  • 3. Copy one of the following to the clipboard:
    • a. If the offset of the selected image or text from the beginning of the file can be determined by the macro, copy the entire document to the clipboard
    • b. Otherwise copy the hyperlink for the image to the clipboard if it exists. If no link exists, clear the clipboard or copy a space to the clipboard.
  • 4. Execute the Interface Program.
      Program likely at: C:\Program Files\ShoppingCartEditor\shoppingcartinterface.exe
      Sample Parameters: /AddModify /html=Hello.html /AllowPopUp

    If the entire document is copied to the clipboard and an image is selected, add the parameter /Offset=number where number is the offset (in bytes) from the start of the document to the image.

    If the entire document is copied to the clipboard and text is selected, add the parameter /Offset=start,end where "start" is the offset (in bytes) from the start of the document to the start of the selected text and "end" is the offset (in bytes) from the start of the document to the end of the selected text

  • 5. Open a message box that asks the user if they want to update the hyperlink for the button.
      UltraEdit brings up a message box titled "File Changed!". The contents of this message box is like "C:\. . .\myfile.html has been changed by another application. Do you want to relead it?
  • 6. After OK or Cancel is clicked on the Shopping Cart Editor, the Interface will minimize and the "want to update the hyperlink" messagebox will be in the foreground.
  • 7. If the answer to (6) is yes, paste the clipboard data into the hypertext field.
  • 8. Add the Javascript function to the header if not already added.
Suggested Macro Steps For Checkout Same as Add/Modify except replace /AddModify with /Checkout.

Temporary File Integration

This is the same as Copy and Paste Integration except a file is used in place of the clipboard. The changes are:
  • 1. Determine a temporary filename. This can always be the same name.
  • 2. Write the existing data to the file in place of coping to clipboard.
  • 3. Pass the temporary filename on the command line without a leading slash.
  • 4. Read updated data from the file in place of the clipboard.
Easy Web Editor uses this method and calls "shoppingcartinterface.exe" with the arguments
/AddModify /html=Document.html /AllowPopUp "Filename.txt" /EWE
  • /AddModify is replaced with /Checkout for checkout.
  • Document.html is the name of lthe HTML file that will be uploaded to web site.
  • Filename.txt is the temporary filename for the link data filename with path. This will be used for returning updated link data to the web program.
  • /AllowPopUp means the web editor will add the Javascript function to the header (once).
  • The Javascript function is returned in the file Filename.psc where "Filename" is the same as the temporary link data file.
Shopping Cart API