Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/cash_on_delivery.zip

PK@-�[�K���cash_on_delivery.phpnu�[���<?php
/* @package Joomla
 * @copyright Copyright (C) Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * @extension Phoca Extension
 * @copyright Copyright (C) Jan Pavelka www.phoca.cz
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 */

defined('_JEXEC') or die;
jimport( 'joomla.plugin.plugin' );
jimport( 'joomla.filesystem.file');
jimport( 'joomla.html.parameter' );

JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR .
'/components/com_phocacart/libraries/phocacart');

class plgPCPCash_On_Delivery extends JPlugin
{

	protected $name 	= 'cash_on_delivery';

	function __construct(& $subject, $config) {
		parent :: __construct($subject, $config);
	}

	/**
	 * Proceed to payment - some method do not have proceed to payment gateway
like e.g. cash on delivery
	 *
	 * @param   integer	$proceed  Proceed or not proceed to payment gateway
	 * @param   string	$message  Custom message array set by plugin to
override standard messages made by component
	 *
	 * @return  boolean  True
	 */

	function PCPbeforeProceedToPayment(&$proceed, &$message,
$eventData) {

		if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
			return false;
		}

		$proceed = 0;
		$message = array();

		return true;
	}

	function PCPbeforeSaveOrder(&$statusId, $pid, $eventData) {

		if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
			return false;
		}

        // Status set by payment method in case of order (pending,
confirmed, completed)
        // In case of POS cash, it is always completed
        $paymentTemp		= new PhocacartPayment();
        $paymentOTemp 		= $paymentTemp->getPaymentMethod((int)$pid );
        $paramsPaymentTemp	= $paymentOTemp->params;
        $statusId		    =
$paramsPaymentTemp->get('default_order_status', 1);

		//$statusId = 6;

		return true;
	}

	function PCPbeforeShowPossiblePaymentMethod(&$active, $params,
$eventData){

		if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
			return false;
		}

		// Payment plugin can disable/deactivate current payment method in
possible payment method list based on own rules
		// $active = false;

		return true;

	}

	function PCPonInfoViewDisplayContent($data, $eventData){

		if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
			return false;
		}

		$output = array();
		//$output['content'] = '';

		return $output;

	}


	/*
	 * Payment plugin wants to display some information on Item View (Detail
View) page
	 * */
	/*
	public function PCPonItemBeforeEndPricePanel($context, &$item,
&$params) {
		//return "<div></div>";
	}
	*/

}
?>
PK@-�[�)�XXcash_on_delivery.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension type="plugin" group="pcp"
method="upgrade" version="3.9">
	<name>plg_pcp_cash_on_delivery</name>
	<author>Jan Pavelka (www.phoca.cz)</author>
	<creationDate>04/10/2021</creationDate>
	<authorEmail></authorEmail>
	<authorUrl>https://www.phoca.cz</authorUrl>
	<copyright>Jan Pavelka</copyright>
	<license>GNU/GPL</license>
	<version>3.5.8</version>
	<description>PLG_PCP_CASH_ON_DELIVERY_DESCRIPTION</description>
	<projectName>PhocaCartCashOnDeliveryPlugin</projectName>

	<files>
		<folder>helpers</folder>
		<filename
plugin="cash_on_delivery">cash_on_delivery.php</filename>
		<filename
plugin="cash_on_delivery">index.html</filename>
	</files>

	<languages>
		<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_cash_on_delivery.ini</language>
		<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_cash_on_delivery.sys.ini</language>
	</languages>

	<administration>
		<languages>
			<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_cash_on_delivery.ini</language>
			<language
tag="en-GB">language/en-GB/en-GB.plg_pcp_cash_on_delivery.sys.ini</language>
		</languages>
	</administration>
	<form>
        <fields name="params"
addfieldpath="/administrator/components/com_phocacart/models/fields">
            <fieldset name="payment"
addpath="/administrator/components/com_phocacart/models/fields"
group="pcp">

                <field name="default_order_status"
type="PhocaCartOrderStatus" default="1"
label="PLG_PCP_CASH_ON_DELIVERY_DEFAULT_ORDER_STATUS_LABEL"
description="PLG_PCP_CASH_ON_DELIVERY_DEFAULT_ORDER_STATUS_DESC"/>


            </fieldset>
        </fields>

    </form>
	

	<updateservers>
		<server type="extension"
name="PLG_PCP_CASH_ON_DELIVERY"
priority="1"><![CDATA[https://raw.githubusercontent.com/PhocaCz/PhocaCartCashOnDeliveryPlugin/master/manifest.xml]]></server>
	</updateservers>
</extension>
PK@-�[�#o,,helpers/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK@-�[��ؙWWhelpers/main.phpnu�[���<?php
/* @package Joomla
 * @copyright Copyright (C) Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * @extension Phoca Extension
 * @copyright Copyright (C) Jan Pavelka www.phoca.cz
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 */
defined('_JEXEC') or die;


?>PK@-�[�#o,,
index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PK@-�[�K���cash_on_delivery.phpnu�[���PK@-�[�)�XX�cash_on_delivery.xmlnu�[���PK@-�[�#o,,lhelpers/index.htmlnu�[���PK@-�[��ؙWW�helpers/main.phpnu�[���PK@-�[�#o,,
qindex.htmlnu�[���PK��