Order status with Paypal

I’ve searched through the forum for problems concerning order status after a Paypal payment, and found a lot of people having various problems, but not exactly finding a solution.



My problem is that after a customer orders a product and completes payment using Paypal, the order status is set to “Processed” instead of “Completed”



I wasn’t getting emails sent to customer, and figured out that it was because I had it set to notify customer for order completion, but not for order processed. I set it to notify customer for order processed status, and now the customers are notified.



I am getting admin notification for orders placed and set to “Processed” status.



I then discovered that this isn’t a real solution, because the customer does not get their Reward Points for a “P” status, they only get them for a “C” status. This means I would have to go in and change all status to “Completed” manually.



Is there any answer or fix to get order status to be set to Completed instead of Processed?



Thanks…

This is the way CS-Cart is designed and probably reflects the way most stores process orders: new orders are either ‘Open’ (not yet paid for) or 'Processed (payment has been made). Most store owners then change the order status to ‘Complete’ when the order has been shipped.



You can change the order status assigned to Paypal payments in /payments/paypal.php:

list($headers,$result) = fn_https_request("POST","https://$paypal_host:443/cgi-bin/webscr", $post_data);

if (stristr($result, 'VERIFIED')) {
[COLOR="Red"][/COLOR]$pp_response['order_status'] = 'P';
$pp_response['reason_text'] = '';
$pp_response['transaction_id'] = @$_REQUEST['txn_id'];


Change the “P” to “C”.



I have not tested this but it may not achieve what you want since I doubt the reward points will awarded. You will probably still need to call the routine that awards the points and updates the cscart_reward_points table.



Bob

Thanks for the reply.



Since mine is a new site with not many sales, I can go the manual change route, I just thought there might be a way to do it automatically. My products are all digital downloads, so there is no shipping involved. I would just need to go in and mark each order complete and I assume the reward points would be allocated.



I am curious about the phrase “call a routine”. I’m not a programmer so I don’t know exactly what that means or how to do it. I see people saying that all of the time, you need to “call this routine”, or “call that routine”, and have always wondered exactly what it meant. Perhaps you can shed some light on my ignorance.



Thanks again…

Calling a routine just means specifying that some code is to be executed. In your case, you would need to call the function that updates points accrued by the user. I think this code starts at line 217 in /addons/reward_points/func.php.



You would need to call that routine in the controller that places the order if it does not already do this.



Bob