Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

(if Total = $0) { still allow normal checkout process

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-28-2006, 10:51 AM
 
gfiebich gfiebich is offline
 

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

Default (if Total = $0) { still allow normal checkout process

I have a site that offers most of its merchandise for free with free shipping. When a customer checks out with a $0 total, they go directly from the Cart View to the Order Confirmation - skipping the Payment Method and Order Review pages altogether. Where is the logic that causes this located? I'd like to disable it so that my customers can still review their ship-to information and enter order notes.
thanks,
Glen

p.s. This is in X-cart 4.0.16 gold
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #2  
Old 05-11-2006, 06:40 AM
 
gfiebich gfiebich is offline
 

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

Default

Here's the mod from X-cart tech support:

Code:
Please open cart.php and replace in the file } elseif($mode=="checkout" && empty($paymentid) && !func_is_cart_empty($cart) && $cart["total_cost"] == 0) { x_session_unregister('paypal_begin_express'); func_header_location($current_location."/payment/payment_offline.php"); with #} elseif($mode=="checkout" && empty($paymentid) && !func_is_cart_empty($cart) && $cart["total_cost"] == 0) { # x_session_unregister('paypal_begin_express'); # func_header_location($current_location."/payment/payment_offline.php");

The code is slightly different in 4.0.13, so just look for the elseif with ["total_cost"] == 0 and comment out that statement.

-Glen
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #3  
Old 05-11-2006, 06:43 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

moved to custom mods
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #4  
Old 05-11-2006, 06:59 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default

Thanks for sharing that, I have a client who uses his cart just for quoting and we had trouble with it missing out the payment step as of course there isn't any payment for a zero totalled order. Hopefully this will help solve it.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #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
  #6  
Old 05-18-2006, 09:22 AM
 
eastman eastman is offline
 

Advanced Member
  
Join Date: Aug 2005
Location: Wyoming
Posts: 74
 

Default

Thanks for the great post. I was hoping someone could help me out with a problem I am having expanding on this mod. I want to run the credit cards through authorize.net. It returns a failed process, but that's fine since we will be processing these numbers manually later. I want to bypass the cc_processing error for the customer and provide a short message instead. I decided to do this on error_message.php in the root directory.

I created a tmp file : skin1/main/error_ccprocessor_error1.tpl
It contains the message I want to post for the customer in the event of this particular error. Here"s how I'm going about it. This is the modified snippet from error_message.php.

Code:
$billmessage = $_GET['bill_message']; if ($billmessage = "bill_message=Error%3A+A+valid+amount+is+required.+%28Reason+Code+5+%2F+Sub+1%29"){ $error1 = $error . "1"; $smarty->assign("main",$error1); } else{ if (!empty($error)){ $smarty->assign("main",$error); } else{ $smarty->assign("main",$QUERY_STRING); } }

I'm getting a "Page Not Found or Do not have permission" message where the tmp file should show up when I try to run this page. Hope this is clear.
Thanks for any help you can offer.
__________________
X-Cart Pro v4.4.3
Reply With Quote
  #7  
Old 10-19-2010, 07:16 AM
 
careyst careyst is offline
 

Newbie
  
Join Date: Sep 2010
Posts: 4
 

Default Re: (if Total = $0) { still allow normal checkout process

Would anyone have code to allow having a downloadable item available for free in version 4.4.1? Want to have them register, but then just go to download page and skip credit card validation step.
__________________
4.4.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:02 AM.

   

 
X-Cart forums © 2001-2020