Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount! Get 20% off now with code SPOOKY-2024!

[SOLVED] Multi-user subscription calculated using CB Promotions + based upon criteria in fields

11 years 10 months ago #217185 by jodee.peevor
I think we need some help -

two formulas needed that add markup to subscription base price -

1. £185 base price if quantity 1 in cb field cb_mempartners but £98 if more than 1 in cb field cb_mempartners up to max £3500
2. £185 times by quantity in cb_mempartners up to max £3500

Please can you review the formulas above and reply again asap?

Thanks so much!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 10 months ago - 11 years 10 months ago #217192 by krileon
Please understand we can't keep providing you with custom queries; this is outside the scope of support. If you should need any further queries please contact a developer that is experienced with SQL to write them for you. The queries as follows will output the results you're wanting.

Positive Value Returned:
Code:
SELECT ( IF( `cb_field` = 1, 185, IF( ( 98 * `cb_field` ) > `cb_maxsubs`, `cb_maxsubs`, ( 98 * `cb_field` ) ) ) ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

Negative Value Returned:
Code:
SELECT ( ( IF( `cb_field` = 1, 185, IF( ( 98 * `cb_field` ) > `cb_maxsubs`, `cb_maxsubs`, ( 98 * `cb_field` ) ) ) ) * -1 ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

Simply place in a query field then review a profile to ensure the output is correct. You'd then apply this field as a promotion to adjust the price. Note use the negative or positive return depending on how you intend to use it (negative return should increase the price).

Edit: Forgot to add the maximum amount check.


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: 11 years 10 months ago by krileon.
The following user(s) said Thank You: nant

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

11 years 10 months ago #217199 by jodee.peevor

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

11 years 9 months ago #218838 by jodee.peevor
Hiya

Ive set this up but it isnt working - please can you review for me? I'll PM you login ;)

Thanks Jodee

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #218843 by krileon
Please review my message regarding this in my previous post. If you need us to configure something for you then you need to review our by the hour services on the Membership tab of your profile. We only review as included with support in cases of bugs.


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.

11 years 9 months ago #218849 by jodee.peevor
Hiya
I don't need custom help or bug fixing I just don't know how to work your system cos the manual isn't comprehensive. Please can you review these steps and let me know where I'm going wrong?
1. cb_maxsubs - integer field not visible to user with default value 3500
2. cb_noofpartners - integer field for user to enter number into during registration
3. cb_cityinvoice and cb_countryinvoice - query field with your code in (city is £185 times by cb_noofpartners field value and country is £185 if cb_noofpartners is 1 or £98 if cb_noofpartners is more than one - both codes are set to max 3500 which is the value in cb_maxsubs field. These two query fields are set to show as read only but they don't appear where they should.
4. Two promotions set up relying on fixed field value of cb_cityinvoice or cb_countryinvoice applied to the four subscriptions (city chambers, country chambers, city partnership and country partnership
Test either and they just show £185 in end confirmation screen rather than the calculation.
Please can you review for me? I've PMd login info
Thanks Jodee

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

Moderators: beatnantkrileon
Powered by Kunena Forum