[SOLVED] CBSubs variable pricing plan based on other fields

11 years 9 months ago - 11 years 9 months ago #207343 by D1on
We have a client with variable membership pricing and need to know how to use CBSubs to updated the Subscription Plan pricing based on other CB fields at registration.

e.g.
Base CBSubs Plan price is $55.00
Client enters a $ value in a field called GVP, e.g. $150,000.00
Another field calculates the GVP field x 0.035%
Then this total amount (from these two fields) is added to the CBSubs Subscription Plan base pricing.

Is this possible with CB and CBubs?

Please Log in to join the conversation.

11 years 9 months ago #207359 by krileon
In order to adjust prices based off a field value you'll need to use CBSubs Promotions. This will apply a coupon to the purchase (positive or negative) to adjust the price.

Based off your needs you'd set the plan price to 55. You'd then use maybe a query field to combine Field A and Field B (GVP x XYZ). You'd then set a fixed amount promotion and substitute in that field (maybe able to use fixed amount from a field, haven't tested so may not work with query field if pulled from user object). This should do the trick to give you dynamic pricing based off fields.


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 to join the conversation.

11 years 9 months ago #207451 by D1on
OK, I have installed the Promotions Plugin (and the Tax Plugin) and can't get the Promotions plugin to work when the promotion is "A fixed amount from a CB field" and the Promotions plugin setting for "CB Field containing amount" is set to a Query field that has (cb_gvp x cb_035) as the query. I have also tried cb_gvp x 0.035% as the Query that also doesn't work.

The Promotions Plugin does work with simple settings, but I can't get it to work with Query fields and selecting A fixed amount from a CB field.

I have attached a few screen shots of the CB fields and Promotions plugin setting.

Can you please help resolve this issue?
Attachments:

Please Log in to join the conversation.

11 years 9 months ago #207491 by krileon
Your query field is not valid. Believe you misunderstood me explaining its usage. You supply to it a database query and it outputs the results of the query. Example as follows.
SELECT ( `cb_gvp` * `cb_035` ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

Check the field on the users profile to confirm it's outputting correctly.


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 to join the conversation.

11 years 9 months ago #207533 by D1on
Thanks, I tried that, but now getting the following error:

500 - JDatabaseMySQLi::query: 1054 - Unknown column 'cb_035' in 'field list' SQL=SELECT ( `cb_gvp` * `cb_035` ) FROM

`j25_comprofiler` WHERE `id` = '341'


Looks like this won't work as cb_035 is a Query field.

All we need to do is multiply cb_gvp by 0.035% and add this calculated amount to the Cart as attached.

Is there another query that I can use for this or another method that works?
Attachments:

Please Log in to join the conversation.

11 years 9 months ago #207572 by krileon
Why is cb_035 a query field? I don't understand. You said you had 2 user field values you need to combine. At any rate if it's a query field you'd just do the below.
SELECT ( `cb_gvp` * '[cb_035]' ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

Below will also work.
SELECT ( `cb_gvp` * 0.035 ) FROM `#__comprofiler` WHERE `id` = '[user_id]'


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.183 seconds

Facebook Twitter LinkedIn