Hello
Is it possible to assign a fixed order status to a particular payment option?
status for payment option?
-
- Phoca Enthusiast
- Posts: 77
- Joined: 27 Mar 2019, 12:42
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: status for payment option?
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
plugins\pcp\pos_cash\pos_cash.xml
So for now it is included in POS Cash plugin but it can be extended for each payment plugin.
Jan
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;
}
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
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 77
- Joined: 27 Mar 2019, 12:42
Re: status for payment option?
Hello Jan
Thanks for the help.
I added this to cash_on_delivery. Or will my changes be overwritten by updates?
Thanks for the help.
I added this to cash_on_delivery. Or will my changes be overwritten by updates?
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: status for payment option?
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
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 77
- Joined: 27 Mar 2019, 12:42
Re: status for payment option?
Ok.
what exactly do I have to copy to make it work?
what exactly do I have to copy to make it work?
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: status for payment option?
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
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
If you find Phoca extensions useful, please support the project
-
- Phoca Enthusiast
- Posts: 77
- Joined: 27 Mar 2019, 12:42
Re: status for payment option?
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
I've copied the pos-plugin to pos2.
if anybody else needs this, here you can download it:
https://workupload.com/file/K4DXyES2
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: status for payment option?
Hi, great thank you very much for the link.
Jan
Jan
If you find Phoca extensions useful, please support the project