Next revision | Previous revision |
v:0.6.0:getting_started:adding_links_and_forms [2010/08/10 00:32] – external edit 127.0.0.1 | v:0.6.0:getting_started:adding_links_and_forms [2017/04/26 07:02] (current) – external edit 127.0.0.1 |
---|
</a> | </a> |
</code> | </code> |
Note the ''foxycart'', class which opens our own version of Cody Lindley's [[http://jquery.com/demo/thickbox/|Thickbox]]. Also, ''%20'' may look scary, but it's just a URL Encoded space. You can put a space in instead, but your links won't be valid (X)HTML. If you're using [[http://www.modxcms.com/|MODx]], you can [[integration:modx:phx:rawurlencode|do this automatically]]. | Note the ''foxycart'', class which opens our own version of Cody Lindley's [[http://jquery.com/demo/thickbox/|Thickbox]]. Also, ''%20'' may look scary, but it's just a URL Encoded space. You can put a space in instead, but your links won't be valid (X)HTML. If you're using [[http://www.modxcms.com/|MODx]], you can [[:integration:modx:phx:rawurlencode|do this automatically]]. |
| |
| |
| |
==== Downloadable Products ==== | ==== Downloadable Products ==== |
Downloadable products are configured in the FoxyCart admin. The price, name, and code are all set there, so when adding a downloadable product you just need to pass in the ''code'' attribute and the ''category'' that you've configured as a downloadable category. More info about [[products:downloadable|selling downloadable products]] in FoxyCart. | Downloadable products are configured in the FoxyCart admin. The price, name, and code are all set there, so when adding a downloadable product you just need to pass in the ''code'' attribute and the ''category'' that you've configured as a downloadable category. More info about [[..:products:downloadable|selling downloadable products]] in FoxyCart. |
| |
==== Custom Attributes ==== | ==== Custom Attributes ==== |
Subscription products require v0.2.2+. Subscriptions with Tax and Shipping require v0.5.0+. Stores using multiship do not currently support future subscription taxes. | Subscription products require v0.2.2+. Subscriptions with Tax and Shipping require v0.5.0+. Stores using multiship do not currently support future subscription taxes. |
| |
<note warning>Subscriptions and recurring billing are more involved than non-recurring billing. Please ensure you have thoroughly reviewed [[products:subscriptions|the subscription notes]] to ensure your gateway will work with FoxyCart's subscription processing system.</note> | <note warning>Subscriptions and recurring billing are more involved than non-recurring billing. Please ensure you have thoroughly reviewed [[..:products:subscriptions|the subscription notes]] to ensure your gateway will work with FoxyCart's subscription processing system.</note> |
| |
* **sub_frequency:** Frequency of subscription. This is //required// for (and defines a product as) a subscription. The format is ''DDx'' or ''Dx'' where ''D'' is a number and 'x' is a unit of time. Possible values include: | * **sub_frequency:** Frequency of subscription. This is //required// for (and defines a product as) a subscription. The format is ''DDx'' or ''Dx'' where ''D'' is a number and 'x' is a unit of time. Possible values include: |
* ''DD'' = Example: ''10'' = will run on the 10th of this month or the 10th of next month if today's date is after the 10th. | * ''DD'' = Example: ''10'' = will run on the 10th of this month or the 10th of next month if today's date is after the 10th. |
* ''D'' = Same as ''DD''. | * ''D'' = Same as ''DD''. |
* **sub_token:** (v050+) Unique URL per subscription for loading your subscription up into a cart and modifying it's contents. Very useful when used in conjunction with the ''redirect'' feature as you can load up a customer's subscription and then redirect them back to your product page so they can add something to it. Make sure you read the [[products:subscriptions#allowing_customers_to_update_cancel_their_own_subscriptions|additional notes about how the ''sub_token'' works]]. | * **sub_token:** (v050+) Unique URL per subscription for loading your subscription up into a cart and modifying it's contents. Very useful when used in conjunction with the ''redirect'' feature as you can load up a customer's subscription and then redirect them back to your product page so they can add something to it. Make sure you read the [[..:products:subscriptions#allowing_customers_to_update_cancel_their_own_subscriptions|additional notes about how the ''sub_token'' works]]. |
* **sub_cancel:** (v050+) Set this value to "true" along with using the ''sub_token'' to let a customer cancel their subscription. This will set the end date on the subscription to tomorrow. | * **sub_cancel:** (v050+) Set this value to "true" along with using the ''sub_token'' to let a customer cancel their subscription. This will set the end date on the subscription to tomorrow. |
* **sub_enddate** (v050+) Useful for setting an end date on a subscription. NOTE: As of v051, the ''sub_enddate'' parameter affects //all// subscriptions in a cart. Accepts YYYYMMDD formatted dates. This parameter should be set to a date //after// the date you want the last transaction in the subscription to run. For example, if you have a monthly subscription starting on January 1st, 2010 that is supposed to run for six months and then stop, set ''sub_endate'' to 20100602 (June 2nd, 2010) so that the transaction on June 1st is not cancelled by the end date. | * **sub_enddate** (v050+) Useful for setting an end date on a subscription. NOTE: As of v051, the ''sub_enddate'' parameter affects //all// subscriptions in a cart. Accepts YYYYMMDD formatted dates. This parameter should be set to a date //after// the date you want the last transaction in the subscription to run. For example, if you have a monthly subscription starting on January 1st, 2010 that is supposed to run for six months and then stop, set ''sub_endate'' to 20100602 (June 2nd, 2010) so that the transaction on June 1st is not cancelled by the end date. |
Session attributes are //not emailed//. If you need these values in an email you'll need to: | Session attributes are //not emailed//. If you need these values in an email you'll need to: |
* Grab the value from the JSON on the checkout, and populate your own custom field with it so it becomes part of the checkout. This could be useful as well if you want the user to be able to update their information on checkout. (If you don't, you could make it a hidden input, so long as it is inside the checkout's ''form'' element.) | * Grab the value from the JSON on the checkout, and populate your own custom field with it so it becomes part of the checkout. This could be useful as well if you want the user to be able to update their information on checkout. (If you don't, you could make it a hidden input, so long as it is inside the checkout's ''form'' element.) |
* Create your own email receipt script using the [[docs:datafeed|XML datafeed]]. | * Create your own email receipt script using the [[..:docs:datafeed|XML datafeed]]. |
| |
| |
* ''**redirect**=path/to/file.ext''. (v0.4.0+) Immediately redirect the user to a page on cart load, such as ''&redirect=index.html''. | * ''**redirect**=path/to/file.ext''. (v0.4.0+) Immediately redirect the user to a page on cart load, such as ''&redirect=index.html''. |
* **NOTE:** The value of the ''redirect'' parameter will be prefixed with your store URL domain, as specified in your store settings. So if your store domain is example.com, you can only redirect back to example.com. This is to prevent potential phising attacks. Also, (prior to 041), you'll have to remove class="foxycart" on your forms and links using this method to avoid redirecting within the thickbox. Also, don't use cart=checkout along with the redirect feature as it will take you to the checkout instead of redirecting you. | * **NOTE:** The value of the ''redirect'' parameter will be prefixed with your store URL domain, as specified in your store settings. So if your store domain is example.com, you can only redirect back to example.com. This is to prevent potential phising attacks. Also, (prior to 041), you'll have to remove class="foxycart" on your forms and links using this method to avoid redirecting within the thickbox. Also, don't use cart=checkout along with the redirect feature as it will take you to the checkout instead of redirecting you. |
* ''**output**=json''. (v0.4.0+) Specify the output format. Possible values are ''html'' (default) and ''json'', which will load the [[docs:json|JSON cart object]]. | * ''**output**=json''. (v0.4.0+) Specify the output format. Possible values are ''html'' (default) and ''json'', which will load the [[..:docs:json|JSON cart object]]. |
* **NOTE:** In v0.4.0 the ''cart=view'' parameter must be passed along with ''output=json'' in order for JSON to display. | * **NOTE:** In v0.4.0 the ''cart=view'' parameter must be passed along with ''output=json'' in order for JSON to display. |
* **JSONP** support is available as well. If ''output=json'' then the optional ''callback'' parameter is supported as well. | * **JSONP** support is available as well. If ''output=json'' then the optional ''callback'' parameter is supported as well. |