iThemes Exchange
for developers
Simple ecommerce for WordPress
Where do you jump in?
How is Exchange Organized
● /lib
How is Exchange Organized
● /lib
● /api
How is Exchange Organized
● /lib
● /api
● /core-addons
How do I register an add-on?
exchange-addon-stripe/exchange-addon-stripe.php
How do I generate a settings page?
exchange-addon-stripe/exchange-addon-stripe.php
How do I generate a settings page?
exchange-addon-stripe/lib/addon-settings.php
How do Products & Product Types
work?
● All Exchange products are a single WP
post_type
● Product Features are tied to pro...
ithemes-exchange/lib/products/class.products-post-type.php
One WP post_type
How do Products & Product Types work?
Admin UI is Reactive
How do Products & Product Types work?
How do I register a Product Type?
Product Types are
an add-on category
How do I register a Product Type?
exchange-addon-membership/exchange-addon-membership.php
Product Types are
an add-on cate...
What are Product Features?
product_feature all the things!
ithemes-exchange/lib/product-features/
How do Product Features work?
product_feature all the things!
ithemes-exchange/lib/product-features/class.downloads.php
ho...
How do Product Features work?
product_feature all the things!
ithemes-exchange/lib/product-features/
How do Product Features work?
Use the Abstract
Class to create
Product Features
How do Product Features work?
ithemes-exchange/lib/product-features/class.inventory.php
See the inventory
product feature ...
How do Product Features work?
product_feature all the things!
ithemes-exchange/lib/product-features/
Why use our Product Feature class?
● it_exchange_product_supports_feature()
● it_exchange_product_has_feature()
● it_excha...
How do I use a Product Feature?
product features API
ithemes-exchange/api/theme/products.php
How do Exchange Pages work?
How do Exchange Pages work?
Pages have 1-3 options: Exchange, WordPress,
Disabled
How do I register an Exchange
page?
ithemes-
exchange/lib/api/pages.php
How does templating work?
We have #alot of template-parts
ithemes-exchange/lib/templates/
http://hyperboleandahalf.blogspo...
How does templating work?
Standard Templating Components
ithemes-exchange/lib/templates/content-store.php
How does templating work?
Top Level v. Loops v. Elements ( all template-
parts )
ithemes-exchange/lib/templates/content-lo...
How does templating work?
Top Level v. Loops v. Elements ( all template-
parts ) Elements are usually extremely small chun...
There are 3 ways increasingly complex ways to alter output
1. WordPress Hooks ( multiple hooks in every template part )
o ...
1) WordPress Hooks (simple)
How should I modify the templates?
ithemes-exchange/lib/templates/content-registration/element...
2) Overwriting template parts in your theme (moderately difficult)
How should I modify the templates?
ithemes-exchange/lib...
2) Overwriting template parts in your theme (moderately difficult)
How should I modify the templates?
ithemes-exchange/lib...
2) Overwriting template parts in your theme (moderately difficult)
How should I modify the templates?
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/api/t...
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/lib/t...
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/lib/t...
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
Exchange looks...
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
Exchange looks...
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
3) Inserting /...
How should I modify the templates?
3) Inserting / deleting / rearranging ( difficult but powerful )
ithemes-exchange/core-...
How should I modify the templates?
3) Inserting / deleting / rearranging ( difficult but powerful )
before after
How does the Theme API work?
it_exchange( ‘context’, ‘tag’, $options );
ithemes-exchange/api/theme/
How does the Theme API work?
it_exchange( ‘context’, ‘tag’, $options );
ithemes-exchange/api/theme/product.php
it_exchange...
How does the Theme API work?
it_exchange( ‘context’, ‘tag’, $options );
ithemes-exchange/api/theme/product.php
it_exchange...
How does the Theme API work?
Prefixes
ithemes-exchange/api/theme/product.php
it_exchange( ‘product’, ‘get-description’);
i...
How does the Theme API work?
A couple examples
ithemes-exchange/lib/templates/super-widget-cart.php
iThemes Exchange
for developers
Upcoming SlideShare
Loading in …5
×

iThemes Exchange for Developers

1,468 views

Published on

Learn Theme & Add-on Development for Exchange - Free Webinar July 26th with lead dev Glenn Ansley.

iThemes Exchange, our free ecommerce plugin, is the easiest way to get your clients selling online with WordPress.

iThemes Exchange lead developer Glenn Ansley gives an overview of Exchange, including a walk-through of the API so that you can create custom (or premium) add-ons and themes.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,468
On SlideShare
0
From Embeds
0
Number of Embeds
132
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

iThemes Exchange for Developers

  1. 1. iThemes Exchange for developers
  2. 2. Simple ecommerce for WordPress
  3. 3. Where do you jump in?
  4. 4. How is Exchange Organized ● /lib
  5. 5. How is Exchange Organized ● /lib ● /api
  6. 6. How is Exchange Organized ● /lib ● /api ● /core-addons
  7. 7. How do I register an add-on? exchange-addon-stripe/exchange-addon-stripe.php
  8. 8. How do I generate a settings page? exchange-addon-stripe/exchange-addon-stripe.php
  9. 9. How do I generate a settings page? exchange-addon-stripe/lib/addon-settings.php
  10. 10. How do Products & Product Types work? ● All Exchange products are a single WP post_type ● Product Features are tied to product types ● Admin UI is reactive to the registered types o Setup Wizard o Sidebar o Add / Edit products
  11. 11. ithemes-exchange/lib/products/class.products-post-type.php One WP post_type How do Products & Product Types work?
  12. 12. Admin UI is Reactive How do Products & Product Types work?
  13. 13. How do I register a Product Type? Product Types are an add-on category
  14. 14. How do I register a Product Type? exchange-addon-membership/exchange-addon-membership.php Product Types are an add-on category
  15. 15. What are Product Features? product_feature all the things! ithemes-exchange/lib/product-features/
  16. 16. How do Product Features work? product_feature all the things! ithemes-exchange/lib/product-features/class.downloads.php hooked to it_exchange_enabled_addons_loaded
  17. 17. How do Product Features work? product_feature all the things! ithemes-exchange/lib/product-features/
  18. 18. How do Product Features work? Use the Abstract Class to create Product Features
  19. 19. How do Product Features work? ithemes-exchange/lib/product-features/class.inventory.php See the inventory product feature as example of abstract implementation.
  20. 20. How do Product Features work? product_feature all the things! ithemes-exchange/lib/product-features/
  21. 21. Why use our Product Feature class? ● it_exchange_product_supports_feature() ● it_exchange_product_has_feature() ● it_exchange_update_product_feature() ● it_exchange_get_product_feature() ● it_exchange_add_feature_support_to_product_type() ● it_exchange_remove_feature_support_for_product_type() ● it_exchange_product_type_supports_feature() ● it_exchange_get_registered_product_features() It exposes your feature to all these API functions ithemes-exchange/api/product-features.php
  22. 22. How do I use a Product Feature? product features API ithemes-exchange/api/theme/products.php
  23. 23. How do Exchange Pages work?
  24. 24. How do Exchange Pages work? Pages have 1-3 options: Exchange, WordPress, Disabled
  25. 25. How do I register an Exchange page? ithemes- exchange/lib/api/pages.php
  26. 26. How does templating work? We have #alot of template-parts ithemes-exchange/lib/templates/ http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at- everything.html
  27. 27. How does templating work? Standard Templating Components ithemes-exchange/lib/templates/content-store.php
  28. 28. How does templating work? Top Level v. Loops v. Elements ( all template- parts ) ithemes-exchange/lib/templates/content-login.php Loops are template-parts too but their primary job is to call additional (but related) template-parts. ithemes-exchange/lib/templates/content-login/loops/fields.php TopLevelLoop
  29. 29. How does templating work? Top Level v. Loops v. Elements ( all template- parts ) Elements are usually extremely small chunks of HTML ithemes-exchange/lib/templates/content-login/loops/fields.phpLoop ithemes-exchange/lib/templates/content-login/elements/username.php Element
  30. 30. There are 3 ways increasingly complex ways to alter output 1. WordPress Hooks ( multiple hooks in every template part ) o Ideal for quick additions to non-distributed code 2. Overwriting individual template parts in your theme o Ideal for theme authors or clients that have highly customized themes and may need some custom CSS classes, etc. 3. Inserting, removing, rearranging template parts with the templating API o Ideal for add-on developers and clients that may enable additional add-ons without you in the future. How should I modify the templates?
  31. 31. 1) WordPress Hooks (simple) How should I modify the templates? ithemes-exchange/lib/templates/content-registration/elements/email.php
  32. 32. 2) Overwriting template parts in your theme (moderately difficult) How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php themes/twentythirteen-child-exchange/exchange/content-store/elements/featured-image.php
  33. 33. 2) Overwriting template parts in your theme (moderately difficult) How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php themes/twentythirteen-child-exchange/exchange/content-store/elements/featured-image.php Exchange looks for the template-parts in the following locations by default 1. [child-theme]/exchange/ 2. [parent-theme]/exchange/ 3. ithemes-exchange/lib/templates/
  34. 34. 2) Overwriting template parts in your theme (moderately difficult) How should I modify the templates?
  35. 35. 3) Inserting / deleting / rearranging ( difficult but powerful ) How should I modify the templates? ithemes-exchange/api/template-parts.php
  36. 36. 3) Inserting / deleting / rearranging ( difficult but powerful ) How should I modify the templates? ithemes-exchange/lib/templates/content-login/loops/fields.php ithemes-exchange/api/template-parts.php
  37. 37. 3) Inserting / deleting / rearranging ( difficult but powerful ) How should I modify the templates? ithemes-exchange/lib/templates/content-login/loops/fields.php ithemes-exchange/api/template-parts.php
  38. 38. How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php Exchange looks for the template-parts in the following locations by default 1. [child-theme]/exchange/ 2. [parent-theme]/exchange/ 3. ithemes-exchange/lib/templates/ 3) Inserting / deleting / rearranging ( difficult but powerful )
  39. 39. How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php Exchange looks for the template-parts in the following locations by default 1. [child-theme]/exchange/ 2. [parent-theme]/exchange/ 3. locations added via the ‘it_exchange_possible_template_paths’ filter 4. ithemes-exchange/lib/templates/ 3) Inserting / deleting / rearranging ( difficult but powerful ) ithemes-exchange/lib/functions/template-functions.php
  40. 40. How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php 3) Inserting / deleting / rearranging ( difficult but powerful ) ithemes-exchange/core-addons/taxes/taxes-simple/init.php filters generated inside it_exchange_get_template_part_loops()
  41. 41. How should I modify the templates? 3) Inserting / deleting / rearranging ( difficult but powerful ) ithemes-exchange/core-addons/taxes/taxes-simple/init.php
  42. 42. How should I modify the templates? 3) Inserting / deleting / rearranging ( difficult but powerful ) before after
  43. 43. How does the Theme API work? it_exchange( ‘context’, ‘tag’, $options ); ithemes-exchange/api/theme/
  44. 44. How does the Theme API work? it_exchange( ‘context’, ‘tag’, $options ); ithemes-exchange/api/theme/product.php it_exchange( ‘product’, ‘found’); it_exchange( ‘product’, ‘description’);
  45. 45. How does the Theme API work? it_exchange( ‘context’, ‘tag’, $options ); ithemes-exchange/api/theme/product.php it_exchange( ‘product’, ‘baseprice’, array( ‘before’ => ‘<p>’, ‘after’ => ‘</p>’ ) );
  46. 46. How does the Theme API work? Prefixes ithemes-exchange/api/theme/product.php it_exchange( ‘product’, ‘get-description’); it_exchange( ‘product’, ‘has-description’); it_exchange( ‘product’, ‘supports-description’); it_exchange( ‘product’, ‘description’); // prints the description // returns a boolean // returns a boolean // returns the description
  47. 47. How does the Theme API work? A couple examples ithemes-exchange/lib/templates/super-widget-cart.php
  48. 48. iThemes Exchange for developers

×