status for payment option?

Phoca Cart - complex e-commerce extension
muweb
Phoca Enthusiast
Phoca Enthusiast
Posts: 77
Joined: 27 Mar 2019, 12:42

status for payment option?

Post by muweb »

Hello

Is it possible to assign a fixed order status to a particular payment option?

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: status for payment option?

Post 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"/>
Image

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
muweb
Phoca Enthusiast
Phoca Enthusiast
Posts: 77
Joined: 27 Mar 2019, 12:42

Re: status for payment option?

Post by muweb »

Hello Jan

Thanks for the help.
I added this to cash_on_delivery. Or will my changes be overwritten by updates?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: status for payment option?

Post 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. :idea:

Jan
If you find Phoca extensions useful, please support the project
muweb
Phoca Enthusiast
Phoca Enthusiast
Posts: 77
Joined: 27 Mar 2019, 12:42

Re: status for payment option?

Post by muweb »

Ok.

what exactly do I have to copy to make it work?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: status for payment option?

Post 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
If you find Phoca extensions useful, please support the project
muweb
Phoca Enthusiast
Phoca Enthusiast
Posts: 77
Joined: 27 Mar 2019, 12:42

Re: status for payment option?

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: status for payment option?

Post by Jan »

Hi, great thank you very much for the link.

Jan
If you find Phoca extensions useful, please support the project
Post Reply