latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Quantity selector that will change the price.

Home Forums Community Forum Quantity selector that will change the price.

This topic contains 6 replies, has 3 voices. Last updated by  Mike (Volunteer Moderator) 3 years, 5 months ago.

Topic Author Topic
Posted: Sunday Jul 14th, 2013 at 12:30 pm #53427

What is the best way to do a Quantity Selector that will change the price dynamically.
I offer a service that screens candidates for clients for a set fee i.e $100.
I would like to create a dropdown where the user can select the number of candidates they would like to screen and the price for that membership will change dynamically.
Is that possible???

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Sunday Jul 14th, 2013 at 3:52 pm #53440
Eduan
Username: Eduan
Moderator

Hello Steve,

This is possible with a little hack. You will need to use a MU plugin for this. I did have a post in the past about this, but not anymore. Let me remember…

Ah now I remember, basically the MU plugin was constantly checking for a certain value in the URL, for example something like ?price=100. Using the GET variable if I remember right… Haven’t used PHP in a while.

It’s a little long to explain so I’ll just give you a link:
http://www.primothemes.com/forums/viewtopic.php?f=4&t=16566&p=59040#p59040

It’s a little different from what I’m talking, but it gives you a good guideline. :)

– Eduan

Posted: Sunday Jul 14th, 2013 at 4:44 pm #53444

Thank you for your quick response especially on a Sunday.
I did some research and found this post which I think would probably do the job. http://www.primothemes.com/forums/viewtopic.php?f=4&t=6172

I have some small experience with html and form variables but I am not 100% sure how to implement that though.
So based on that thread I would create a dropdown selector in the packages page and when users make a selection I would pass that variable to the page with the S2member Pro form and use the hooks to update the final price?

Can you explain how to pass that variable. Do I have to pass it with the url i.e. “domain.com/signup?qty=20” with some php/javascript or will the variable “qty” be forwarded/hidden to the next page when the form is submitted.

Thank you in advance

Posted: Sunday Jul 14th, 2013 at 10:15 pm #53453
Eduan
Username: Eduan
Moderator

Glad you got it. :)

Can you explain how to pass that variable. Do I have to pass it with the url i.e. “domain.com/signup?qty=20″ with some php/javascript

That is correct. The idea is that you put it in the URL, and the MU plugin will be constantly checking for that variable, when it finds it it will generate the output of a button using that variable as the price, and it will redirect the user to the output URL, thus making it look like the user just clicked the button and magically the button used the amount the user set. :)

– Eduan

Posted: Friday Jul 19th, 2013 at 11:12 am #53690

I followed the instructions from here http://www.primothemes.com/forums/viewtopic.php?f=4&t=6172

it calculates correctly the price and displays it on the description but I get this error
“Invalid form configuration. Missing “ra” attribute. The Regular Amount. Must be >= 0.01.”

I am using a specific page/post buy now. Does it matter?

Thank you in advance

Posted: Friday Jul 19th, 2013 at 2:15 pm #53692

~ AUTO-GENERATED NOTICE TO SUPPORT REPS

Action taken: I posted a private contact form and referenced this Topic.

Posted: Thursday Aug 1st, 2013 at 10:24 pm #54702
Moderator
FYI: The latest release of s2Member® Pro comes with a new feature called “Checkout Options” that might save you some trouble with things like this.

Please see: s2Member® Unified Changelog » v130801

Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.