i4w_product_order

Usage:

This shortcode is a one-click “product” order processor designed to perform its assigned tasks with no user interaction.

It can be used as a regular purchase tool as well as an upsell tool. In either case, the only requirement is that users be logged in the membership site and that their credit card information be stored in Infusionsoft.

In every example listed below, the default user information used is from the user currently logged in. All the parameters used in the examples can be mixed.

Please note that in addition to the tag “filters” available within the shortcode, this shortcode may be embedded within other conditional shortcodes, such as [i4w_onlyfor], [i4w_hidefrom], [i4w_ifget], [i4w_ifpost], etc.

You may include this shortcode several times on a page or post. However, only the first instance of the shortcode matching the requirements will actually run. This enables you to set up a single page with different tag-based rules triggering different product orders.

This shortcode does NOT supports conditional branching with [ELSE_product_order].

Shortcode nesting is NOT supported.

Parameters:

prodid The product ID of the product that should be used as the basis for an order. Required: No, if “prodname” and “prodprice” are used.
prodname An override for the product name Note: a recently introduced bug in the Infusionsoft API doesn’t accept the product name. The product name is named “product” instead. We hope/expect this will be fixed soon.
Required: No.
prodprice An override for the product price.
Required: No.
proddesc An override for the product description.
Required: No.
prodqty An override for the product quantity.
Required: No. Default: 1.
tagid A single or comma separated list of tag ID’s that a user must possess in order to complete an order. By default, having any tag is considered a “match” unless the “require_all_tags”.
Required: No.
require_all_tags Modifies the use of the “tagid” parameter from having to match at least one to having to match all tags.
Required: No.
excl_tagid A single or comma separated list of tag ID’s that a user may not possess in order to complete an order.
Required: No.
merchantid Allows an alternate merchant ID to be specified.
Required: No
leadaff Specifies the Lead Affiliate who should get credit for this transaction.
Required: No.
saleaff Specifies the Sale Affiliate who should get credit for this transaction.
Required: No.
actionsuccess The action set ID to be executed upon successful processing of the order.
Required: No.
actionfail The action set ID to be executed upon failed processing of the order.
Required: No.
urlsuccess The URL to which to redirect users upon a successful purchase.
Required: No, defaults to the site’s home page.
urlfail The URL to which to redirect users upon a failed purchase.
Required: No, defaults to the site’s home page.
deletefailed Specifies whether an “orphaned” (or incomplete) order is allowed to remain in your Infusionsoft application if the order failed.
Required: No, defaults to “yes”.

Example:

[i4w_product_order prodid='36']
Attempt to process an order using information from product ID 36.

[i4w_product_order prodid='[i4w_get_pid]']
Attempt to process an order using information from the product ID passed as a GET parameter named "pid" in the URL.

[i4w_product_order prodid='36' prodprice='9.90']
Attempt to process an order using information from product ID 36 EXCEPT for the product price, which will be set to 9.90.

[i4w_product_order prodid='[i4w_get_pid]' prodprice='[i4w_get_price]']
Attempt to process an order using information from the product ID passed as a GET parameter named "pid" in the URL, EXCEPT for the product price, which will be set to the value set in by the GET parameter named "price".

[i4w_product_order prodname='AdHoc Product' prodprice='9.90']
Attempt to process an order using a non-existing product, using ‘AdHoc Product' as the product name and 9.90 as its price.

[i4w_product_order prodid='36' tagid='123,234']
Attempt to process an order using information from product ID 36 but only if the user has ANY of the given tags, 123 *OR* 234.

[i4w_product_order prodid='36' tagid='123,234' require_all_tags='yes']
Attempt to process an order using information from product ID 36 but only if the user has ALL given tags, 123 *AND* 234.

[i4w_product_order prodid='36' excl_tagid='345,456']
Attempt to process an order using information from product ID 36 but only if the user has DOES NOT have ANY of the given tags, *NEITHER* 345 *NOR* 456.

<pre<[i4w_product_order prodid='36' tagid='123,234' require_all_tags='yes' excl_tagid='456,678'] Attempt to process an order using information from product ID 36 but only if the user has BOTH required tags, 123 or 234, but doesn't have ANY of the excluded tags, 456 *OR* 678.

[i4w_product_order prodid='36' merchantid='5']
Attempt to process an order using information from product ID 36 but use merchant ID 5 instead of the default merchant ID.

[i4w_product_order prodid='36' actionsuccess='17' actionfail='23']
Attempt to process an order using information from product ID 36. If the order is processed successfully, run action set # 17. If the process fails, run action set # 23.

[i4w_product_order prodid='36' urlsuccess='/buysomemore/' urlfail='/youbroke/']
Attempt to process an order using information from product ID 36. If the order is processed successfully, redirect to the /buysomemore/ page, else redirect to the /youbroke/ page.

[i4w_product_order prodid='36' deletefailed='yes']
Attempt to process an order using information from product ID 36. If the attempt fails, delete the incomplete ("orphaned") order.

Notes:

Upon redirection, the shortcode provides 2 GET parameters/value to inform about the status of the attempted transaction.

There are 10 errors codes which can be captured by the target page and used to provide more detailed information to the user.

Code Message
0 Order/payment was successfully processed
1 User not logged in
2 No valid credit card
3 No valid product data
4 No valid merchant ID
5 Product ID not valid
6 Invoice could not be created
7 Invoice item could not be added
8 Order/payment could not be processed at this time
9 Transaction prohibited due to missing required tags
10 Transaction prohibited due to excluded tags

API:

There is no API function equivalent for this shortcode.