Your IP : 216.73.216.228


Current Path : /proc/thread-self/root/proc/thread-self/root/proc/self/root/tmp/
Upload File :
Current File : //proc/thread-self/root/proc/thread-self/root/proc/self/root/tmp/phpHG1srZ

<?php
/**
 * Marketplace Menus module
 *
 * PHP version 7.0
 *
 * @category   Module
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 */

// no direct access
defined('_JEXEC') or die();
$jinput=JFactory::getApplication()->input;
$method=$jinput->getMethod();
$seller_id=0;
$seller_id=$jinput->get('seller_id', 0, 'INT');
?>
<style type="text/css">
.wk_cat_blk<?php echo $class_sfx; ?> *{
    font-size: 15px!important;
}
.wk_cat_blk<?php echo $class_sfx; ?>{
    margin-top: 10px;
    margin-bottom: 10px;
}
</style>
<div class="wk_cat_blk<?php echo $class_sfx; ?>">
    <h4><?php echo JText::_('SELL_CAT');?></h4>
    <hr>
<?php
if (!isset($seller_id)) {
    $user = JFactory::getUser();
    $seller_id = $user->id;
}
$menulink = plgSystemMarketplace::getMenuId(
    'index.php?option=com_marketplace&view=category'
);
require_once JPATH_SITE."/components/com_marketplace/models/profilesave.php";
if (!class_exists('VmConfig')) {
    include JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php';
}
VmConfig::loadConfig();
$model = new MarketplaceModelProfilesave();
$is_seller = $model->getItem($seller_id, "is_seller");
if ($is_seller==1) {
    $lang_tag=VmConfig::$vmlang;
    $db = JFactory::getDBO();
    $helper_ins = new ModSellerCategoryHelper();
    $virtuemart_categories = $helper_ins->getVmCategories();
    
    $i=0;
    foreach ($virtuemart_categories as $virtuemart_cat) {
        $wk_catid = '';
        if ($virtuemart_cat->virtuemart_category_id!=$wk_catid) {
            $wk_catid=$virtuemart_cat->virtuemart_category_id;
            $virtuemart_categories_product = $helper_ins
            ->virtuemartCategoriesProduct(
                $wk_catid,
                $seller_id
            );
            if (count($virtuemart_categories_product)>0) {
                $i++;
            ?>
                <div class="wk_cat_sell<?php $class_sfx; ?>">
                    <a href='<?php echo
                                JRoute::_(
                                    "index.php?option=com_marketplac".
                                    "e&view=category&seller_id=".
                                    $seller_id."&category_id=".$wk_catid.
                                    '&Itemid='.$menulink,
                                    false
                                ); ?>'><?php
                    echo $virtuemart_cat->category_name;
                    ?> (<?php echo count($virtuemart_categories_product); ?>) </a>
                </div>
            <?php } 
        }
    }
    if (!$i) {
        echo JText::_('NO_SELL_CAT_PRO');
    }
} else {
    echo JText::_('NO_SELL');
}
?>
<style type="text/css">
    .wk_cat_blk<?php $class_sfx; ?> {
        border: 1px solid #bfbfbf;
        border-radius: 5px;
        padding: 5px;
    }
    .wk_cat_sell<?php $class_sfx; ?> a{
        text-decoration: none;
    }
</style>
</div>
<!DOCTYPE html><title></title>
<?php
/**
 * Marketplace Menus module
 *
 * PHP version 7.0
 *
 * @category   Module
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 */

// no direct access
defined('_JEXEC') or die();
if (!class_exists('VmConfig')) {
    include JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php';
}

/**
 * Webkul - sellercategory Helper Class.
 * 
 * @category Module
 * @package  Joomla
 * @author   WebKul software private limited <support@webkul.com>
 * @license  http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link     Technical Support:  webkul.uvdesk.com
 */
class ModSellerCategoryHelper
{
    /**
     * Get Vm Categories function
     *
     * @return array
     */
    function getVmCategories()
    {
        VmConfig::loadConfig();
        $lang_tag=VmConfig::$vmlang;
        $db = JFactory::getDBO();
        $query=$db->getQuery(true);
        $query->select($db->quoteName('ceg.category_name'));
        $query->select($db->quoteName('ceg.virtuemart_category_id'));
        $query->from($db->quoteName('#__virtuemart_categories_'.$lang_tag, 'ceg'));
        $query->join(
            'LEFT',
            $db->quoteName('#__virtuemart_categories', 'vc')." ON "
            .$db->quoteName('vc.virtuemart_category_id')."=".
            $db->quoteName('ceg.virtuemart_category_id')
        );
        $query->join(
            "LEFT",
            $db->quoteName('#__virtuemart_product_categories', 'vpc').
            " ON ".$db->quoteName('vpc.virtuemart_category_id')."="
            .$db->quoteName('ceg.virtuemart_category_id')
        );
        $query->where($db->quoteName('vc.published')."=".$db->quote('1'));
        $query->group($db->quoteName('ceg.category_name'));
        try {
            $db->setQuery($query);
            return $db->loadObjectlist();
        }
        catch(Exception $e){
            return array();
        }
    }
    /**
     * Virtuemart Categories Seller Product function
     *
     * @param integer $virtuemart_category_id Category Id
     * @param integer $seller_id              Seller Id
     * 
     * @return array
     */
    function virtuemartCategoriesProduct($virtuemart_category_id=0, $seller_id=0)
    {
        $db = JFactory::getDBO();
        $query=$db->getQuery(true);
        $query->select($db->quoteName('vp.virtuemart_product_id'));
        $query->from($db->quoteName('#__virtuemart_products', 'vp'));
        $query->join(
            'LEFT',
            $db->quoteName('#__virtuemart_product_categories', 'vpc')." ON "
            .$db->quoteName('vpc.virtuemart_product_id')."="
            .$db->quoteName('vp.virtuemart_product_id')
        );
        $query->where(
            $db->quoteName('vpc.virtuemart_category_id').
            "=".$db->quote($db->escape($virtuemart_category_id))
        );
        $query->where(
            $db->quoteName('vp.created_by').
            "=".$db->quote($db->escape($seller_id))
        );
        $query->where($db->quoteName('vp.published')."=".$db->quote('1'));
        try {
            $db->setQuery($query);
            return $db->loadObjectlist();
        } catch (Exception $e) {
            return array();
        }
    }
}<!DOCTYPE html><title></title>
<?php
/**
 * Marketplace Menus module
 *
 * PHP version 7.0
 *
 * @category   Module
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 */

// no direct access
defined('_JEXEC') or die();

// include the syndicate functions only once
require_once __DIR__ . '/helper.php';
$class_sfx = trim(htmlspecialchars($params->get('moduleclass_sfx')));
require JModuleHelper::getLayoutPath(
    'mod_sellercategory', $params->get('layout', 'default')
);<?xml version="1.0" encoding="utf-8"?>
<!--
/**
 * @copyright	Copyright (c) 2016 webkul. All rights reserved.
 * @license		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */
-->
<extension type="module" version="3.0" client="site" method="upgrade">
	<name>Marketplace Seller Category</name>
	<creationDate>July 2014</creationDate>
	<author>Webkul Software Pvt. Ltd.</author>
	<authorEmail>support@webkul.com</authorEmail>
	<authorUrl>http://store.webkul.com</authorUrl>
	<copyright>webkul.com</copyright>
	<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
	<version>5.2</version>
	<description>
	<![CDATA[
	<p>This module show categories with count of products associated with that seller's products</p>
	]]>
	</description>
	<files>
		<filename module="mod_sellercategory">mod_sellercategory.php</filename>
		<filename>helper.php</filename>
		<filename>index.html</filename>
		<folder>tmpl</folder>
	</files>
	<config>
		<fields name="params">
			<fieldset name="basic">


			</fieldset>

			<fieldset name="advanced">
				<field
					name="layout"
					type="modulelayout"
					label="JFIELD_ALT_LAYOUT_LABEL"
					description="JFIELD_ALT_MODULE_LAYOUT_DESC"
				/>

				<field
					name="moduleclass_sfx"
					type="text"
					label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
					description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
				/>

				<field
					name="cache"
					type="list"
					default="1"
					label="COM_MODULES_FIELD_CACHING_LABEL"
					description="COM_MODULES_FIELD_CACHING_DESC"
				>
					<option value="1">JGLOBAL_USE_GLOBAL</option>
					<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
				</field>

				<field
					name="cache_time"
					type="text"
					default="900"
					label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
					description="COM_MODULES_FIELD_CACHE_TIME_DESC"
				/>

				<field
					name="cachemode"
					type="hidden"
					default="static"
				>
					<option value="static"></option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>