| Current Path : /home/digilove/public_html/components/com_marketplace/views/profile/ |
| Current File : /home/digilove/public_html/components/com_marketplace/views/profile/view.html.php |
<?php
/**
* Marketplace - Component Marketplace
* ******************************************************************
*
* PHP version 7.0
*
* @category Component
* @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('Restricted access');
jimport('joomla.application.component.view');
jimport('joomla.filesystem.folder');
if (!class_exists('MarketplaceHelper')) {
include JPATH_ADMINISTRATOR.'/components/com_marketplace/helpers/marketplace.php';
}
/**
* MarketplaceViewProfile class
*
* @category Component
* @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 MarketplaceViewProfile extends JViewLegacy
{
/**
* Display function
*
* @param [type] $tpl var
*
* @return void
*/
function display($tpl = null)
{
$customerfolder = JPATH_ROOT . DIRECTORY_SEPARATOR .
'media' . DIRECTORY_SEPARATOR . 'marketplace';
global $option;
$userdetails = JFactory::getUser();
if ($userdetails->id>0) {
if (MarketplaceHelper::checkSeller($userdetails->id)) {
//code to get payment(stripe connect) method params
$model=$this->getModel('profile');
$stripe_payment_params=$model->getPaymentMethodId();/*contains array of params*/
if (!empty($stripe_payment_params)) {
$this->stripe_type=$stripe_payment_params['stripe_payment_type'];
if ($this->stripe_type) {
$this->stripe_client_id=$stripe_payment_params['stripe_live_client_id'];
$this->secret_key=$stripe_payment_params['stripe_live_secret_key'];
$this->public_key=$stripe_payment_params['stripe_live_publishable_key'];
} else {
$this->stripe_client_id=$stripe_payment_params['stripe_test_client_id'];
$this->secret_key=$stripe_payment_params['stripe_test_secret_key'];
$this->public_key=$stripe_payment_params['stripe_test_publishable_key'];
}
}
$uploadpath = $customerfolder . DIRECTORY_SEPARATOR . 'user'.$userdetails->id;
$suc_create = JFolder::create($uploadpath, 0777);
$data = $this->get('Data');
$this->assignRef('data', $data);
JPluginHelper::importPlugin('system');
$dispatcher =JDispatcher::getInstance();
$addonData=$dispatcher->trigger('onSellerEditProfileView', array($data[0]));
$this->assignRef('addonData', $addonData);
parent::display($tpl);
} else {
JFactory::getApplication()->enqueueMessage(
JText::_('NOT_LOGIN_WITH_SELLER_ACCOUNT'),
'error'
);
}
} else {
JFactory::getApplication()->enqueueMessage(
JText::_('PLEASE_LOGIN'),
'error'
);
}
}
}