Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#26 09-23-2007 08:46:06

PinkPanther
Member
From: USA
Registered: 07-11-2003
Posts: 216

Re: "Pending Payment" versus Incomplete Orders

dh783 wrote:

Code:

     foreach ($orders as $num => $order) {

          $link = $this->link_namespace($app,'ordersummary',array('ref' => $order['id']));

          print '<tr class="khxc_sorttable">' . $eol;

          print '<td class="khxc_sorttable">';
          print '<a href="' . $link . '" title="Review Order ' . $this->xhtml_encode($order['id']);
          print '">View Order</a></td>';

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['id']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['date']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['status']) . '</td>' . $eol;

          if ($recur) {print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['recurtotal']) . '</td>' . $eol;}

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['ordertotal']) . '</td>' . $eol;

          print '</tr>' . $eol;

     } // End of foreach statement.

to

Code:

     foreach ($orders as $num => $order) {

if ($order['status'] != 'Not Completed') {

          $link = $this->link_namespace($app,'ordersummary',array('ref' => $order['id']));

          print '<tr class="khxc_sorttable">' . $eol;

          print '<td class="khxc_sorttable">';
          print '<a href="' . $link . '" title="Review Order ' . $this->xhtml_encode($order['id']);
          print '">View Order</a></td>';

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['id']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['date']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['status']) . '</td>' . $eol;

          if ($recur) {print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['recurtotal']) . '</td>' . $eol;}

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['ordertotal']) . '</td>' . $eol;

          print '</tr>' . $eol;

} // End of if statement.

     } // End of foreach statement.

John

Hi John,

I just implemented this mod and it works great. I had an issue with the last } // End of if statement - gave me an error, so I removed it to look like below:


Code:

     foreach ($orders as $num => $order) {

if ($order['status'] != 'Not Completed') {

          $link = $this->link_namespace($app,'ordersummary',array('ref' => $order['id']));

          print '<tr class="khxc_sorttable">' . $eol;

          print '<td class="khxc_sorttable">';
          print '<a href="' . $link . '" title="Review Order ' . $this->xhtml_encode($order['id']);
          print '">View Order</a></td>';

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['id']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['date']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['status']) . '</td>' . $eol;

          if ($recur) {print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['recurtotal']) . '</td>' . $eol;}

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['ordertotal']) . '</td>' . $eol;

          print '</tr>' . $eol;

} // End of foreach statement.

and it works fine now.

For people that have not tried this mod yet - this puts all unfinished orders (orders that have not gone through the payment process) as not completed under Home > ClickCartPro > Commerce: Orders and Checkout > Manage Online Orders (Completed and Processing)

From there, you can view it and delete it. As far as I can see, the customer does not even see it under his/her account.

Awesome mod - thank *you* for . Now I do not have to wait yet another 6 months to get my cart up and running! roll

Kay

Offline

 

#27 09-24-2007 07:58:52

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: "Pending Payment" versus Incomplete Orders

Kay

I am happy that you got the mod to work but just looking at what you posted to get it to work doesn't look right since you show to open brackets ({) and only one closeing one in that foreach statement. You have to have another closing bracket after what you posted.

John

Offline

 

#28 09-24-2007 19:02:45

PinkPanther
Member
From: USA
Registered: 07-11-2003
Posts: 216

Re: "Pending Payment" versus Incomplete Orders

dh783 wrote:

Kay

I am happy that you got the mod to work but just looking at what you posted to get it to work doesn't look right since you show to open brackets ({) and only one closeing one in that foreach statement. You have to have another closing bracket after what you posted.

John

Hi John,

Here is the whole thing:


    if ($order['status'] != 'Not Completed') {

          $link = $this->link_namespace($app,'ordersummary',array('ref' => $order['id']));

          print '<tr class="khxc_sorttable">' . $eol;

          print '<td class="khxc_sorttable">';
          print '<a href="' . $link . '" title="Review Order ' . $this->xhtml_encode($order['id']);
          print '">View Order</a></td>';

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['id']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['date']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['status']) . '</td>' . $eol;

          if ($recur) {print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['recurtotal']) . '</td>' . $eol;}

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['ordertotal']) . '</td>' . $eol;

          print '</tr>' . $eol;

} // End of foreach statement.

     print '</table>' . $eol . $eol;

} // End of if statement.

?>

All works fine for me and that makes me a happy camper - thank you again smile

K

Offline

 

#29 09-24-2007 21:00:10

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: "Pending Payment" versus Incomplete Orders

Kay

Could you post your entire script, I still think there is something out of place.

John

Offline

 

#30 09-25-2007 06:49:44

PinkPanther
Member
From: USA
Registered: 07-11-2003
Posts: 216

Re: "Pending Payment" versus Incomplete Orders

dh783 wrote:

Kay

Could you post your entire script, I still think there is something out of place.

John

Hi JOhn,

If it is working, what could be out of place? LOL, I am just happy that something worked :-) Ok here is the whole code:

<?php

$app      = $this->globals('khxc_display.app');
$eol      = $this->globals('khxc.eol');
$orders   = $this->globals('ecom.order_listing');
$ovlink   = $this->link_namespace($app,'accountover',array());

// +--
// | Handle empty order arrays (the user has no orders).
// +--

if (empty($orders)) {

     print '<p>There are no online orders available for review associated with your ';
     print 'account.  When you place an order using our online store, all orders are ';
     print 'stored here for your review.  Please visit this page again after you have ';
     print 'placed an order.</p>' . $eol . $eol;

     print '<p><a href="' . $ovlink . '" title="Account Overview">';
     print 'Click here for your account overview.</a></p>' . $eol;

// +--
// | We've got orders.  List them.
// +--

} else {

     // +--
     // | Get a count of all of the orders and figure out whether there
     // | are recurring charges in any of them.
     // +--

     $count = 0;
     $recur = 0;

     foreach ($orders as $num => $order) {

          if (!(empty($order['hasrecur']))) {$recur++;}

     if ($order['status'] != 'Not Completed') {

          $count++;

} // End of if statement.

     } // End of foreach statement.

     // +--
     // | Print a header.
     // +--

     print '<p>There are ' . $count . ' online orders available for review associated ';
     print 'with your account.  Please review the listing below.  Orders are presented with ';
     print 'the most recent orders at the top of the listing.  To view all of the information ';
     print 'for an order, track packages (if tracking information has been made available) and ';
     print 'to view a printable version of the order, click the \'View Order\' link next to the ';
     print 'order for which you would like more information.</p>' . $eol . $eol;

     print '<div class="khxc_storehead">Online Orders</div>' . $eol . $eol;

     print '<table id="ORDERLIST" class="khxc_sorttable">' . $eol;

     print '<tr class="khxc_sorttable">' . $eol;

     print '<th class="khxc_sorttable">View Order</th>' . $eol;
     print '<th class="khxc_sorttable">Order Number</th>' . $eol;
     print '<th class="khxc_sorttable">Order Date and Time</th>' . $eol;
     print '<th class="khxc_sorttable">Order Status</th>' . $eol;

     if ($recur) {print '<th class="khxc_sorttable">Recurring Charge Total</th>' . $eol;}

     print '<th class="khxc_sorttable">Total</th>' . $eol;

     print '</tr>' . $eol;

    if ($order['status'] != 'Not Completed') {

          $link = $this->link_namespace($app,'ordersummary',array('ref' => $order['id']));

          print '<tr class="khxc_sorttable">' . $eol;

          print '<td class="khxc_sorttable">';
          print '<a href="' . $link . '" title="Review Order ' . $this->xhtml_encode($order['id']);
          print '">View Order</a></td>';

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['id']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['date']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['status']) . '</td>' . $eol;

          if ($recur) {print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['recurtotal']) . '</td>' . $eol;}

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['ordertotal']) . '</td>' . $eol;

          print '</tr>' . $eol;

} // End of foreach statement.

     print '</table>' . $eol . $eol;

} // End of if statement.

?>

Offline

 

#31 09-25-2007 08:12:11

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: "Pending Payment" versus Incomplete Orders

I know you say it's working but I am not sure how since your script is missing the second foreach statement which would loop through to order array and print all of the customers orders. It must be just printing the first order in the array but you need the foreach statement to get all of the orders for a customers account, so your code should look like (note the second foreach statement at the bottom)

Code:

<?php 

$app      = $this->globals('khxc_display.app');
$eol      = $this->globals('khxc.eol');
$orders   = $this->globals('ecom.order_listing');
$ovlink   = $this->link_namespace($app,'accountover',array());

// +--
// | Handle empty order arrays (the user has no orders).
// +--

if (empty($orders)) {

     print '<p>There are no online orders available for review associated with your ';
     print 'account.  When you place an order using our online store, all orders are ';
     print 'stored here for your review.  Please visit this page again after you have ';
     print 'placed an order.</p>' . $eol . $eol;

     print '<p><a href="' . $ovlink . '" title="Account Overview">';
     print 'Click here for your account overview.</a></p>' . $eol;

// +--
// | We've got orders.  List them.
// +--

} else {

     // +--
     // | Get a count of all of the orders and figure out whether there
     // | are recurring charges in any of them.
     // +--

     $count = 0;
     $recur = 0;

     foreach ($orders as $num => $order) {

          if (!(empty($order['hasrecur']))) {$recur++;}

     if ($order['status'] != 'Not Completed') {

          $count++;

} // End of if statement.

     } // End of foreach statement.

     // +--
     // | Print a header.
     // +--

     print '<p>There are ' . $count . ' online orders available for review associated ';
     print 'with your account.  Please review the listing below.  Orders are presented with ';
     print 'the most recent orders at the top of the listing.  To view all of the information ';
     print 'for an order, track packages (if tracking information has been made available) and ';
     print 'to view a printable version of the order, click the \'View Order\' link next to the ';
     print 'order for which you would like more information.</p>' . $eol . $eol;

     print '<div class="khxc_storehead">Online Orders</div>' . $eol . $eol;

     print '<table id="ORDERLIST" class="khxc_sorttable">' . $eol;

     print '<tr class="khxc_sorttable">' . $eol;

     print '<th class="khxc_sorttable">View Order</th>' . $eol;
     print '<th class="khxc_sorttable">Order Number</th>' . $eol;
     print '<th class="khxc_sorttable">Order Date and Time</th>' . $eol;
     print '<th class="khxc_sorttable">Order Status</th>' . $eol;

     if ($recur) {print '<th class="khxc_sorttable">Recurring Charge Total</th>' . $eol;}

     print '<th class="khxc_sorttable">Total</th>' . $eol;

     print '</tr>' . $eol;

 foreach ($orders as $num => $order) {

    if ($order['status'] != 'Not Completed') {

          $link = $this->link_namespace($app,'ordersummary',array('ref' => $order['id']));

          print '<tr class="khxc_sorttable">' . $eol;

          print '<td class="khxc_sorttable">';
          print '<a href="' . $link . '" title="Review Order ' . $this->xhtml_encode($order['id']);
          print '">View Order</a></td>';

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['id']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['date']) . '</td>' . $eol;
          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['status']) . '</td>' . $eol;

          if ($recur) {print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['recurtotal']) . '</td>' . $eol;}

          print '<td class="khxc_sorttable">' . $this->xhtml_encode($order['ordertotal']) . '</td>' . $eol;

          print '</tr>' . $eol;

} // End of if statement.

} // End of foreach statement.

     print '</table>' . $eol . $eol;

} // End of if statement.

?>

John

Offline

 

#32 10-18-2007 09:03:59

Lisaweb
Member
From: CA
Registered: 04-21-2003
Posts: 417

Re: "Pending Payment" versus Incomplete Orders

What exactly are the advantages of this mod?  Does this mod send the email as well, when an order has tried to take place, but the card has failed?  That's my biggest problem.  My client has lost a few orders because they didn't know someone was trying to order, so couldn't contact to help them.

Offline

 

#33 10-18-2007 10:18:16

supercapes
Member
From: Nevada City, California
Registered: 12-01-2005
Posts: 101
Website

Re: "Pending Payment" versus Incomplete Orders

So this would make it easy for us to distinguish actual cancelled orders from ones where the customer chooses "pay by phone" or when their credit card fails? 

Thanks!


Laura
probably workin' in my jammies

Offline

 

#34 10-18-2007 13:36:22

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: "Pending Payment" versus Incomplete Orders

This will set the default status as Not Completed so that any order that doesn't get to the final process want be labled as Pending Payment. If the customer hits the final process button then all gateway that are set to update the order status will and all gateways set to not update the order status to Complete will set the status to Pending Payment.

This will not affect orders or send out email where the credit card fails as these order do not have a valid response from the payment processor that the order has been funded and would not get to this part of the code.

John

Offline

 

#35 03-29-2008 07:45:15

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: "Pending Payment" versus Incomplete Orders

Just to double check, was this implemented in the last update? (dec07 or jan08)

James...

Offline

 

#36 03-29-2008 08:37:06

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: "Pending Payment" versus Incomplete Orders

No it wasn't and I don't think there are plans to make it part of the base code.

John

Offline

 

#37 03-29-2008 08:50:15

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: "Pending Payment" versus Incomplete Orders

ok, then I'm safe to implement it myself smile thanks John

Last edited by wyattea (03-30-2008 19:55:20)

Offline

 

#38 03-30-2008 20:11:30

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: "Pending Payment" versus Incomplete Orders

Ok, I've implemented, but I got this error:

Code:

Thank you. Your order has been approved and completed. You can review and print a copy of your order below. You will receive an email message containing your order confirmation within a few minutes.
Fatal error: Class 'CCP_Order_status-ORIGINAL-BACKUP' not found in /khxc-private/core/KHXC/KHXC.php on line 1752

I don't understand why it's seeing that...i usually save a copy of the original file I'm editing with 'ORIGINAL-BACKUP' in the name...where is it seeing that?

UPDATE:

I deleted some files that were 'ORIGINAL-BACKUP' (saved to hd) and I didnt' get the error the next try...but i'm still curious why it would show this...did the khxc.php file reference ANY class files in a particular directory?

Regards,

James...

Last edited by wyattea (03-30-2008 21:46:49)

Offline

 

#39 03-31-2008 02:54:42

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: "Pending Payment" versus Incomplete Orders

wyattea wrote:

I deleted some files that were 'ORIGINAL-BACKUP' (saved to hd) and I didnt' get the error the next try...but i'm still curious why it would show this...did the khxc.php file reference ANY class files in a particular directory?

If that file was in the ext directory below CCP_Order the answer is yes.  Any file in that directory with an extension of PHP will be run when an order is processed.  When making backups in that directory you need to change the extension to something other than PHP to avoid what you saw.

Offline

 

#40 03-31-2008 06:18:40

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: "Pending Payment" versus Incomplete Orders

ah, that's good to know for future consideration...i always just change file name to 'ORIGINAL-BACKUP' + copy to HD.

James...

Offline

 

Board footer