A free points management plugin for WordPress.
myCRED Logo
myCRED Logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download
    Navigation
    • Loading navigation ...
    All Shortcodes
    myCRED shortcodes
    1. mycred_affiliate_id
    2. mycred_affiliate_link
    3. mycred_all_scratch_cards
    4. mycred_badges
    5. mycred_badges_progress
    6. mycred_best_user
    7. mycred_buy
    8. mycred_buy_form
    9. mycred_buy_pending
    10. mycred_chart_balance_history
    11. mycred_chart_circulation
    12. mycred_chart_gain_loss
    13. mycred_chart_history
    14. mycred_chart_instance_history
    15. mycred_chart_top_balances
    16. mycred_chart_top_instances
    17. mycred_content_buyer_avatars
    18. mycred_content_buyer_count
    19. mycred_content_sale_count
    20. mycred_email_subscriptions
    21. mycred_exchange
    22. mycred_give
    23. mycred_hide_if
    24. mycred_history
    25. mycred_hook_table
    26. mycred_leaderboard
    27. mycred_link
    28. mycred_list_ranks
    29. mycred_load_coupon
    30. mycred_lotteries
    31. mycred_lottery
    32. mycred_lottery_jackpot
    33. mycred_lottery_quickpick
    34. mycred_lottery_results
    35. mycred_lottery_winnings
    36. mycred_my_badges
    37. mycred_my_balance
    38. mycred_my_balance_converted
    39. mycred_my_rank
    40. mycred_my_ranking
    41. mycred_my_ranks
    42. mycred_my_ranks_progress
    43. mycred_my_transfer_fee
    44. mycred_paymentwall
    45. mycred_pending_transfers
    46. mycred_rank_progress
    47. mycred_sales_history
    48. mycred_scratch_cards
    49. mycred_scratch_cards_remaining
    50. mycred_scratch_history
    51. mycred_sell_this
    52. mycred_sell_this_ajax
    53. mycred_send
    54. mycred_show_if
    55. mycred_stripe_buy
    56. mycred_stripe_subscribe
    57. mycred_stripe_subscription
    58. mycred_total_balance
    59. mycred_total_points
    60. mycred_total_since
    61. mycred_transfer
    62. mycred_users_of_all_ranks
    63. mycred_users_of_rank
    64. mycred_video
    Categories
    Filter by category
    1. Actions
    2. Classes
    3. Filters
    4. Functions
    5. Hooks
    6. Objects
    7. Shortcodes
    8. Template Tags
    Chapters
    Documentation
    1. Chapter I - Introduction
    2. Chapter II - Getting Started
    3. Chapter III - Add-ons
    4. Chapter IV - Premium Add-ons
    5. Chapter V - For Developers
    6. Chapter VI - Reference Guides
mycred_stripe_subscribe

Codex / mycred/purchase / Shortcodes / mycred_stripe_subscribe

Description

This shortcode allows you to setup subscription buttons which triggers the Stripe Checkout window. Requires the buyCRED Stripe Gateway add-on to be enabled.

The shortcode has two different modes:

  • Subscribe Mode – This default mode is shown for anyone who views the shortcode and does not have a subscription. In this mode, clicking on the button will trigger the Stripe Checkout Window.
  • Cancel Mode – If the user viewing this shortcode already has a subscription, this button will turn into a “Cancel Subscription” button. Clicking on this button will cancel a users current point subscription.

Requires the buyCRED add-on to be enabled along with the buyCRED Stripe add-on to be installed and enabled.

Available since version 2.0

Shortcode Attributes
Attribute Type Required Default Description
planid string Yes - The unique ID you set for the Subscription Plan you want users to to join when clicking on this button. The ID is case sensitive and the button will not work if you do not set this attribute!
cancel string No "Cancel Subscription" Button label to show when this shortcode is viewed by someone who are already signed up to the subscription plan this shortcode is setup for. Set to empty if you want to hide this button in these cases.
switch string No "Switch to %plan_name%" Button label to show when this shortcode is viewed by someone who already has a subscription and could switch to the subscription plan this shortcode is setup for. Set to empty if you want to hide the button in these cases. (Requires version 2.0.1 or higher.)
to string or int No - Option to gift subscription to a specific user. Points given for the subscription plan the user signs up for will be deposited into this users account.
logo string No - Option to set a custom logo for the Stripe Checkout window. If not set, the default logo URL you set in your gateway settings is used.
title string No - Option to set a custom title for the Stripe Checkout window. If not set, the default title you set in your gateway settings is used.
desc string No - Option to set a custom description for the Stripe Checkout window. If not set, the default description you set in your gateway settings is used.
label string No - Option to set a custom button label for the Stripe Checkout window. If not set, the default button label you set in your gateway settings is used.
classes string No btn btn-primary btn-lg The button classes used.
id string No - Option to set an ID for the button element.
CSS Styling
// The button
button.mycred-stripe-subscribe-button { }
Examples

Example 1: Most basic usage example where users will be able to signup for a subscription plan with the ID of baseplan.

[mycred_stripe_subscribe planid="baseplan"]Base Plan Subscription[/mycred_stripe_subscribe]

Example 2: Allows users to signup to the subscription plan myplan. When viewed by someone already having a subscription it will show a custom cancel button label.

[mycred_stripe_subscribe planid="myplan" cancel="Downgrade Account"]Upgrade Account[/mycred_stripe_subscribe]

Example 3: Allows users to signup to the subscription plan myplan. When viewed by someone with a different active subscription, hide this button.

[mycred_stripe_subscribe planid="myplan" switch=""]Upgrade Account[/mycred_stripe_subscribe]
0

About myCred

myCred is a free, open-source and developer friendly points management tool for WordPress powered websites.

Download Rate Plugin

Documentation

  • Add-ons
  • Core Shortcodes
  • F.A.Q.
  • Tutorials
  • Third Party Plugins
  • Code Snippets

Support

  • Product Licenses
  • Customization
  • Support Forums
  • Plugin Changelog
  • Contact

Copyright 2013 - 2021 by WPExperts; All rights reserved. myCred is licensed under GPL 2.0

Terms & Conditions • Use of Cookies • Store Policy • Community Rules

Suggest Codex Example

You can submit suggestions for codex examples that you have available as a public gist. If you are a member on the mycred.me website, you can earn Tokens for each submission. To claim these Tokens, make sure you provide your mycred.me username.

Please make sure the example you submit is relevant and if you include documentation, it's provided in English.

logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download