Page 1 of 1
status for payment option?
Posted: 26 Jun 2019, 15:41
by muweb
Hello
Is it possible to assign a fixed order status to a particular payment option?
Re: status for payment option?
Posted: 30 Jun 2019, 10:49
by Jan
Hi, it depends on the payment plugin. In payment plugin, there can be a method which will set the stock status when ordering.
So for example, payment plugin POS Cash
plugins\pcp\pos_cash\pos_cash.php
Code: Select all
function PCPbeforeSaveOrder(&$statusId, $pid) {
$paymentTemp = new PhocacartPayment();
$paymentOTemp = $paymentTemp->getPaymentMethod((int)$pid );
$paramsPaymentTemp = $paymentOTemp->params;
$statusId = $paramsPaymentTemp->get('default_order_status', 6);
//$statusId = 6;
return true;
}
plugins\pcp\pos_cash\pos_cash.xml
Code: Select all
<field name="default_order_status" type="PhocaCartOrderStatus" default="6" label="PLG_PCP_POS_CASH_DEFAULT_ORDER_STATUS_LABEL" description="PLG_PCP_POS_CASH_DEFAULT_ORDER_STATUS_DESC"/>
So for now it is included in POS Cash plugin but it can be extended for each payment plugin.
Jan
Re: status for payment option?
Posted: 01 Jul 2019, 09:33
by muweb
Hello Jan
Thanks for the help.
I added this to cash_on_delivery. Or will my changes be overwritten by updates?
Re: status for payment option?
Posted: 02 Jul 2019, 11:58
by Jan
Hi, yes, maybe it is easier to make a copy of the plugin (you will do the same plugin with other name) so it will be not overwritten by update.
Jan
Re: status for payment option?
Posted: 02 Jul 2019, 12:44
by muweb
Ok.
what exactly do I have to copy to make it work?
Re: status for payment option?
Posted: 03 Jul 2019, 12:43
by Jan
The best way is to take whole ZIP of the payment method and change all the names thee:
e.g.:
cash_on_delivery to cash_on_delivery2 (but all strings must be renamed - the files, the names in XML file, the strings in language files, etc.) so you can install it as another plugin in Joomla! and customize it for yourself without having problems when updating.
Jan
Re: status for payment option?
Posted: 05 Jul 2019, 08:35
by muweb
Thank you for your help.
I've copied the pos-plugin to pos2.
if anybody else needs this, here you can download it:
https://workupload.com/file/K4DXyES2
Re: status for payment option?
Posted: 06 Jul 2019, 23:06
by Jan
Hi, great thank you very much for the link.
Jan