Hmm... I need to find out myself. I don't know what is the answer to that question. I'll do some poking around and get back to you if I got an useful answer. You should email the people at iPage as they probably know..
OK, this is the progres I have made:.
1. I added this lovely box with the radio buttons to select to pay in full or just a deposit on the checkout_payment page..
2. I stuck this code in checkout_confirmation.php.
If (!tep_session_is_registered('deposit')) tep_session_register('deposit');.
if (isset($HTTP_POST_VARS['deposit'])) $deposit = $HTTP_POST_VARS['deposit'];.
So now I have my variable "deposit" saved away. I have no idea if this was the best way to do it or not. I'm just grasping at straws..
3. I added a column to the orders table to indicate whether they want to pay a deposit or in full. For now it is a decimal value and I am planning on storing 100 in it..
4. I created a new order total module for the deposit. For now it is just a copy of the total module. I want to modify it to show a deposit of $100 on the order confimation page ONLY if the user has selected to pay the deposit..
I'm stuck on how to write out the fact that the user is paying a deposit to the database. I looked at the order class but don't really see where the variables are set. I want to check on the radio button value that I stored away using tep_session_register and if it is YES then I want to store 100 in the deposit column of the order table. Then in my deposit order total module I want to check to display the value if not = 0..
How do I write this value out to the database? And when is the actual record created in the orders table? Do I need to store it somewhere else beforehand?.
Can someone help me with this? Come on guys, I've almost got it. I just need a little help..
Btw-in a previous post I mentioned something about it being important not to charge the users credit card for the full amount when they have selected to pay just the deposit. Actually in our case, we will be processing the cc by hand - it won't go through any payment gateway. I just need to note on the order and invoice that they are paying $100 instead of the total..
If you process the payments by hand, you could do it with 2 order total modules. Call the one something like "deposit" and the other something like "ramaining balance". Place them in the sort order below the toal module..
Then you can either display them all the time or only when the checkbox is checked..
Call them something l this:.
Case 1, box is checked:.
Total xxx.xx $.
Deposit 100.00 $.
Balance owing yyy.yy $.
Case 2 (optional).
Total xxx.xx $.
Paid xxx.xx $.
Balance owing 000.00 $.
I would most likely skip the second and just don't display the 2 modules..
Put in a conditional check for the checkbox post variable in the 2 modules and only display them when the box is checked. Make sure you carry them forward throughout the pages. The best would be, to add it to the order class and then check in there. But that's a little bit advanced programming..
I just wrote a module "customs charges" for ms3-cvs (but should also work for ms2) which just adds a specified amount to the total if placed before the total display. This might helps you to get the 2 modules. I can email them to you if want. Just pm me with your email address..
I definitely need to store whether or not they selected to pay just the deposit in the database so it will show up on the invoice etc..
I have a pretty good grip on how to write the order total module. I've already created one for the deposit and it installs and shows up everywhere. I was also think about adding another one for the remaining balance, as you mentioned..
I haven't put in the logic to check for the deposit or not because I don't know how to store it..
I need help in how to add the deposit variable to the order class and store it in the database. I've already changed the query method of the order class to fish it out. I just need help in storing it..
If you have it in the order total module, it will display in the invoice exactly the way it's stored. It just doesn't store it in the order table, it stores it in the order_total table..
As I mentioned before, if you touch the order class and DB, there is a lot of code involved. This will give you a lot of headache down the road if you want to upgrade to a new version (and you should see my head right now, trying to upgrade stores to the newest CVS). And it appears to me, that it is not absolutely necessary. I would do it, if I automatically want to charge the $ 100 with a cc module but if you do that manually, the order_total is pretty flexible. Just try to print an invoice in admin with your current module. It should be there..
Just noticed that you store the new variable as a session variable. So you have access all over the checkout process. I've done similar stuff before and I can't think of anything causing trouble. Just don't forget to destroy it when the user logs of or after the order is processed..
Thanks Gunter!!! You're absolutely right. I've got it stored as a session variable so I can use that to load or not the "deposit" and "remaining balance" order total modules and they will be saved to the order_totals table. Hip hip hurrah!.
I should have this working in no time..
Thanks again. You are my hero!..
Any chance we can get a look at your code mods. I am also looking at taking deposits so this is exactly what I've been looking for.
Background - I'm setting up oscommerce for enrollment in courses at a school. I need to offer the possibility of paying either the full amount of all the courses selected and any accommodations or just a flat deposit of $100 now matter how many courses they've selected nor what the total due is. If they choose to pay the deposit, they would owe the balance when they arrive for the courses - to b paid in person. So I don't have to keep up with payments, just need to note that they've payed $100 and owe NNN (total minus 100)..
I added this lovely box to the checkout_payment.php page where they can click on a radio button to select to pay either the deposit or their total..
Now I somehow need to tie these radios into the rest of the system. If they select to pay just the deposit, I need to store that in the database but also the total for the order. But only charge their credit card $100 (very important).
I'd like to note all this on the confirmation page, on the email that gets sent out, etc..
I am hoping for an output on the confirmation page something like (example of $550 worth of courses):.
Billing Address (edit) Amount Paid $100.
John Doe Balance due upon arrival $450.
123 Elm St..
Maybe I need to add a deposit column to the database (?orders table?) and edit the order total module to display something like the above..
Does it sound like I'm going in the right direction?.
Does anyone want to give a desperate newbie a hand?.
Or maybe it is the orders_total table that I want to change..
(btw-my formatting in the previous post didn't turn out the way I expected but I hope you get the idea)..