Atari ST fan
Posts: 8
56 credits Members referred : 0
« Reply #2 on: Feb 20, 2007, 02:38:49 PM »
in place to have a buttom to calculate price * quantity, by line of products (when i want to change quantity) , i want to have only one button which calculate all quantity*price for all shopping.
it's better when you have many quantities products change
do you unterstand more ?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 credits Members referred : 374
in place to have a buttom to calculate price * quantity, by line of products (when i want to change quantity) , i want to have only one button which calculate all quantity*price for all shopping.
it's better when you have many quantities products change
do you unterstand more ?
this is not possible in most of the shopping carts if this is only to raie the amount on one page you should try some javascript code
Mine works the same as db_cart but all I want to do is have a unit price and total for each $row of db_cart_btn_only.php.
Please help.
Deb
Atari ST fan
Gender:
Posts: 7
46 credits Members referred : 0
Let's code!
« Reply #6 on: Jun 17, 2007, 11:00:26 AM »
It would be great if you could post how you worked this out for other users. I would have just used javascript, but if PHP can/will do it - I'd like to try it next time I have the need (which could be any day).
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 credits Members referred : 374
It's time to use PHP5!
« Reply #7 on: Jun 17, 2007, 12:20:41 PM »
I guess there is no other way than some Ajax function to calculate the (new) price without refreshing the page
Total Zero
Posts: 5
30 credits Members referred : 0
« Reply #10 on: Jun 25, 2007, 04:26:22 PM »
I guess I don't understand because $val('quantity) is in db_cart example.php where this code is. What I did was just took the $val("quantity) out of the table and installed it in the label section above.
What I want it to do is like the checkout have it to do update per line and also give you the total of the line or row.
Deb
Total Zero
Posts: 5
30 credits Members referred : 0
« Reply #11 on: Jun 29, 2007, 05:38:00 PM »
I have the db_cart example.php having an update button and recalculating like the checkout. The only thing is that when you first enter the different number in the update button it brings up another product line with no info on it with $0 price with the same quantity you entered in the update button. How do I get it so it doesn't bring up another product line?
The changes I made was in the db_cart example: I added after new db_cart: // update a single order row if (isset($_POST['add']) && $_POST['add'] == "Update") { $myCart->update_row($_POST['row_id'], $_POST['quantity']); }