Freelance
Fixed $25
TBD
Feb 10, 2015
Hi everyone! I have a job that will be perfect for a PHP developer...
See below example code. Currently, I am grouping my web products in groups of three per buy button. There are 3 radio buttons that display the cost of each item. To make a purchase, the user selects one of the three radio buttons and clicks the buy button. There is a different payment URL associated to each radio button, and when they click the buy button, the user is sent to the selected radio button's URL. These payment URLs are not special, they are simply a particular web address that I prefer to keep private. For testing purposes, you can substitute any website (google, yahoo, etc).
The standard three radio button set-up works perfect, but I now need to incorporate coupon codes. The way my payment system works is that each product has its own unique payment URL (as described above). For coupons, there is a standard coupon form with an input box and submit button. When the user types in the coupon code, it posts the code to one particular web address at my payment system's URL. It also posts a specific product number (which is set as one of the values in the coupon form). So, in summary, normally to use a coupon with my payment system, I would need to set up one form per product, and this form posts the coupon code input by the user and the product id number to one specific web address. The system then checks the code, and validates it or not.
What I would like is to combine the current three radio button buy selection with the option to use a coupon code BUT I do not want the coupon code to have a separate submit button. And since products are grouped in three, I want only one coupon code box per three products. This is where the PHP comes in. You might see it differently, but basically I see it as a few nested IF statements. The first level would be to check if there is a coupon code typed in the box by the user. If the coupon code box is blank, basically do nothing and the radio buttons should function as they currently do. But if there is something typed into the coupon code box, it needs to submit that code to the product number of the selected radio button, and the Buy button should be used as the submit button (there should be no separate coupon submit button). Therefore, I believe each radio button needs to have a second value (the product number) embedded in it that can be used for the coupon submit, but am unsure how to do this. I am ok with manually setting each of these product number values myself.
Please see below example code. I only need ONE working example written by you. I do want to keep the site address private, so please ask questions, but I believe this is strictly a coding job and I will test the final version you provide.
Thanks, I look forward to your responses!
Biagio
-----------------------------------------------------------------------
****The below script goes in the header****
-------------------------------------------------------------------------
****The below is one payment table example that goes in the body****