Skip to Content Skip to Menu

🐰 Happy Easter! Great Savings on Professional and Developer Memberships! Get 20% off now with code EASTER-2026!

Get option value from plan and insert in to field

  • wintercorn
  • wintercorn
  • OFFLINE
  • Posts: 205
  • Thanks: 21
  • Karma: 2
1 month 2 weeks ago #343384 by wintercorn
Replied by wintercorn on topic Get option value from plan and insert in to field
That works great. 

I've changed the code slightly to truncate to two decimal places to allow to odd amounts when upgrading. Pasted here for others reference.

SELECT TRUNCATE(p.`rate`, 2)
FROM `#__cbsubs_subscriptions` AS s
JOIN `#__cbsubs_payment_items` AS p
ON p.`subscription_id` = s.`id`
WHERE s.`user_id` = '[user_id]'
AND s.`plan_id` = 16
ORDER BY s.`id` DESC
LIMIT 1

 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 50285
  • Thanks: 8609
  • Karma: 1470
1 month 2 weeks ago #343386 by krileon
Ok, a new CBSubs build release is now available expanding the available substitutions from the CBSubs Content Plugin. The following are now available.

Subscription Formatted Price: [cbsubs:subscriptions plan="PLAN_ID" output="price" /]
Subscription Formatted Rate: [cbsubs:subscriptions plan="PLAN_ID" output="rate" /]
Subscription Rate: [cbsubs:subscriptions plan="PLAN_ID" output="rate_number" /]
Subscription Formatted First Rate: [cbsubs:subscriptions plan="PLAN_ID" output="first_rate" /]
Subscription First Rate: [cbsubs:subscriptions plan="PLAN_ID" output="first_rate_number" /]

The above can grab current plan pricing, renewal pricing, or upgrade pricing for an existing subscription for the provided plan id. This will include the adjusted price from CBSubs Options. I've also completely updated the "cbpaidsubsbot" description in System > Manage > Plugins > cbpaidsubsbot > Description with a much easier to understand syntax guide with multiple examples.

So you can either continue using CB Query Field or switch to these. It's entirely up to you as either should be fine.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: wintercorn

Please Log in or Create an account to join the conversation.

  • wintercorn
  • wintercorn
  • OFFLINE
  • Posts: 205
  • Thanks: 21
  • Karma: 2
1 month 2 weeks ago #343388 by wintercorn
Replied by wintercorn on topic Get option value from plan and insert in to field
You are a genius. I wish other extension devs would respond as quickly and as helpfully as this.

I'll update my custom profile to use this now.

Thanks
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

  • wintercorn
  • wintercorn
  • OFFLINE
  • Posts: 205
  • Thanks: 21
  • Karma: 2
1 month 2 weeks ago #343402 by wintercorn
Replied by wintercorn on topic Get option value from plan and insert in to field
OK, same question but for a different site.

How do I get the gateway name/ID and coupon usage in to a field for use in a user list?

Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 50285
  • Thanks: 8609
  • Karma: 1470
1 month 2 weeks ago #343407 by krileon
There's no substitution for those. You'd have to use a CB Query Field for that. Is there a reason you need this information as a field? They should be able to see all relevant payment details in their invoices that CBSubs provides for them. We even have per-payment invoices as well now for recurring subscriptions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • wintercorn
  • wintercorn
  • OFFLINE
  • Posts: 205
  • Thanks: 21
  • Karma: 2
1 month 2 weeks ago - 1 month 2 weeks ago #343409 by wintercorn
Replied by wintercorn on topic Get option value from plan and insert in to field
It's for a client report. They want to see who has used a coupon code and which one and how they paid. I was thinking of showing it as fields in a CB list along with the fee paid which I already have.

(I'm trying to avoid them wandering around the backend and potentially breaking something)
Last edit: 1 month 2 weeks ago by wintercorn. Reason: more words

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum