Hello Guys,
I would like to customize and create different submit based on input from edit field. What I'm trying to accomplish is the following:
1. List of edit field values and respective form submit parameters. There is also definition of default parameters.
2. Payment page, with submit button and edit field saying "coupon".
3. If user doesn't enter value in the field, the user is directed to a payment page with default parameters.
4. If user enters value, it is compared against the list of predefined pairs. If there is a match, the respective form parameters are used. If there is no match, the default form parameters are used.
Is there a way to accomplish this with the available drupal modules?
Thank you for your time.
Regards,
Ivan
Comments
I typed "coupon" under
I typed "coupon" under search downloads and found http://drupal.org/project/uc_coupon.
Steve, This module is
Steve,
This module is tightly coupled with ubercart and I don't want to install and setup this huge framework just to use the coupon system. I'm looking for simpler solution something along the lines of CCK, computed field to accomplish this. Is it possible?
from what you say in your
from what you say in your op, it's not just a coupon system but also a payment system (which gets tricky regarding the handling of sensitive financial data). There are a couple of standalone payment modules floating around you might look at for ideas, but with the advent of ecommerce and ubercart those appear to be abandoned or nearly so.
That said, I'm sure it's possible-- computed fields can handle anything you can code with php. but don't fool yourself, accepting payments & processing coupons are not simple functionality-- the single lm_paypal.module file is over 1200 lines iirc (and that's just one file in the module).
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Joann, Thank you for your
Joann,
Thank you for your reply. Here is how I intend to use this functionality. I will have different <form>...</form> blocks related to specific coupon code. These blocks will be generated by the PayPal Create Button wizard, with "secured" option turned-on. The solution will be secure enough for my needs. What I need is two somehow setup the form submit based on the input in an edit field.
This should simple to accomplish I think. I wonder what should I look for? I did review the computed field, but I'm not sure how it could help me.
hmmmm, interesting approach.
hmmmm, interesting approach. it's been a while since i manually coded any html forms the old fashioned way, but couldn't you do something that simply reads a text field (doesn't need to be a cck computed field afaik) and then does a switch statement based on the coupon code that jumps to the code for that particular form?
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Can you provide a more
Can you provide a more detailed description?
This is pseudo code so you
This is pseudo code so you won't be able to type it into a php page and have it work, but it should give you the general idea:
If you want this to appear on the same form as the node the user is currently editing (and not another node), then actually yes, you'd have to put this into a computed field. The one fly in the ointment is I'm not sure when the coupon field gets it value-- that is, if someone types their coupon code into the couponcode field is that value available to your code immediately or does the node have to be submitted before you can reference the value of that field for the switch statement.
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Thank you Joann. I have
Thank you Joann. I have followed your concept and I've got it working.
Regards,
Ivan
excellent-- you're
excellent-- you're welcome!
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz