Spade
Mini Shell
index.html000064400000000054151162436440006546 0ustar00<html><body
bgcolor="#FFFFFF"></body></html>productfiltervendor.php000064400000003331151162436440011367
0ustar00<?php
/**
* @package HikaMarket for Joomla!
* @version 3.1.1
* @author Obsidev S.A.R.L.
* @copyright (C) 2011-2020 OBSIDEV. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class plgHikashopProductfiltervendor extends JPlugin {
public function __construct(&$subject, $config) {
parent::__construct($subject, $config);
}
private function init() {
static $init = null;
if($init !== null)
return $init;
$init = defined('HIKAMARKET_COMPONENT');
if(!$init) {
$filename =
rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikamarket'.DS.'helpers'.DS.'helper.php';
if(file_exists($filename)) {
include_once($filename);
$init = defined('HIKAMARKET_COMPONENT');
}
}
return $init;
}
public function
onBeforeProductListingLoad(&$filters,&$order,&$parent,
&$select, &$select2, &$a, &$b, &$on) {
global $Itemid;
$ctrl = hikaInput::get()->getCmd('ctrl');
$task = hikaInput::get()->getCmd('task');
static $done = null;
if($ctrl != 'product' || $task != 'listing' || $done
=== true)
return;
$done = true;
if(!isset($this->params)) {
$pluginsClass = hikashop_get('class.plugins');
$plugin = $pluginsClass->getByName('hikashop',
'productfiltervendor');
$ids = explode(',', @$plugin->params['ids']);
} else if($this->params->get('ids', '') !=
'') {
$ids = explode(',', $this->params->get('ids',
''));
}
$i = '' . $Itemid;
if(empty($ids) || !in_array($i, $ids))
return;
if(!$this->init())
return;
$vendor = hikamarket::loadVendor(false);
$filters[] = 'b.product_vendor_id = ' . (int)$vendor;
}
}
productfiltervendor.xml000064400000002464151162436440011406
0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin"
group="hikashop" method="upgrade">
<name>HikaShop - Product Filter for vendors</name>
<hikainstall ordering="0" enable="0"
report="0" />
<creationDate>20 juillet 2020</creationDate>
<version>3.1.1</version>
<author>Obsidev</author>
<authorEmail>dev@obsidev.com</authorEmail>
<authorUrl>http://www.obsidev.com</authorUrl>
<copyright>Copyright (C) 2012-2020 OBSIDEV SARL - All rights
reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html
GNU/GPL</license>
<description>HikaShop/HikaMarket integration - Product listing
filter for vendors - Create a product listing which show only the (current
logged) vendor products</description>
<files>
<filename
plugin="productfiltervendor">productfiltervendor.php</filename>
</files>
<params addpath="/components/com_hikashop/params">
<param name="ids" type="text" default=""
label="Item Id list" description="List of the menu item Ids,
separate by comma"/>
</params>
<config>
<fields name="params"
addfieldpath="/components/com_hikashop/fields">
<fieldset name="basic">
<field name="ids" type="text"
default="" label="Item Id list" description="List
of the menu item Ids, separate by comma"/>
</fieldset>
</fields>
</config>
</extension>