FoxyPress has a variety of functions and hooks available for you to tap into for customizing your store and how it displays or functions. Below we’ve outlined some of the basics and we’ve supplied a few tutorials on how to implement some cool things as well!
If you are looking for something that is not here or wish to add additional functionality, we’d love to hear from you so we can either develop it for you, or include your additional work into the next version.
All of the following can be found in the foxypress-helpers.php file in the FoxyPress plugin folder. Here are the functions and what they return or what they do.
Returns an array of all transactions placed by a specific user. This function is based upon the user’s email within wordpress matching the email address within foxy cart.
$user_email is the current logged in user’s email address. This must match with what is listed within Foxy Cart / their orders.
$type = ‘current’ or $type = ‘past’
Optionally you can grab all orders by not specifying the $type attribute and calling the function like this, foxypress_GetUserTransactions($user_email).
Array ( [id] => 1928062 [status] => Shipped [first_name] => John [last_name] => Doe [email] => firstname.lastname@example.org [tracking_number] => 123456789 [billing_address1] => 123 Some Street [billing_address2] => #2 [billing_city] => New York [billing_state] => New York [billing_zip] => 10001 [billing_country] => [shipping_address1] => 123 Some Street [shipping_address2] => #2 [shipping_city] => New York [shipping_state] => New York [shipping_zip] => 10001 [shipping_country] => [date] => 2010-08-21 15:29:02 [product_total] => 10.00 [tax_total] => 0.00 [shipping_total] => 0.00 [order_total] => 10.00 )
Returns an array of all items related to a specific transaction and each items associated custom options. Simply pass the transaction id returned by foxypress_ GetUserTransactions.
Array (  => Array ( [product_code] => TWL1 [product_name] => Towels [product_price] => 21.99 [product_options] => Array (  => Array ( [option_name] => Size [option_value] => 3.5x2 ) ) ) )
Returns true or false depending upon whether or not the user is an affiliate.
** See sample usage below.
Returns true or false depending upon whether or not the affiliate has referral capability.
** See sample usage below.
Returns an array of all affiliate statistics.
** See sample usage below.
Array ( [total_clicks] => 482 [total_referrals] => 50 [total_orders] => 100 [total_referral_paid_out] => 490.82 [total_paid_out] => 108.32 [referral_amount_due] => 15.61 [amount_due] => 840.67 [referral_commission] => $5.00 [commission] => 30% [affiliate_url] => http://demo.foxy-press.com/wp-content/plugins/foxypress/foxypress-affiliate.php?aff_id=1 [user_facebook_page] => http://www.facebook.com/XXX [user_age] => 38 [user_gender] => Male [avatar_name] => 0bf075df28827f75a132cccd2e90c60d [avatar_ext] => .jpg [open_orders] => Array (  => Array ( [order_id] => 8715192 [order_total] => 25.09 [affiliate_commission] => 5.00 [order_date] => 2012-04-12 12:48:50 [order_type] => Regular ) ) [paid_orders] => Array (  => Array ( [order_id] => 9388116 [order_total] => 404.20 [affiliate_payout] => $5 [affiliate_commission] => 5.00 [payment_method] => Paypal [payment_date] => 2012-04-12 [order_type] => Regular ) ) )
Array ( [id] => 10 [code] => 100107 [name] => SMILING BUDDHA RING [description] => Simple description here. [weight] => .5 [quantity] => 1 [quantity_max] => 0 [quantity_min] => 0 [price] => 52.00 [featured_image] => fp_bid6ew0ef_1.png [sale_price] => 50.00 [sale_start] => 2011-09-01 [sale_end] => 2011-09-30 [discount_quantity_amount] => [discount_quantity_percentage] => [discount_price_amount] => [discount_price_percentage] => [start_date] => 2011-09-01 [end_date] => 2011-09-30 [active] => 1 [sub_frequency] => 30d [sub_startdate] => 20110830 [sub_enddate] => 20120101 [downloadable] => [categories] => Array (  => Array ( [id] => 5 [name] => Most Popular [image] => http://www.yourstore.com/wp-content/inventory_images/fp_h9n1n5ctrp_5.jpg ) ) [images] => Array (  => Array ( [id] => 43 [name] => http://www.yourstore.com/wp-content/inventory_images/fp_8sxcvx5ap_10.png [order] => 99 ) ) [options] => Array (  => Array ( [id] => 4 [group_id] => 1 [group_name] => Type [text] => Small [value] => small [extra_price] => 0.00 [extra_weight] => 0.00 [code] => [quantity] => [active] => 1 [order] => 99 ) ) [attributes] => Array (  => Array ( [id] => 16 [text] => Brand [value] => Test Brand ) ) )
Returns an array of all your products, similar to the structure above.
Edit We now include a pagination object within the main set of objects returned.
[pagination] => Array ( [total_pages] => 1 [total_items] => 7 [current_page] => 1  => 999999 )
In addition the pagination, we allow for a parameter to be set to include products that are inactive/out of active date range or not.
Both of these functions will return an array of the same product objects above, so you the only additional step when using this would be looping through the main array of products.
This function returns an array of products based on a string value search term.
Array (  => Array ( [id] => 1 [name] => General [image] => http://www.yourstore.com/wp-content/inventory_images/ ) )
Simply returns the number of items for a specific category.
When building your own product page templates with our API, you will want to use the above functions to gather your data and present it correctly, but we've added some functions that will help build out your form so you don't have to worry about those details.
This will return the start of the form and should be at the start of any product area you are creating.
You will want to use this function at the very end of the product area.
Returns the price of your item with the proper currency symbol that you've set for your FoxyPress store.
We've created a tracking module that you can place on your pages to allow users to get the status of their order, based on what has been entered in the order management screens within FoxyPress admin. This is great for stores that use order status management and set tracking numbers for orders.
We've created custom paging for your store items. This function will return div enclosed paging based on the parameters specified.
Want to display to your users how many products have sold? Use this function and pass in the inventory ID to return the count.
This method returns a mini cart that can go in your sidebar, also available as a widget. You can also pass "true" for $dropdowndisplay and have the cart drop down near the top of your store if you don't want it in your sidebar.
This plugin is free and is continually updated/improved as we receive donations and project requests from our FoxyPress community. Please consider funding a project or donating to a tool you can customize....or at least buy us some coffee to keep us up late developing!