2.12 Generate HTML Links

Last, you need to create all needed HTML links, and place them in your self replicating web site. This can be done through the Setup->Generate HTML Forms menu. The second section on the page titled Generate HTML Links, allows you to generate all needed links to place in your self replicating web site. You can specify up to four products when creating a link to add products to the cart, or purchase from the Customer Area. The quantity fields just below the product ID fields, allow you to specify the quantity of each product to add / purchase.

Below explains how to manually create the links. All scripts for these links are located in the /cgi-bin/xflow/modules/shop/bin/ directory of your server.


2.12.1 Add Product to Cart

You can allow people to add products to their cart, by creating a link to the following URL:
http://www.domain.com/cgi-bin/xflow/modules/shop/bin/add_cart.cgi

The following elements are allowed in the query string:
product_id
The ID# of the product(s) you would like to add. You can add multiple products to the cart, by specifying a comma delimited list of all product ID#'s. This element is required.

quantity
The quantity of all products being added. If adding multiple programs, a comma delimited list, specifying the quantity of each product respectively. For example, the second product ID# in the list, would correspond with the second quantity value. This element is optional, and if not present, will default to 1.

reseller
The username of the reseller for this order. Almost always, the value will be ~username~. Then when someone views a member's self replicating web site, the ~username~ merge field will be replaced with their username, making them the reseller for the order. This field is optional, and if not present, will default to the Default Reseller you specified during First Time Setup.


For example, to add the product ID# CD029, you would use the following link:
add_cart.cgi?product_id=CD029&reseller=~username~

Or to add the product ID# SER032, and three of the product ID# CD318, you would use the following link:
add_cart.cgi?product_id=SER032,CD318&quantity=1,3&reseller=~username~


2.12.2 Browse Category

If you're using product categories, you can allow people to browse all products in your database by category. Each page shows a list of sub-categories and products within the selected category they are browsing. You can allow people to browse categories by linking to the following URL:
http://www.domain.com/cgi-bin/xflow/modules/shop/bin/browse.cgi

The only element in the query string is category. The value is the ID# of the product category you would like to browse. You can find the ID# by going to the Products->Manage Categories menu. For example, if you would like to browse the category ID# 13, you would use the following link:
browse.cgi?category=13

Alternatively, you can browse all categories in your database, starting from the root categories, by simply going to the browse.cgi script, without any query string.


2.12.3 View Shopping Cart

You can allow people to view and manage the contents of their shopping cart, by going to the following URL:
http://www.domain.com/cgi-bin/xflow/modules/shop/bin/view_cart.cgi?reseller=~username~


2.12.4 Checkout Link

You can allow people to check out and place their order, by creating a link to the following URL:
http://www.domain.com/cgi-bin/xflow/modules/shop/bin/checkout.cgi

No query string is required. By going to the URL, the customer will be automatically redirected to the order form, to place their order. However, you can allow a customer to checkout with specific product(s), instead of making the customer add products to their cart first. This is good if, for example, the customer will only ever order a certain product. You can create one link to the checkout.cgi script, which will take the customer directly to the order form to purchase the specified products, instead of making the customer first add them to their cart.

To create this link, add a query string to the checkout.cgi script, using the following elements:
override
Set this to 1

product_id
The ID# of the product(s) you would like to purchase. You can add multiple products to the cart, by specifying a comma delimited list of all product ID#'s. This element is required.

quantity
The quantity of all products being purchased. If purchasing multiple products, a comma delimited list, specifying the quantity of each product respectively. For example, the second product ID# in the list, would correspond with the second quantity value. This element is optional, and if not present, will default to 1.

reseller
The username of the reseller for this order. Almost always, the value will be ~username~. Then when someone views a member's self replicating web site, the ~username~ merge field will be replaced with their username, making them the reseller for the order. This field is optional, and if not present, will default to the Default Reseller you specified during First Time Setup.


For example, if you would like to checkout with the product ID# GA482, you would use the following link:
checkout.cgi?override=1&product_id=GA482

Or if you would like to checkout with the product ID# ML229, and two of the product ID# PW418, you could use the following link:
checkout.cgi?override=1&product_id=ML229,PW418&quantity=1,2


2.12.5 Purchase product from Customer Area

You can allow customers to easily purchase products through the Customer Area, allowing them to use any existing payment methods on their account. This saves your customers from having to enter any contact or billing information. Instead, they can simply select which payment method to use from a list, and that's it.

To allow customers to purchase products from within the Customer Area, you need to create the following link:
index.cgi?~authtext~&action=purchase&product_id=[PRODUCT]&quantity=[QUANTITY]

Replace the [PRODUCT] and [QUANTITY] text with their correct values, as explained above when creating a link to add products to the shopping cart, or checkout.