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 Keap.
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.
[ELSE_product_order] conditional branching is NOT supported.
Shortcode nesting is NOT supported.
Parameters
| Parameter | Description | Default | Required |
|---|---|---|---|
| prodid | The product ID of the product that should be used as the basis for an order. | - | No (if prodname and prodprice are used) |
| prodname | An override for the product name. | - | No |
| prodprice | An override for the product price. | - | No |
| proddesc | An override for the product description. | - | No |
| prodqty | An override for the product quantity. | 1 | No |
| tagid | A single or comma separated list of tag ID's that a user must possess in order to complete an order. | - | No |
| require_all_tags | Modifies the use of the "tagid" parameter from having to match at least one to having to match all tags. | - | 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. | - | No |
| merchantid | Allows an alternate merchant ID to be specified. | - | No |
| leadaff | Specifies the Lead Affiliate who should get credit for this transaction. | - | No |
| saleaff | Specifies the Sale Affiliate who should get credit for this transaction. | - | No |
| actionsuccess | The action set ID to be executed upon successful processing of the order. | - | No |
| actionfail | The action set ID to be executed upon failed processing of the order. | - | No |
| urlsuccess | The URL to which to redirect users upon a successful purchase. | home page | No |
| urlfail | The URL to which to redirect users upon a failed purchase. | home page | No |
| deletefailed | Whether an "orphaned" (or incomplete) order is allowed to remain in Keap if the order failed. | yes | No |
Example
[i4w_product_order prodid='36']
[i4w_product_order prodid='36' prodprice='9.90']
[i4w_product_order prodname='AdHoc Product' prodprice='9.90']
[i4w_product_order prodid='36' tagid='123,234']
[i4w_product_order prodid='36' actionsuccess='17' actionfail='23']
[i4w_product_order prodid='36' urlsuccess='/buysomemore/' urlfail='/youbroke/']
Notes
Upon redirection, the shortcode provides 2 GET parameters to inform about the status of the attempted transaction.
Error codes:
- 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