Page 1 of 1

Question online-shop

Posted: Tue May 22, 2007 3:57 pm
by Think Pink
Hello, I have a question for those of you who have created an online shopping store

Basicly after a user has chosen his products he confirmes the order and a page will open where he is asked about the delivery options
* delivery to a user spcified address
* get the product from the shop headquarters

After this another page opens and he is asked about payment methods
* payment order (not shure how to say it in english, but is what companies use most often)
* cash
* credit card online

The question is how do you store those infos about paymnet methods.
I mean you have a table where site admin can create new payment methods? in other words dinamic or ... (* see few lines bellow)

But if so, how do you take care of the actions to be followed.

For example if a user choses delivery to a certain address and as payment method "cash" then the transporter would get the money from the user and will have to calculate a certain fee for the value of the products.

What if the user choses to pick the produs from shop headquarters and payment by cash. Then no fee is calculated.

But if the user choses payment by card then a new page will open where he is asked to complete the card details.

And last payment order nothing happens, just the payment method is registered in the database. For the others payment as well the method is registered in db.

... * (continued) or you make static forms like (see below)

Code: Select all

if(($_POST['payment'] == 'cash') && ($_POST['transport'] == 'user_address')) {
// execute function to calculate the fee for transport and for picking up the value of rpoducts
// then add the payment method into db
}
elseif(($_POST['payment'] == 'cash') && ($_POST['transport'] == 'headquarters')) {
// add the payment method into db and no other taxes apply
}
elseif(($_POST['payment'] == 'credit_card') && ($_POST['transport'] == 'user_address')){
// go to the page where users enters card details and calculate the transport fee without fee for picking up the money
// then add the payment method into db
}
elseif(($_POST['payment'] == 'credit_card') && ($_POST['transport'] == 'headquarters')){
// go to the page where users enters card details but no transport fee apply
// then add the payment method into db
}
elseif(($_POST['payment'] == 'payment_order') && ($_POST['transport'] == 'user_address')){
// add the payment method into db and calculate the transport fee without fee for picking up the money
}
elseif(($_POST['payment'] == 'payment_order') && ($_POST['transport'] == 'headquarters')){
// add the payment method into db and no other taxes apply
}
Thx in advance