Offline Payment Method - Change Default Status

How would I change the default status of the "offline" payment method? We're having some issues with how Paypal sets its payments to "Open" but previously only orders using the "Offline" payment method were the only "Open" orders.

How would I change the default status of the "offline" payment method? We're having some issues with how Paypal sets its payments to "Open" but previously only orders using the "Offline" payment method were the only "Open" orders.

Probably, it is better to examine the issue with PayPal. Please specify which version of CS-Cart do you use?

How would I change the default status of the "offline" payment method? We're having some issues with how Paypal sets its payments to "Open" but previously only orders using the "Offline" payment method were the only "Open" orders.

app/functions/fn.cart.php

find

            if (!$is_processor_script && $order_status == STATUS_INCOMPLETED_ORDER) {
                $order_status = 'O';
            }

and replace O with the required status ID

cs-cart team,

we use 4.3.6.

ecomlabs, Thanks for that suggestion.

How much trouble is it to create a payment method in CS Cart, is there documentation around that? I would like to do something where we just set a status to "Custom" rather than hacking into fn.cart.php

cs-cart team,

we use 4.3.6.

ecomlabs, Thanks for that suggestion.

How much trouble is it to create a payment method in CS Cart, is there documentation around that? I would like to do something where we just set a status to "Custom" rather than hacking into fn.cart.php

It is not so difficult to integrate a payment method. You can read about it here: http://kb.cs-cart.com/new-payment

Also you can make an additional field to set order status for each payment.

Interesting, thank you.

I suppose my follow-up question is where I could read about what to put in that script and also how I would add that field to choose a status for per-payment-method.

Must be me... I thought this thread was about having an offline method default to a different status than O....

You can add this function to your app/addons/my_changes/func.php file

Update: Note there was a typo in the original if statement in the code segment below.

define('LOC_OFFLINE_STATUS', 'H');

function fn_my_changes_change_order_status(&$status_to, $status_from, &$order_info) {
switch( $status_to) {
case ‘O’:
if( empty($order_info[‘payment_method’][‘processor_id’]) )
$status_to = LOC_OFFLINE_STATUS;
break;
}
}

And add this line to app/addons/my_changes/init.php

fn_register_hooks('change_order_status');

This will look at all changes to order status and if it is 'O' AND there's no payment_id defined in the order it will change it to what you have defined as LOC_OFFLINE_STATUS.

Interesting, thank you.

I suppose my follow-up question is where I could read about what to put in that script and also how I would add that field to choose a status for per-payment-method.

Please also find detailed instruction here:

http://docs.cs-cart.com/4.3.x/developer_guide/addons/tutorials/payment_processor_addon.html