Add To Cart Custom
Use our Forums to find examples and answers to your questions. If you have advanced requirements for your project, contact us and our staff can help you find a solution.
Add To Cart Custom Tag
Name: foxee:addtocart_custom
The addtocart custom tag provides a method of creating custom shopping cart forms into your templates.
{exp:foxee:addtocart_custom id="{entry_id}" block_foxybox="yes"}
Parameters
id="33"
Description: The entry Id of the product you want to use in the addtocart form. If used inside the weblog:entries tag, you can pull it dynamically by using {entry_id}
Required: Yes
Default: none
disable="related_products"
Description: You can disable certain features of the addtocart tag. Separate each by using the pipe ( | ) character.
Required: no
Default: none
Possible values: related_products, custom_fields, pricing_options, discounts, product_limit_quantity
number_format="0"
Description: Determines the number of decimal places for your price. A setting of 2 will produce standard money formatting of $4.00
Required: no
Default: 2
Possible values:
empty="yes"
Description: This will empty the foxycart before placing the product in.
Required: no
Default:
Possible values: yes, no
cart="checkout"
Description: Changes the form action to view the cart, go straight to the checkout form or go to the updateinfo form.
Required: no
Default: view
Possible values: view, checkout, updateinfo
category="shipping"
Description: Sets the category to use for the product.
Required: no
Default: Whatever the products settings are
Possible values:
block_foxybox="no"
Description: This will essentially block the display of FoxyBox when product is added. This is very useful when using the cart tag to show your cart contents dynamically.
Required: no
Default: no
Possible values:
discount_id="1"
Description: This will apply a discount that is setup in the FoxEE CP Discounts section. The value is the id of the discount.
Required: no
Default:
Possible values:
Conditionals
foxee_custom_fields
Description: TRUE if the product has custom fields associated to it; FALSE if not
foxee_pricing_options
Description: TRUE if the product has pricing options associated to it; FALSE if not
foxee_donation
Description: TRUE if product is a donation; FALSE if not
foxee_quantity_pulldown
Description: TRUE if the product has a limited quantity amounts to choose from; FALSE if not
foxee_quantity_field
Description: TRUE if the product has no limit to quantity purchased; FALSE if not
Variables
The foxee:addtocart_custom tag variables
foxee_donation_field_label
Description: The donation field label
foxee_donation_field_name
Description: The donation field name
foxee_quantity_field_name
Description: The quantity field name
foxee_quantity_field_value
Description: The quantity value
Variable Pairs
foxee_custom_fields
Description: Used to loop through the custom fields to show that are associated to a product.
Variable Pair foxee_custom_fields Conditionals
field_is_text
Description: TRUE if the custom field is a text field; FALSE if not
field_is_select
Description: TRUE if the custom field is a selector field; FALSE if not
field_is_raw
Description: TRUE if the custom field is a raw type; FALSE if not
field_name
Description: TRUE if the custom field name; FALSE if not
field_value
Description: TRUE if the custom field name; FALSE if not
Variable Pair foxee_custom_fields Variables
field_name
Description: The field name of the custom field
field_value
Description: The field value of the custom field
Variable Pair foxee_custom_fields select variable pair
foxee_options
Description: Use this variable pair to display the select values
Conditionals
foxee_option_value
Description: The value of the selector
foxee_option_name
Description: The name of the selector
Variables
foxee_option_value
Description: The value of the selector
foxee_option_name
Description: The name of the selector
Variable Pair foxee_pricing_options select variable pair
foxee_pricing_options
Description: Use this variable pair to display the select values
Conditionals
foxee_option_value
Description: The value of the selector
foxee_option_name
Description: The name of the selector
Variables
foxee_option_value
Description: The value of the selector
foxee_option_name
Description: The name of the selector
foxee_option_inventory
Description: The inventory of the option.
Example
{exp:foxee:addtocart_custom id="22"}
{if foxee_custom_fields}
{foxee_custom_fields}
{if field_is_text}
<label for="{field_name}">{field_label}</label>
<input type="text" name="{field_name}" value="{field_value}" />
{/if}
{if field_is_raw}
{field_value}
{/if}
{if field_is_select}
<label for="{field_name}">{field_label}</label>
<select name="{field_name}">
{foxee_options}
<option value="{foxee_option_value}">{foxee_option_name}</option>
{/foxee_options}
</select>
{/if}
{/foxee_custom_fields}
{/if}
{if foxee_pricing_options}
{foxee_pricing_options}
<label for="{field_name}">{field_label}</label>
<select name="{field_name}">
{foxee_options}
<option value="{foxee_option_value}"{if foxee_option_inventory == "0"} disabled="disabled"{/if}>{foxee_option_label}</option>
{/foxee_options}
</select>
{/foxee_pricing_options}
{/if}
{if foxee_donation}
<label for="{foxee_donation_field_name}">{foxee_donation_field_label}</label><input type="text" name="{foxee_donation_field_name}" value="" />
{/if}
<label for="{foxee_quantity_field_name}">Quantity</label>
{if foxee_quantity_field}
<input type="text" name="{foxee_quantity_field_name}" value="1" />
{/if}
{if foxee_quantity_pulldown}
<select name="{foxee_quantity_field_name}">
{foxee_options}
<option value="{foxee_option_value}">{foxee_option_name}</option>
{/foxee_options}
</select>
{/if}
<p><input type="submit" name="submit" value="Add To Cart" /></p>
{/exp:foxee:addtocart_custom}
