Skip to Content Skip to Menu

I Need Help with CBSubs for Multiple Service Purchases

  • jmaridon
  • jmaridon
  • OFFLINE
  • Posts: 49
  • Thanks: 8
  • Karma: 2
6 months 4 weeks ago #337870 by jmaridon
I've been using CBSubs for a while and I'd like to improve how I handle multiple service purchases for the same customer. Here's the issue:Currently, customers need a unique identifier (like a purchase order number) for each service they buy. I've been having them use this number as their username during registration, which creates duplicate profiles for the same email address (even though everyone warns against it).Ideally, I want:
  • Customers to register only once.
  • Customers to be able to purchase the same subscription multiple times, entering their unique identifier (PO number) each time.
  • To avoid creating 1000 separate plans even if a customer buys a subscription 1000 times.
  • To avoid setting up 1000 individual fields for the PO number; I just need one field per purchase.
  • Each purchased subscription to have its own unique identifier field.
Is this achievable with CBSubs?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48512
  • Thanks: 8286
  • Karma: 1444
6 months 4 weeks ago - 6 months 4 weeks ago #337879 by krileon
So you need some sort of unique number attached to the purchase not the profile? CBSubs doesn't currently support custom fields outside of coding an integration plugin to add one (e.g. like how CBSubs Options works). So that would be impossible if you've no coding experience.

The best no-code solution I could suggest is just to use a profile field for them to add their unique id to, but that would be attaching it to the profile and not necessarily the purchase. It might also be possible to add something pretty basic using CB Auto Actions, but would still require some degree of coding.

Additionally where is this subscription attached unique id meant to be displayed? In the invoice?

As for purchasing a plan multiple times that's already supported by either using Merchandise plans or under the "Workflows" tab adjust "Multiple subscriptions per user".


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.
Last edit: 6 months 4 weeks ago by krileon.
The following user(s) said Thank You: jmaridon

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

  • jmaridon
  • jmaridon
  • OFFLINE
  • Posts: 49
  • Thanks: 8
  • Karma: 2
6 months 3 weeks ago #337915 by jmaridon
I am actively seeking talent on upwork to code a plugin.

Each new parent subscription would likely need something like a registration form as well as a tab(s) added to the user's profile page.

Any additional suggestions that you might have would be appreciated.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48512
  • Thanks: 8286
  • Karma: 1444
6 months 3 weeks ago #337926 by krileon
A full form per subscription would be a pretty large undertaking as it'd basically mean adding custom fields to subscriptions, which we won't support until sometime in CB 3.x when fields have been redone to be generic (no longer hardcoded to profiles). You can essentially fake this to a degree by using CBSubs Options as a starting point and it maybe possible to do this entirely with CB Auto Actions, but you'll need to provide a lot more details about what type of fields and how many you need for me to give any suggestions using CB Auto Actions.

As for the tab what is it supposed to be displaying? You maybe able to get away with just displaying those fields in their active subscription description like CBSubs Options does otherwise CB Query Field might be able to accomplish this by querying for the attached subscription form data.


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.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48512
  • Thanks: 8286
  • Karma: 1444
6 months 3 weeks ago #337927 by krileon
I was able to put together a simple example that successfully renders a custom HTML input above the price of a plan and stores it into the basket. Below is that example.

Display:
Global
Triggers: onCPayBeforeDrawPlan
Type: Code
User: Automatic
Access: Everybody
Action
Method: HTML
Code:
Code:
<input type="text" name="planfields[[var1_id]][custom_field]" value="" />
Output
Display: Return

Save:
Global
Triggers: onCPayBeforeStorePaymentBasketUpdated
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
$paymentBasket = $variables['var1']; foreach ( $variables['var2'] as $paymentItem ) { $field = 'planfields.' . ( $paymentItem->plan_id ?? 0 ) . '.custom_field'; $paymentBasket->setParam( $field, $input->getString( $field, $paymentBasket->getParam( $field, '', 'integrations' ) ), 'integrations' ); }

This will render a per-plan unique text field and store it to the basket. This would then be possible to be retrieved later depending on usage needs it might be necessary to push that parameter into the subscription itself, but probably not necessary.

To limit what plans the field displays on you'd add a condition to the first auto action against the plan id as follows.

Field: Custom > Value
Custom Value: [var1_id]
Operator: Equal To
Value: PLAN_ID_HERE

I hope this will be a reasonable starting point for either you or a developer to implement what you're needing.


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.

  • jmaridon
  • jmaridon
  • OFFLINE
  • Posts: 49
  • Thanks: 8
  • Karma: 2
6 months 3 weeks ago #337931 by jmaridon
Thanks for the info! CBSubs Options sounds like a good fit as long as it can handle text fields.We currently have a registration form with 10 case-specific fields, a couple of which are text fields. However, on the backend, we manage cases and communicate with customers with 70+ additional fields specific to each case.My concern is that CBSubs Options might only allow one-time purchases. If a customer buys a plan and renews later, the unique text fields might be overwritten.A possible solution could be creating multiple upgrade plans instead of a single plan. This way, renewals wouldn't overwrite existing data.

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

Moderators: beatnantkrileon
Powered by Kunena Forum