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 11 months ago - 11 years 10 months ago #215703 by jodee.peevor
Hi

This is urgent because my client's site is due to go live on Monday but Im pregnant and my due date is tomorrow and I cant figure out the cb promotion to work how I want it.

I have a corporate membership subscription set up but there are criteria I need cb subs to calculate for us - the field "Company no of partners" will be completed during registration and if this is 5 then the membership will be £185 x 5 depending on how many partners within the company - up to a maximum cost of £3500.

The other issue we have is we need to display only certain membership subscriptions based upon selection in field - cb_category - eg theres one individual membership to show if they select solicitor/retired/trainee/foreign and theres one if they select barrister (its vatable) and theres one if they select student and then theres corp - city or corp - country if they choose sole practitioner/partnership and theres corp - chambers if they select chambers.

Thanks so much!

Jodee
Last edit: 11 years 10 months ago by krileon.

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 11 months ago #215714 by nant

jodee.peevor wrote: Hi

This is urgent because my client's site is due to go live on Monday but Im pregnant and my due date is tomorrow and I cant figure out the cb promotion to work how I want it.


wow - wishing you a great and successful time with your new family addition :cheer:

I have a corporate membership subscription set up but there are criteria I need cb subs to calculate for us - the field "Company no of partners" will be completed during registration and if this is 5 then the membership will be £185 x 5 depending on how many partners within the company - up to a maximum cost of £3500.


I assume the no-of-partners field is an integer? Please verify.

And I assume that the baseline price is 185 (and the promo will just add to it whatever is needed).

You would need to specify a CBSubs promotion (please study the CBSUbs manual as there are many examples) with the following specs:

- First you will need to install and publish the CB Query field plugin that is available in your Professional download area.

- Create a new query field (CB Field manager) that calculates your pricing algorithm and returns the extra price needed based on your no-of-partners cb field.

- Set the promotion (negative) discount value to get fixed promo price from a CB query field (you created in previous step)

If you need SQL help for the query field let us now (Kyle will have to assist here).

The other issue we have is we need to display only certain membership subscriptions based upon selection in field - cb_category - eg theres one individual membership to show if they select solicitor/retired/trainee/foreign and theres one if they select barrister (its vatable) and theres one if they select student and then theres corp - city or corp - country if they choose sole practitioner/partnership and theres corp - chambers if they select chambers.

Thanks so much!

Jodee


Also doable in your plan workflow tab where you can specify a CB field based criteria that must be met in order for a plan to be proposed as upgrade.

I think the REGEXP configuration here should do.

This is explained also in the CBSUbs manual.

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

11 years 11 months ago #215917 by jodee.peevor
Hi there
Thank for your good wishes ;)
Fortunately no change yet so I have time today to implement your plan - can I be a pain though and ask you provide a step by step to do list for both queries that is more detailed than the manuals because pregnancy brain has definitely kicked in this week and I honestly don't think I will be able to figure it all out in time ;) a quick implementation is what I desperately need help with. It also means that if i dont have time, my colleague who is not as cb savvy can simply follow your instructions in my absence. These two items are the last on my list and I can then relax and get ready for my imminent departure from work.
Your help is massively appreciated!
Jodee

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

11 years 10 months ago #215936 by jodee.peevor
I have sorted the membership plan displaying on conditional field value so thats one bit down - one to go.

I have one membership plan that is £185 if one is booked, but if multiple is booked it reduces to £98 times by the value in the field no of partners. Then a second membership plan which is simply £185 times by the value in the field no of partners. Your help with configuring these is greatly appreciated - I wait with bated breath!

Jodee

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 10 months ago #216001 by nant

jodee.peevor wrote: I have sorted the membership plan displaying on conditional field value so thats one bit down - one to go.

I have one membership plan that is £185 if one is booked, but if multiple is booked it reduces to £98 times by the value in the field no of partners. Then a second membership plan which is simply £185 times by the value in the field no of partners. Your help with configuring these is greatly appreciated - I wait with bated breath!

Jodee


Input from Kyle (who also wishes you well):

SELECT ( IF( ( 185 * `cb_field` ) >= MAX, MAX, ( 185 * `cb_field` ) ) ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

if you need the value as negative instead of positive then the below should work

SELECT ( ( IF( ( 185 * `cb_field` ) >= MAX, MAX, ( 185 * `cb_field` ) ) ) * -1 ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

cb_field should be substituted with your integer field that has number of partners in it.

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

11 years 10 months ago #216720 by jodee.peevor
I take it this is the algorithm for the cb query plugin?
My colleague is now going to sort this as Im happily baby-esconced. Your support is much appreciated, she may be in touch this week ;)

Jodee (and Poppy)

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

Moderators: beatnantkrileon
Powered by Kunena Forum