View Single Post
  #5  
Old 05-11-2006, 08:57 PM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default

The mod above is really only half of what I want:

Quote:
If $0 total, Checkout button sends the customer directly to the Payment Details review screen WITH a default payment method automatically selected.

I've finally poked and prodded at cart.php long enough to sort out the solution (done in x-cart gold 4.0.13).

In /cart.php find:

Code:
} elseif($mode=="checkout" && empty($paymentid) && !func_is_cart_empty($cart) && $cart["total_cost"] == 0) { func_header_location($current_location."/payment/payment_offline.php");

and comment it out like this:

Code:
# } elseif($mode=="checkout" && empty($paymentid) && !func_is_cart_empty($cart) && $cart["total_cost"] == 0) { # func_header_location($current_location."/payment/payment_offline.php");

Next, find:

Code:
if (count($payment_methods) == 1) func_header_location("cart.php?paymentid=".$payment_methods[0]["paymentid"]."&mode=checkout");

and paste this below it:

Code:
if ($cart["total_cost"] == 0) func_header_location("cart.php?paymentid=8&mode=checkout");

EDIT BEGIN - code needed for x-cart 4.0.19

Finally, find:
Code:
if (!$is_valid_paymentid)
and replace it with:
Code:
if ((!$is_valid_paymentid) && ($paymentid != 8)) {
EDIT END

I've used paymentid=8 which is C.O.D. My store doesn't need C.O.D. so I've changed the language fields so it displays as "FREE". In the admin, make sure you have your C.O.D./FREE payment method unchecked - so that it doesn't display along with the other payment methods for $ purchases.

Here's a list of the other standard payment methods and IDs:
Quote:
1 = Credit Card
2 = Purchase Order
4 = Phone Ordering
5 = Personal Check
7 = Money Order
8 = C.O.D.
9 = Business Check
10 = Wire Transfer
11 = Government Check
12 = Traveler's Check
13 = Fax Ordering
14 = Gift Certificate
16 = Check

That's it! I hope this is useful to some of you.

-Glen
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote