Exemplo n.º 1
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = JComponentHelper::getParams('com_quick2cart');
     // Check for errors.
     $errors = $this->get('Errors');
     if (count($errors)) {
         throw new Exception(implode("\n", $errors));
     }
     // Creating status filter.
     $statuses = array();
     $statuses[] = JHtml::_('select.option', '', JText::_('COM_QUICK2CART_SELONE'));
     $statuses[] = JHtml::_('select.option', 1, JText::_('COM_QUICK2CART_PUBLISH'));
     $statuses[] = JHtml::_('select.option', 0, JText::_('COM_QUICK2CART_UNPUBLISH'));
     $this->statuses = $statuses;
     // Get itemid
     $comquick2cartHelper = new comquick2cartHelper();
     $this->createstore_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore');
     // Get toolbar path
     $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar');
     // Get other vars
     $storeHelper = new storeHelper();
     $this->allowToCreateStore = $storeHelper->isAllowedToCreateNewStore();
     // Setup toolbar
     $this->addTJtoolbar();
     $this->_prepareDocument();
     parent::display($tpl);
 }
Exemplo n.º 2
0
 /**
  * Displays the application output in the canvas.
  *
  * @param   int   The user id that is currently being viewed.
  * @param   string   layout path
  * @since   1.0
  * @access  public
  */
 public function display($userId = null, $docType = null)
 {
     // Get the user params
     $params = $this->getUserParams($userId);
     // Get the app params
     $appParams = $this->app->getParams();
     // Get the blog model
     $total = (int) $params->get('total', $appParams->get('total', 5));
     $pin_width = (int) $appParams->get('pin_width', 145);
     $pin_padding = (int) $appParams->get('pin_padding', 3);
     // Get list of all products created by the user on the site.
     $input = JFactory::getApplication()->input;
     $storeid = $input->get('storeid', '', 'INT');
     $model = $this->getModel('q2cmyproducts');
     $products = $model->getItems($userId, $total, $storeid);
     $productsCount = $model->getProductsCount($userId, $storeid);
     $user = Foundry::user($userId);
     // Get store list of user
     require_once JPATH_ROOT . '/components/com_quick2cart/helpers/storeHelper.php';
     $storeHelper = new storeHelper();
     $storelist = $storeHelper->getUserStore($userId);
     $this->set('user', $user);
     $this->set('userId', $userId);
     $this->set('total', $total);
     $this->set('pin_width', $pin_width);
     $this->set('pin_padding', $pin_padding);
     $this->set('products', $products);
     $this->set('productsCount', $productsCount);
     $this->set('storelists', $storelist);
     echo parent::display('profile/default');
 }
Exemplo n.º 3
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $zoneHelper = new zoneHelper();
     // Check whether view is accessible to user
     if (!$zoneHelper->isUserAccessible()) {
         return;
     }
     $app = JFactory::getApplication();
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $app->getParams('com_quick2cart');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new Exception(implode("\n", $errors));
     }
     // Get user store list
     $storeHelper = new storeHelper();
     // Get all stores.
     $user = JFactory::getUser();
     $this->userStores = $storeHelper->getUserStore($user->id);
     // Get toolbar path
     $comquick2cartHelper = new comquick2cartHelper();
     $this->toolbar_view_path = $comquick2cartHelper->getViewpath('vendor', 'toolbar');
     // Publish states
     $this->publish_states = array('' => JText::_('JOPTION_SELECT_PUBLISHED'), '1' => JText::_('JPUBLISHED'), '0' => JText::_('JUNPUBLISHED'));
     // Setup TJ toolbar
     $this->addTJtoolbar();
     $this->_prepareDocument();
     parent::display($tpl);
 }
Exemplo n.º 4
0
function Quick2cartBuildRoute(&$query)
{
    $app = JFactory::getApplication();
    $segments = array();
    $alias = '';
    $storeURL_text = JText::_('QTC_VANITY_PAGE');
    // store_id based,
    if (array_key_exists('store_id', $query)) {
        include_once JPATH_BASE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'storeHelper.php';
        $storeHelper = new storeHelper();
        $alias = $storeHelper->getStoreAlias($query['store_id']);
    }
    if (isset($query['view']) && isset($query['layout']) && $alias) {
        if ($query['view'] == 'vendor' && $query['layout'] == 'store' && !empty($alias) && !empty($query['Itemid'])) {
            $segments[] = $alias;
            $segments[] = $storeURL_text;
            //$query['layout'];
            unset($query['store_id']);
            unset($query['layout']);
            unset($query['view']);
        }
    }
    if (!empty($query['Itemid'])) {
        $menu = $app->getMenu();
        $menuItem = $menu->getItem($query['Itemid']);
        /* @TODO JUGAD START HERE for Vanity URL to display on createstore page */
        if (isset($query['vanitydisplay']) && isset($query['layout'])) {
            unset($query['view']);
            unset($query['layout']);
            unset($query['vanitydisplay']);
        }
        /* @TODO JUGAD END HERE */
        if (isset($query['view'])) {
            if (!isset($menuItem->query['view']) || $menuItem->query['view'] != $query['view']) {
                $segments[] = $query['view'];
                //unset($query['view']);
            } else {
                unset($query['view']);
            }
        }
        /*
        		if (isset($query['layout']) ){
        			if ( ! isset($menuItem->query['layout']) || $menuItem->query['layout'] != $query['layout'])
        			{
        				$segments[] = $query['layout'];
        				//unset($query['layout']);
        			}
        			else
        				unset($query['layout']);
        		} */
    }
    return $segments;
}
Exemplo n.º 5
0
 function csvexport()
 {
     $model = $this->getModel("delaysreport");
     $CSVData = $model->getCsvexportData();
     $filename = "DelaysReport_" . date("Y-m-d");
     $csvData = null;
     //$csvData.= "Item_id;Product Name;Store Name;Store Id;Sales Count;Amount;Created By;";
     $headColumn = array();
     //$headColumn[0] = JText::_('COM_QUICK2CART_DELAYSREPORT_ID');
     $headColumn[1] = JText::_('COM_QUICK2CART_DELAYSREPORT_ORDER_ID');
     // 'Product Name';
     $headColumn[2] = JText::_('COM_QUICK2CART_DELAYSREPORT_DAYS');
     $headColumn[3] = JText::_('COM_QUICK2CART_DELAYSREPORT_BUYER');
     $headColumn[4] = JText::_('COM_QUICK2CART_DELAYSREPORT_STATUS');
     $csvData .= implode(";", $headColumn);
     $csvData .= "\n";
     header("Content-type: application/vnd.ms-excel");
     header("Content-disposition: csv" . date("Y-m-d") . ".csv");
     header("Content-disposition: filename=" . $filename . ".csv");
     if (!empty($CSVData)) {
         $storeHelper = new storeHelper();
         foreach ($CSVData as $data) {
             $csvrow = array();
             //$csvrow[0] = '';
             $csvrow[1] = '"' . $data['prefix'] . $data['id'] . '"';
             $delay = $storeHelper->GetDelaysInOrder($data['id']);
             if ($delay) {
                 $csvrow[2] = '"' . $delay . '"';
             } else {
                 $csvrow[2] = '"-"';
             }
             $csvrow[3] = '"' . $data['name'] . '"';
             if ($data['status'] == 'C') {
                 $status = JText::_('ORDER_CONFIRMED');
             } elseif ($data['status'] == 'S') {
                 $status = JText::_('ORDER_SHIPPED');
             } else {
                 $status = JText::_('ORDER_CANCELLED');
             }
             $csvrow[4] = '"' . $status . '"';
             $csvData .= implode(";", $csvrow);
             $csvData .= "\n";
         }
     }
     ob_clean();
     echo $csvData . "\n";
     jexit();
     $link = JUri::base() . substr(JRoute::_('index.php?option=com_quick2cart&view=delaysreport', false), strlen(JUri::base(true)) + 1);
     $this->setRedirect($link);
 }
Exemplo n.º 6
0
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  *
  * @since   11.4
  */
 protected function getOptions()
 {
     require_once JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'storeHelper.php';
     $storeHelper = new storeHelper();
     // Get all stores.
     $user = JFactory::getUser();
     $stores = $storeHelper->getUserStore($user->id);
     $options = array();
     //$options[] = JHtml::_('select.option', '', JText::_('QTC_SELET_STORE'));
     foreach ($stores as $key => $value) {
         $options[] = JHtml::_('select.option', $value['id'], $value['title']);
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Exemplo n.º 7
0
 function save()
 {
     $jinput = JFactory::getApplication()->input;
     $post = $jinput->post;
     $btnAction = $post->get('btnAction');
     $storeHelper = new storeHelper();
     $result = $storeHelper->saveVendorDetails($post);
     $qtcadminCall = $jinput->get('qtcadminCall');
     if ($btnAction == 'vendor.saveAndClose') {
         $link = JRoute::_('index.php?option=com_quick2cart&view=stores&layout=my&Itemid=' . $this->my_stores_itemid, false);
     } else {
         $link = JUri::base() . 'index.php?option=com_quick2cart&view=vendor&layout=createstore&store_id=' . $result['store_id'];
     }
     if (!empty($qtcadminCall)) {
         $link = JUri::root() . 'administrator/index.php?option=com_quick2cart';
     }
     $this->setRedirect($link, $result['msg']);
 }
Exemplo n.º 8
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return	JDatabaseQuery
  *
  * @since	1.6
  */
 protected function getListQuery()
 {
     $storeHelper = new storeHelper();
     // Get all stores.
     $user = JFactory::getUser();
     $storeList = $storeHelper->getUserStore($user->id);
     $storeIds = array();
     foreach ($storeList as $store) {
         $storeIds[] = $store['id'];
     }
     $accessibleStoreIds = '';
     if (!empty($storeIds)) {
         $accessibleStoreIds = implode(',', $storeIds);
     } else {
         // Accessed view before creating the store.
         $accessibleStoreIds = '-1';
     }
     // Create a new query object.
     $db = $this->getDbo();
     $query = $db->getQuery(true);
     // Select the required fields from the table.
     $query->select($this->getState('list.select', 'a.*'));
     $query->from('`#__kart_shipprofile` AS a');
     $query->where('(a.store_id IN (' . $accessibleStoreIds . '))');
     // Filter by published state
     $published = $this->getState('filter.state');
     if (is_numeric($published)) {
         $query->where('a.state = ' . (int) $published);
     } elseif ($published === '') {
         $query->where('(a.state IN (0, 1))');
     }
     // Filter by search in title
     $search = $this->getState('filter.search');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('a.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->Quote('%' . $db->escape($search, true) . '%');
             $query->where('( a.name LIKE ' . $search . ' )');
         }
     }
     return $query;
 }
Exemplo n.º 9
0
if (!empty($this->storeDetailInfo)) {
    $sinfo = $this->storeDetailInfo;
    if ($layout == "storeinfo") {
        ?>
		<div class="<?php 
        echo Q2C_WRAPPER_CLASS;
        ?>
">
		<?php 
    }
    ?>
			<div class="row-fluid">
				<div class="well well-small span12">
					<legend>
						<?php 
    $storeHelper = new storeHelper();
    $storeLink = $storeHelper->getStoreLink($this->storeDetailInfo['id']);
    ?>

						<a href="<?php 
    echo $storeLink;
    ?>
" class="btn btn-mini">
							<i class="<?php 
    echo Q2C_ICON_HOME;
    ?>
"></i>
						</a> &nbsp; <?php 
    echo $sinfo['title'];
    ?>
Exemplo n.º 10
0
    }
    echo $storeHelper->getCatHierarchyLink($this->itemdetail->category, 'com_quick2cart');
    ?>
										</div>
										<?php 
}
$multivendor_enable = $params->get('multivendor');
if (!empty($this->itemdetail->store_id) && !empty($multivendor_enable)) {
    ?>
											<!--  STORE NAME -->
											<div class="" itemprop="brand" itemscope
												itemtype="http://schema.org/Brand">
												<span>
													<?php 
    $storeinfo = $comquick2cartHelper->getSoreInfo($this->itemdetail->store_id);
    $storeHelper = new storeHelper();
    $storeLink = $storeHelper->getStoreLink($this->itemdetail->store_id);
    $contact_ink = JUri::base() . 'index.php?option=com_quick2cart&view=vendor&layout=contactus&store_id=' . $this->itemdetail->store_id . '&item_id=' . $this->item_id . '&tmpl=component';
    ?>
													<?php 
    echo JText::_('QTC_STORE_NAME');
    ?>
:&nbsp;
													<a href="<?php 
    echo $storeLink;
    ?>
">
														<span itemprop="name"><?php 
    echo $storeinfo['title'];
    ?>
</span>
Exemplo n.º 11
0
    			$default=!empty($this->itemDetail)?$this->itemDetail['category']:0;
    			echo JHtml::_('select.genericlist',$this->cats,'prod_cat','class="required" size="1" onchange="document.adminForm.submit();" ','value','text',$defaultcat);
    		}*/
    //echo $this->cats;
}
?>
					<!-- for category list-->

					<?php 
// DECLARE STORE RELEATED PARAMS
$qtc_catname = "store_cat";
$qtc_view = "vendor";
$qtc_layout = "store";
$qtc_store_id = $this->store_id;
//GETTING STORE RELEATED CATEGORIES
$storeHelper = new storeHelper();
$storeHomePage = 1;
$viewReleated_cats = $storeHelper->getStoreCats($this->store_id, '', '', '', '', 0);
// getStoreCats($store_id,$catid='',$onchangeSubmitForm=1,$name='store_cat',$class='',$givedropdown=1)
$view = $comquick2cartHelper->getViewpath('category', 'categorylist');
ob_start();
include $view;
$html = ob_get_contents();
ob_end_clean();
echo $html;
?>
				</div>
			</div>
		</div>
		<!-- FIRST ROW-FLOUID DIV-->
Exemplo n.º 12
0
 function updateEasysocialApp()
 {
     $lang = JFactory::getLanguage();
     $lang->load('plg_app_user_q2cMyProducts', JPATH_ADMINISTRATOR);
     // Get storeid,useris and total from ajax responce.
     $input = JFactory::getApplication()->input;
     $storeid = $input->get('storeid', '', 'INT');
     $userid = $input->get('uid', '', 'INT');
     $total = $input->get('total', '', 'INT');
     // Load app modal getitem function.
     require_once JPATH_ROOT . '/media/com_easysocial/apps/user/q2cMyProducts/models/q2cmyproducts.php';
     $q2cMyProductsModel = new q2cmyproductsModel('', $config = array());
     $products = $q2cMyProductsModel->getItems($userid, $total, $storeid);
     $store_product_count = $q2cMyProductsModel->getProductsCount($userid, $storeid);
     // load store helper file
     JLoader::register('storeHelper', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'storeHelper.php');
     // Laod store helper class.
     JLoader::load('storeHelper');
     $storeHelper = new storeHelper();
     // Get store link
     $store_link = $storeHelper->getStoreLink($storeid);
     // Set q2c products return by modal of easysocial app.
     $this->set('products', $products);
     if ($products) {
         $random_container = 'q2c_pc_es_app_my_products';
         $html = '<div id="q2c_pc_es_app_my_products">';
         foreach ($products as $data) {
             $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'views' . DS . 'product' . DS . 'tmpl' . DS . 'product.php';
             // @TODO condition vise mod o/p
             ob_start();
             include $path;
             $html .= ob_get_contents();
             ob_end_clean();
         }
         $html .= '</div>';
         $html .= '<div class="clearfix"></div>';
         if ($store_product_count > $total) {
             $html .= "\n\t\t\t\t<div class='row-fluid span12'>\n\t\t\t\t\t<div class='pull-right'>\n\t\t\t\t\t\t<a href='" . $store_link . "'>" . JText::_('APP_Q2CMYPRODUCTS_SHOW_ALL') . " (" . $store_product_count . ") </a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='clearfix'>&nbsp;</div>\n\t\t\t\t</div>";
         }
     } else {
         $user = JFactory::getUser($userid);
         $html = '<div class="empty" style="display:block;">';
         $html .= JText::sprintf('APP_Q2CMYPRODUCTS_NO_PRODUCTS_FOUND', $user->name);
         $html .= '</div>';
     }
     $js = 'initiateQ2cPins();';
     $data['html'] = $html;
     $data['js'] = $js;
     echo json_encode($data);
     jexit();
 }
Exemplo n.º 13
0
<?php

/**
 * @version    SVN: <svn_id>
 * @package    Quick2cart
 * @author     Techjoomla <*****@*****.**>
 * @copyright  Copyright (c) 2009-2015 TechJoomla. All rights reserved.
 * @license    GNU General Public License version 2 or later.
 */
// No direct access.
defined('_JEXEC') or die;
$helperobj = new comquick2cartHelper();
$storeHelper = new storeHelper();
$store_link = $storeHelper->getStoreLink($data['id']);
//$store_link= JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=store&store_id='.$data['id'].'&Itemid='.$addProd_Itemid);
$com_params = JComponentHelper::getParams('com_quick2cart');
$img_width = $com_params->get('storeavatar_width');
?>

<li class="store_wrapper" <?php 
echo empty($prodclass) ? 'style="width:' . ($img_width + 30) . 'px;"' : 'class="' . $prodclass . '"';
?>
 >
	<div class="thumbnail">
		<!-- store name-->
		<div class="row-fluid">
			<div class="span12" align="center" >
				<a href="<?php 
echo $store_link;
?>
">
Exemplo n.º 14
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return  JDatabaseQuery
  *
  * @since   1.6
  */
 protected function getListQuery()
 {
     // Create a new query object.
     $db = $this->getDbo();
     $query = $db->getQuery(true);
     // Select the required fields from the table.
     $query->select($this->getState('list.select', 'a.*'));
     $query->from('`#__kart_zone` AS a');
     $query->select("s.title");
     $query->JOIN("LEFT", '#__kart_store AS s ON s.id = a.store_id');
     // Filter by published state
     $published = $this->getState('filter.state');
     if (is_numeric($published)) {
         $query->where('a.state = ' . (int) $published);
     } elseif ($published === '') {
         $query->where('(a.state IN (0, 1))');
     }
     $filter_store = $this->getState('filter.sel_store');
     if ($filter_store) {
         $query->where('a.store_id = ' . $filter_store);
     } else {
         // Getting user accessible store ids
         $storeHelper = new storeHelper();
         // Get all stores.
         $user = JFactory::getUser();
         $storeList = $storeHelper->getUserStore($user->id);
         $storeIds = array();
         foreach ($storeList as $store) {
             $storeIds[] = $store['id'];
         }
         $accessibleStoreIds = '';
         // Make string
         if (!empty($storeIds)) {
             $accessibleStoreIds = implode(',', $storeIds);
             $query->where('(a.store_id IN (' . $accessibleStoreIds . '))');
         } else {
             $query->where('a.store_id = -1');
         }
     }
     // Filter by search in title
     $search = $this->getState('filter.search');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('a.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->Quote('%' . $db->escape($search, true) . '%');
             $query->where('(a.name LIKE ' . $search . ')');
         }
     }
     // Add the list ordering clause.
     $orderCol = $this->state->get('list.ordering');
     $orderDirn = $this->state->get('list.direction');
     if ($orderCol && $orderDirn) {
         $query->order($db->escape($orderCol . ' ' . $orderDirn));
     }
     return $query;
 }
Exemplo n.º 15
0
/**
 * @version    SVN: <svn_id>
 * @package    Quick2cart
 * @author     Techjoomla <*****@*****.**>
 * @copyright  Copyright (c) 2009-2015 TechJoomla. All rights reserved.
 * @license    GNU General Public License version 2 or later.
 */
// No direct access.
defined('_JEXEC') or die;
// DECLARATION SECTION
$classes = !empty($qtc_classes) ? $classes : '';
$max_scroll_ht = !empty($qtc_mod_scroll_height) ? trim($qtc_mod_scroll_height) . 'px' : '412px';
$scroll_style = "overflow-y:auto; max-height:" . $max_scroll_ht . "; overflow-x:hidden;";
$mainframe = JFactory::getApplication();
$storeHelper = new storeHelper();
$comquick2cartHelper = new comquick2cartHelper();
// CONVERTING TO OBJECT
$options = json_decode(json_encode($options), false);
// GETTING ITEM ID
$menu_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=default');
?>

<div class="row-fluid qtc_store_list <?php 
echo $classes;
?>
" style="<?php 
echo $scroll_style;
?>
">
	<div class="span12">
Exemplo n.º 16
0
        // For store releated views
        if (!empty($this->storeReleatedView)) {
            if (!empty($this->store_role_list)) {
                $active = 'storeorders';
                $view = $this->comquick2cartHelper->getViewpath('vendor', 'toolbar');
                ob_start();
                include $view;
                $html = ob_get_contents();
                ob_end_clean();
                echo $html;
                ?>

						<legend>
							<?php 
                if (!empty($this->store_role_list)) {
                    $storehelp = new storeHelper();
                    $index = $storehelp->array_search2d($this->store_id, $this->store_role_list);
                    if (is_numeric($index)) {
                        $store_name = $this->store_role_list[$index]['title'];
                    }
                    echo JText::sprintf('QTC_STORE_ORDERS_OWN', $store_name);
                } else {
                    echo JText::_('QTC_STORE_ORDERS');
                }
                ?>
						</legend>
					<?php 
            } else {
                ?>
						<legend><strong><?php 
                echo JText::_('QTC_STORE_CUS_ORDERS');
Exemplo n.º 17
0
 /**
  * This function load data which is require for creatshipmeth layout (INTERNAL USE ONLY).
  *
  * @param   object  $jinput  Joomla's jinput Object.
  *
  * @since   2.2
  * @return   Layoutdata.
  */
 function ViewDataForShipmethListView($jinput)
 {
     $storeHelper = new storeHelper();
     // Get all stores.
     $user = JFactory::getUser();
     $storeList = $storeHelper->getUserStore($user->id);
     $storeIds = array();
     foreach ($storeList as $store) {
         $storeIds[] = $store['id'];
     }
     $accessibleStoreIds = '';
     if (!empty($storeIds)) {
         $accessibleStoreIds = implode(',', $storeIds);
     }
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select(" id AS methodId,name,taxprofileId,state,shipping_type,min_value,max_value")->from('#__kart_zoneShipMethods');
     $query->where('(store_id IN (' . $accessibleStoreIds . '))');
     $db->setQuery((string) $query);
     $data = $db->loadAssocList();
     return $data;
 }
Exemplo n.º 18
0
    /**
     * Method to delete a row from the database table by primary key value.
     *
     * @param   mixed  $pk  An optional primary key value to delete.  If not set the instance property value is used.
     *
     * @return  boolean  True on success.
     *
     * @link    http://docs.joomla.org/JTable/delete
     * @since   11.1
     * @throws  UnexpectedValueException
     */
    public function delete($pk = null)
    {
        $storeHelper = new storeHelper();
        /*$this->load($pk);
        		//$result = parent::delete($pk);
        
        		if ($result)
        		{
        		}
        		return $result;
        		*/
        if (is_array($pk)) {
            foreach ($pk as $pkid) {
                $entryStatus = $storeHelper->isAllowedToDelStore($pkid);
                if ($entryStatus === true) {
                    $query = $this->_db->getQuery(true);
                    //@TODO use query builder
                    $query = 'DELETE
					 FROM `#__kart_role`, `#__kart_store`
					 USING `#__kart_store`
					 INNER JOIN `#__kart_role`
					 WHERE `#__kart_store`.id = `#__kart_role`.store_id
					 AND `#__kart_store`.id = ' . $pkid;
                    $this->_db->setQuery($query);
                    try {
                        $this->_db->execute();
                    } catch (RuntimeException $e) {
                        $this->setError($e->getMessage());
                        return false;
                    }
                }
            }
        } else {
            $entryStatus = $storeHelper->isAllowedToDelStore($pk);
            if ($entryStatus === true) {
                $query = $this->_db->getQuery(true);
                //@TODO use query builder
                $query = 'DELETE
				 FROM `#__kart_role`, `#__kart_store`
				 USING `#__kart_store`
				 INNER JOIN `#__kart_role`
				 WHERE `#__kart_store`.id = `#__kart_role`.store_id
				 AND `#__kart_store`.id = ' . $pk;
                $this->_db->setQuery($query);
                try {
                    $this->_db->execute();
                } catch (RuntimeException $e) {
                    $this->setError($e->getMessage());
                    return false;
                }
            } else {
                return false;
            }
        }
        return true;
    }
Exemplo n.º 19
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->params = JComponentHelper::getParams('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     $storeHelper = new storeHelper();
     $model = $this->getModel('vendor');
     $mainframe = JFactory::getApplication();
     $input = $mainframe->input;
     $option = $input->get('option');
     $task = $input->get('task');
     $layout = $input->get('layout', 'cp');
     $this->adminCall = $adminCall = $input->get('adminCall', 0, 'INTEGER');
     $store_id = $input->get('store_id', '0');
     $this->storeinfo = '';
     if ($layout != "contactus") {
         $specialAccess = 0;
         if ($layout == "createstore") {
             $user = JFactory::getUser();
             if (!$user->id) {
                 echo "<div class=\"techjoomla-bootstrap\" >\n\t\t\t\t\t<div class=\"well\" >\n\t\t\t\t\t\t<div class=\"alert alert-error\">\n\t\t\t\t\t\t\t<span >" . JText::_('QTC_LOGIN') . " </span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>";
                 return false;
             }
             if (!empty($adminCall)) {
                 $specialAccess = $comquick2cartHelper->isSpecialAccess();
             }
         }
         // Check for multivender COMPONENT PARAM
         $isMultivenderOFFmsg = $comquick2cartHelper->isMultivenderOFF();
         if (!empty($isMultivenderOFFmsg)) {
             if (!empty($adminCall)) {
                 // CALLED FROM ADMIN
                 if ($specialAccess == 0) {
                     echo $this->specialAccessMsg();
                     return false;
                 }
             } else {
                 print $isMultivenderOFFmsg;
                 return false;
             }
         }
     }
     /*if($layout=="default")
     		{
     		$this->site=1;
     		$filter_order_Dir	= $mainframe->getUserStateFromRequest( "$option.filter_order_Dir",	'filter_order_Dir',	'desc',			'word' );
     		$filter_type		= $mainframe->getUserStateFromRequest( "$option.filter_type",		'filter_type', 		0,			'string' );
     		$filter_state = $mainframe->getUserStateFromRequest( $option.'search_list', 'search_list', '', 'string' );
     		$search = $mainframe->getUserStateFromRequest( $option.'search', 'search','', 'string' );
     		$search = JString::strtolower( $search );
     		$limit = '';
     		$limitstart = '';
     		$cid[0]='';
     		if($search==null)
     		$search='';
     
     		$model	= $this->getModel( 'vendor' );
     		$task = $input->get('task');
     
     		$total 		= $model->getTotal();
     		$this->pagination = $pagination = $model->getPagination();
     
     		$this->storeinfo = $storeinfo = $comquick2cartHelper->getStoreDetail();
     
     		$lists['search_select']	= $search;
     		$lists['search']		= $search;
     		$lists['search_list']	= $filter_state;
     		$lists['order']			= $filter_type;
     		$lists['order_Dir']		= $filter_order_Dir;
     		$lists['limit']			= $limit;
     		$lists['limitstart']	= $limitstart;
     		$this->lists = $lists;
     
     		}// end of $layout=="mystores" if
     		else */
     if ($layout == "createstore") {
         $this->orders_site = 1;
         $store_id = $input->get('store_id', '0');
         // DEFAULT ALLOW TO CREAT STORE
         $this->allowToCreateStore = 1;
         // Means edit task
         if (!empty($store_id)) {
             $this->store_authorize = $comquick2cartHelper->store_authorize("vendor_createstore", $store_id);
             $this->editview = 1;
             $this->storeinfo = $storeinfo = $comquick2cartHelper->editstore($store_id);
             // Get weight and length select box
             $this->legthList = $storeHelper->getLengthClassSelectList($storeid = 0, $this->storeinfo[0]->length_id);
             $this->weigthList = $storeHelper->getWeightClassSelectList($storeid = 0, $this->storeinfo[0]->weight_id);
         } else {
             // NEW STORE TASK:: CK FOR WHETHER WE HV TO ALLOW OR NOT
             $storeHelper = new storeHelper();
             $this->allowToCreateStore = $storeHelper->isAllowedToCreateNewStore();
             // Get weight and length select box
             $this->legthList = $storeHelper->getLengthClassSelectList($storeid = 0, 0);
             $this->weigthList = $storeHelper->getWeightClassSelectList($storeid = 0, 0);
         }
         // START Q2C Sample development
         $dispatcher = JDispatcher::getInstance();
         JPluginHelper::importPlugin('system');
         $result = $dispatcher->trigger('qtcOnBeforeCreateStore', array($store_id));
         // Call the plugin and get the result
         $beforecart = '';
         $OnBeforeCreateStore = '';
         if (!empty($result)) {
             // If more than one plugin returns
             // $OnBeforeCreateStore = $result[0];
             // $OnBeforeCreateStore = join('', $result);
             $OnBeforeCreateStore = trim(implode("\n", $result));
         }
         $this->OnBeforeCreateStore = $OnBeforeCreateStore;
     } elseif ($layout == "managestore") {
         $this->storeDetailInfo = $comquick2cartHelper->getSoreInfoInDetail($store_id);
     } elseif ($layout == "cp") {
         $this->catpage_Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=category');
         $this->orders_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders');
         $this->store_customers_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders&layout=mycustomer');
         $user = JFactory::getUser();
         if ($user->id) {
             // Chck whetere there is any product or not
             // Retrun store_id,role etc with order by role,store_id
             $this->store_role_list = $store_role_list = $comquick2cartHelper->getStoreIds();
             // Store_id is changed from manage storeorder view
             $change_storeto = $input->get('change_store', '');
             // When chage store,get latest storeid otherwise( on first load) set first storeid as default
             $firstStore = !empty($store_role_list[0]['store_id']) ? $store_role_list[0]['store_id'] : '';
             $this->store_id = $store_id = !empty($change_storeto) ? $change_storeto : $firstStore;
         }
         if (!empty($this->store_id)) {
             $this->prodcountprodCount = $model->storeProductCount($this->store_id);
             // $allincome = $this->get( 'AllOrderIncome');
             $this->getPeriodicIncomeGrapthData = $model->getPeriodicIncomeGrapthData($store_id);
             // Get revenue ,total order, and qty
             $this->getPeriodicIncome = $model->getPeriodicIncome($store_id);
             // GETTING TOATL SALES
             $this->totalSales = $model->getTotalSales($store_id);
             // GETTING TOtal orders
             $this->totalOrdersCount = $model->getTotalOrdersCount($store_id);
             // GETTING LAST 5 ORDERS
             $this->last5orders = $model->getLast5orders($store_id);
             // Getting store detail
             $this->storeDetailInfo = $comquick2cartHelper->getSoreInfoInDetail($store_id);
             // Get customer count for store.
             $this->storeCustomersCount = $model->getStoreCustomersCount($store_id);
             // Get top seller products.
             $product_path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
             if (!class_exists('productHelper')) {
                 JLoader::register('productHelper', $product_path);
                 JLoader::load('productHelper');
             }
             $productHelper = new productHelper();
             $this->topSellerProducts = $productHelper->getTopSellerProducts($store_id, '', 5);
         }
     } elseif ($layout == "store") {
         global $mainframe;
         $mainframe = JFactory::getApplication();
         $jinput = $mainframe->input;
         // Store_id is changed from  STORE view
         // $change_storeto= $mainframe->getUserStateFromRequest( 'current_store', 'current_store','', 'INTEGER' );
         $this->change_prod_cat = $jinput->get('store_cat', '', 'INTEGER');
         // GET STORE ID
         $this->store_id = $store_id = $input->get('store_id');
         // RESET ENTITIES
         // $mainframe->setUserState('store_cat', '');
         if (!empty($this->store_id)) {
             $this->storeDetailInfo = $comquick2cartHelper->getSoreInfoInDetail($store_id);
             // ALL FETCH ALL CATEGORIES
             $storeHelper = new storeHelper();
             $this->cats = $storeHelper->getStoreCats($this->store_id, $this->change_prod_cat, 1, 'store_cat');
             // FETCH ALL STORE PRODUCT
             JLoader::import('store', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
             $model = new Quick2cartModelstore();
             $this->allStoreProd = $model->getAllStoreProducts('com_quick2cart', $this->store_id);
             $pagination = $model->getPagination('com_quick2cart', $this->store_id);
             $this->pagination = $pagination;
         }
     } elseif ($layout == "contactus") {
         $this->store_id = $input->get('store_id', '0', 'INTEGER');
         $this->item_id = $input->get('item_id', '0', 'INTEGER');
     } elseif ($layout == "storeinfo") {
         $this->store_id = $input->get('store_id');
         if (!empty($this->store_id)) {
             $this->storeDetailInfo = $comquick2cartHelper->getSoreInfoInDetail($this->store_id);
         }
     }
     $this->_setToolBar();
     parent::display($tpl);
 }
Exemplo n.º 20
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 function display($tpl = null)
 {
     $this->params = JComponentHelper::getParams('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     $storeHelper = new storeHelper();
     $this->addToolbar();
     $mainframe = JFactory::getApplication();
     $input = $mainframe->input;
     $option = $input->get('option');
     $layout = $input->get('layout', 'createstore');
     if ($layout == "createstore") {
         $this->orders_site = 1;
         $store_id = $input->get('store_id', '0');
         // DEFAULT ALLOW TO CREAT STORE
         $this->allowToCreateStore = 1;
         // Means edit task
         if (!empty($store_id)) {
             // $this->store_authorize=$comquick2cartHelper->store_authorize("vendor_createstore",$store_id);
             $this->editview = 1;
             $this->storeinfo = $storeinfo = $comquick2cartHelper->editstore($store_id);
             // Get weight and length select box
             $this->legthList = $storeHelper->getLengthClassSelectList(0, $this->storeinfo[0]->length_id);
             $this->weigthList = $storeHelper->getWeightClassSelectList(0, $this->storeinfo[0]->weight_id);
         } else {
             // NEW STORE TASK:: CK FOR WHETHER WE HV TO ALLOW OR NOT
             $storeHelper = new storeHelper();
             //$this->allowToCreateStore=$storeHelper->isAllowedToCreateNewStore();
             // Get weight and length select box
             $this->legthList = $storeHelper->getLengthClassSelectList();
             $this->weigthList = $storeHelper->getWeightClassSelectList();
         }
         //START Q2C Sample development
         $dispatcher = JDispatcher::getInstance();
         JPluginHelper::importPlugin('system');
         //Call the plugin and get the result
         $result = $dispatcher->trigger('qtcOnBeforeCreateStore', array($store_id));
         $beforecart = '';
         $OnBeforeCreateStore = '';
         if (!empty($result)) {
             $OnBeforeCreateStore = $result[0];
         }
         $this->OnBeforeCreateStore = $OnBeforeCreateStore;
     }
     /*else
     		{
     			//for list view
     			$filter_order_Dir	= $mainframe->getUserStateFromRequest( "$option.filter_order_Dir",	'filter_order_Dir',	'desc',			'word' );
     			$filter_type		= $mainframe->getUserStateFromRequest( "$option.filter_type",		'filter_type', 		0,			'string' );
     			$filter_state = $mainframe->getUserStateFromRequest( $option.'search_list', 'search_list', '', 'string' );
     			$search = $mainframe->getUserStateFromRequest( $option.'search', 'search','', 'string' );
     			$search = JString::strtolower( $search );
     			$limit = '';
     			$limitstart = '';
     			$cid[0]='';
     
     			if($search==null)
     				$search='';
     
     			$model	= $this->getModel( 'vendor' );
     			$task = $input->get('task');
     
     			$comquick2cartHelper = new comquick2cartHelper;
     			//$this->storeinfo=$storeinfo=$comquick2cartHelper->getStoreDetail();
     
     			$total 		= $model->getTotal();
     			$this->pagination=$pagination = $model->getPagination();
     			$this->storeinfo=$storeinfo= $model->getVendors();
     
     
     
     			// search filter
     			$lists['search_select']	= $search;
     			$lists['search']		= $search;
     			$lists['search_list']	= $filter_state;
     			$lists['order']			= $filter_type;
     			$lists['order_Dir']		= $filter_order_Dir;
     			$lists['limit']			= $limit;
     			$lists['limitstart']	= $limitstart;
     			$this->lists=$lists;
     		}*/
     // end of else
     // FOR DISPLAY SIDE FILTER
     if (JVERSION >= '3.0') {
         $this->sidebar = JHtmlSidebar::render();
     }
     parent::display($tpl);
 }
Exemplo n.º 21
0
			<div id="q2c_pc_es_app_my_products">
				<?php 
    foreach ($products as $data) {
        $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'views' . DS . 'product' . DS . 'tmpl' . DS . 'product.php';
        ob_start();
        include $path;
        $html = ob_get_contents();
        ob_end_clean();
        echo $html;
    }
    ?>
			</div>

			<?php 
    if ($productsCount > $total) {
        $storeHelper = new storeHelper();
        $storeLink = $storeHelper->getStoreLink($firstStore);
        ?>
				<div class="pull-right">
					<a href="<?php 
        echo $storeLink;
        ?>
"><?php 
        echo JText::_('APP_Q2CMYPRODUCTS_SHOW_ALL') . " (" . $productsCount . ")";
        ?>
</a>
				</div>
			<?php 
    }
    ?>
    $doc = JFactory::getDocument();
    $lang = JFactory::getLanguage();
    $lang->load('mod_qtcstoredisplay', JPATH_SITE);
    // GETTING MODULE PARAMS
    $prodLimit = $params->get('limit', 2);
    // $modSufx=$params->get('moduleclass_sfx');
    $model = new productHelper();
    $module_mode = $params->get('module_mode', 'qtc_latestStore');
    $qtc_modViewType = $params->get('qtc_modViewType', 'qtc_blockView');
    $qtc_mod_scroll_height = $params->get('scroll_height');
    if (!empty($module_mode)) {
        switch ($module_mode) {
            case 'qtc_latestStore':
                $target_data = $model->getLatestStore($prodLimit);
                break;
            case 'qtc_bestSellerStore':
                $target_data = $model->getTopSellerStore($prodLimit);
                break;
            case 'qtc_storeList':
                // $target_data = $model->getRecentlyBoughtproducts($prodLimit);
                // LOAD ALL STORE
                $storeHelper = new storeHelper();
                $target_data = $storeHelper->getStoreList();
                break;
        }
    }
    if (empty($target_data)) {
        return false;
    }
    require JModuleHelper::getLayoutPath('mod_qtcstoredisplay');
}
Exemplo n.º 23
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->params = JComponentHelper::getParams('com_quick2cart');
     $mainframe = JFactory::getApplication();
     $input = $mainframe->input;
     $option = $input->get('option');
     $layout = $input->get('layout', 'default');
     $this->comquick2cartHelper = new comquick2cartHelper();
     $this->productHelper = new productHelper();
     $storeHelper = new storeHelper();
     $productHelper = new productHelper();
     if ($layout == 'default') {
         $this->products = $this->items = $this->get('Items');
         $this->pagination = $this->get('Pagination');
         $this->state = $this->get('State');
         $this->filterForm = $this->get('FilterForm');
         $this->activeFilters = $this->get('ActiveFilters');
         // Creating status filter.
         $sstatus = array();
         if (JVERSION < '3.0') {
             $sstatus[] = JHtml::_('select.option', '', JText::_('JOPTION_SELECT_PUBLISHED'));
             $sstatus[] = JHtml::_('select.option', 1, JText::_('COM_QUICK2CART_PUBLISH'));
             $sstatus[] = JHtml::_('select.option', 0, JText::_('COM_QUICK2CART_UNPUBLISH'));
             $this->sstatus = $sstatus;
         }
         // Create clients array
         $clients = array();
         if (JVERSION < '3.0') {
             $clients[] = JHtml::_('select.option', '', JText::_('COM_QUICK2CART_FILTER_SELECT_CLIENT'));
             $clients[] = JHtml::_('select.option', 'com_quick2cart', JText::_('COM_QUICK2CART_NATIVE'));
             $clients[] = JHtml::_('select.option', 'com_content', JText::_('COM_QUICK2CART_CONTENT_ARTICLES'));
             $clients[] = JHtml::_('select.option', 'com_flexicontent', JText::_('COM_QUICK2CART_FLEXICONTENT'));
             $clients[] = JHtml::_('select.option', 'com_k2', JText::_('COM_QUICK2CART_K2'));
             $clients[] = JHtml::_('select.option', 'com_zoo', JText::_('COM_QUICK2CART_ZOO'));
             $this->clients = $clients;
         }
         // Get all stores.
         $this->store_details = $this->comquick2cartHelper->getAllStoreDetails();
     } elseif ($layout == "new") {
         // @TODO ADD CONDITION :: LOGGED IN USER MUST HV STORE
         // Gettting store id if store is changed
         $user = JFactory::getUser();
         global $mainframe;
         $mainframe = JFactory::getApplication();
         $change_storeto = $mainframe->getUserStateFromRequest('current_store', 'current_store', 0, 'INTEGER');
         // Get item_id from request from GET/POST
         $item_id = $mainframe->getUserStateFromRequest('item_id', 'item_id', '', 'STRING');
         // REMOVE FROM REQUEST
         $mainframe->setUserState('item_id', '');
         $this->client = $client = "com_quick2cart";
         $this->pid = 0;
         // LOAD CART MODEL
         $Quick2cartModelcart = $this->comquick2cartHelper->loadqtcClass(JPATH_SITE . "/components/com_quick2cart/models/cart.php", "Quick2cartModelcart");
         // If item_id NOT found then SET TO ''
         $this->item_id = '';
         // If edit task then fetch item DETAILS
         if (!empty($item_id)) {
             // Check whether called from backend
             $admin_call = $mainframe->getUserStateFromRequest('admin_call', 'admin_call', 0, 'INTEGER');
             if (!empty($admin_call)) {
                 // CHECK SPECIAL ACCESS
                 $special_access = $this->comquick2cartHelper->isSpecialAccess();
             }
             // Load Attributes model
             $path = '/components/com_quick2cart/models/attributes.php';
             $attri_model = $this->comquick2cartHelper->loadqtcClass(JPATH_SITE . $path, "quick2cartModelAttributes");
             // GET ITEM DETAIL
             $this->itemDetail = $itemDetail = $attri_model->getItemDetail(0, '', $item_id);
             // Getting attribure
             $this->item_id = !empty($this->itemDetail) ? $itemDetail['item_id'] : '';
             $this->allAttribues = $attri_model->getItemAttributes($this->item_id);
             $this->getMediaDetail = $productHelper->getMediaDetail($item_id);
             $this->store_id = $store_id = $this->store_role_list = $this->itemDetail['store_id'];
         } else {
             $storeHelper = new storeHelper();
             $storeList = (array) $storeHelper->getUserStore($user->id);
             $this->store_id = $storeList[0]['id'];
         }
         // IF ITEM_ID AND SPECIAL ACCESS EG ADMIN THEN FETCH STORE ID // means edit task
         // Else :
         if (!empty($item_id) && !empty($special_access)) {
             // WE DONT WANT TO SHOW STORE SELECT LIST
             $this->store_id = $store_id = $this->store_role_list = $this->itemDetail['store_id'];
         } else {
             $this->store_role_list = $store_role_list = $this->comquick2cartHelper->getStoreIds();
             // as no NEED TO CHECK AUTHORIZATION AT ADMINSIDE
             $storeHelper = new storeHelper();
             $this->defaultStoreId = $defaultStoreId = $storeHelper->getAdminDefaultStoreId();
             // get all store ids of vendor
             //	$this->authorized_store_id = $comquick2cartHelper->store_authorize("managecoupon_default",isset($change_storeto)?$change_storeto:$store_role_list[0]['store_id']);
             $this->store_id = $store_id = !empty($change_storeto) ? $change_storeto : $defaultStoreId;
             $this->selected_store = $store_id;
             if (!$this->store_id) {
                 $user = JFactory::getUser();
                 $storeHelper = $comquick2cartHelper->loadqtcClass(JPATH_SITE . DS . "components" . DS . "com_quick2cart" . DS . "helpers" . DS . "storeHelper.php", "storeHelper");
                 $storeList = (array) $storeHelper->getUserStore($user->id);
                 $this->store_id = $storeList[0]['id'];
             }
         }
         // ALL FETCH ALL CATEGORIES //$catid='',$onchangeSubmitForm=1,$name='prod_cat',$class=''
         if (!empty($this->itemDetail['category'])) {
             $this->cats = $this->comquick2cartHelper->getQ2cCatsJoomla($this->itemDetail['category'], 0, 'prod_cat', ' required ');
         } else {
             $this->cats = $this->comquick2cartHelper->getQ2cCatsJoomla('', 0, 'prod_cat', ' required ');
         }
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     if (JVERSION >= '3.0') {
         $this->sidebar = JHtmlSidebar::render();
     }
     parent::display($tpl);
 }
Exemplo n.º 24
0
    echo JText::_('QTC_PRODUCT_TOTAL');
    ?>
</strong></td>
					<td class="cartitem_tprice" <?php 
    echo $price_col_style;
    ?>
><span
						id="cop_discount"><?php 
    echo $this->comquick2cartHelper->getFromattedPrice(number_format($tprice, 2), $order_currency);
    ?>
</span></td>
				</tr>
				<?php 
    // if not store releated view ( SHOW Comission cut & Value recd)
    if (!empty($this->storeReleatedView)) {
        $storeHelper = new storeHelper();
        $commission = $params->get('commission');
        $commission_cutPrice = $storeHelper->totalCommissionApplied($tprice);
        $commission_cutNetPrice = (double) $tprice - $commission_cutPrice;
        ?>
					<!-- Commission price -->
					<tr>
						<td colspan="<?php 
        echo $col;
        ?>
"></td>
						<td class="cartitem_tprice_label" align="left"><strong><?php 
        echo sprintf(JText::_('QTC_COMMISSION_CUT_SUB_TOT'), '(' . $commission . '%)');
        ?>
 	</strong></td>
						<td class="cartitem_tprice" <?php 
Exemplo n.º 25
0
<?php

/**
 * @version    SVN: <svn_id>
 * @package    Quick2cart
 * @author     Techjoomla <*****@*****.**>
 * @copyright  Copyright (c) 2009-2015 TechJoomla. All rights reserved.
 * @license    GNU General Public License version 2 or later.
 */
// No direct access.
defined('_JEXEC') or die;
$storeHelper = new storeHelper();
?>


<?php 
// Taxprofile and ship profile
$isShippingEnabled = $this->params->get('shipping', 0);
$isTaxationEnabled = $this->params->get('enableTaxtion', 0);
?>

<!--  Length and weight unit  -->
<div class="control-group">
	<label for="qtc_length_class" class="control-label"><?php 
echo JHtml::tooltip(JText::_('COM_QUICK2CART_LENGTH_VENDOR_UNIT_DESC'), JText::_('COM_QUICK2CART_LENGTH_VENDOR_UNIT'), '', JText::_('COM_QUICK2CART_LENGTH_VENDOR_UNIT'));
?>
	</label>
	<div class="controls">
		<?php 
if (!empty($this->legthList)) {
    echo $this->legthList;
Exemplo n.º 26
0
JLoader::import('store', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
$store_model = new Quick2cartModelstore();
$owner = isset($owner) ? $owner : 0;
//$store_id = $store_model->getStoreId($owner);
$store_role_list = $storeList = $this->comquick2cartHelper->getStoreIds($owner);
if (!empty($store_role_list)) {
    $this->store_id = $store_id = !empty($change_storeto) ? $change_storeto : $store_role_list[0]['store_id'];
}
$app = JFactory::getApplication();
$path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'storeHelper.php';
if (!class_exists('storeHelper')) {
    //require_once $path;
    JLoader::register('storeHelper', $path);
    JLoader::load('storeHelper');
}
$storeHelper = new storeHelper();
if ($app->isAdmin() && empty($change_storeto)) {
    $this->store_id = $store_id = $storeHelper->getAdminDefaultStoreId();
}
/*if ($app->isAdmin())
	{

		// If logged in from front end then store not found against user For now user have to have store
		//$this->store_id = $store_id = $storeHelper->getAdminDefaultStoreId();
		//@TODO @vidyasagar check this once
		$this->store_id = $store_id = $comquick2cartHelper->getStoreIds();

	}else{

		$this->store_role_list=$store_role_list=$comquick2cartHelper->getStoreIds();
		if (!empty($this->store_role_list))
Exemplo n.º 27
0
 function display($tpl = null)
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $input = JFactory::getApplication()->input;
     $layout = $input->get('layout', 'default');
     $option = $input->get('option', '');
     $this->params = JFactory::getApplication()->getParams('com_quick2cart');
     // check for multivender COMPONENT PARAM
     // vm: commented for task #20773
     /*	$isMultivenderOFFmsg=$comquick2cartHelper->isMultivenderOFF();
     		if(!empty($isMultivenderOFFmsg))
     		{
     			print $isMultivenderOFFmsg;
     			return false;
     		}*/
     if ($layout == 'default') {
         // product page
         //DECLARATION SECTION
         $this->client = $client = "com_quick2cart";
         $this->pid = 0;
         $this->item_id = $item_id = $input->get('item_id', '');
         JLoader::import('cart', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
         $model = new Quick2cartModelcart();
         if (empty($item_id)) {
             // # if entry is not present in kart_item
             return false;
         }
         // retrun store_id,role etc with order by role,store_id
         $this->store_role_list = $comquick2cartHelper->getStoreIds();
         // GETTING AUTHORIZED STORE ID
         $storeHelper = new storeHelper();
         $this->store_list = $storeHelper->getuserStoreList();
         // GETTING PRICE
         $this->price = $price = $model->getPrice($item_id, 1);
         // return array of price
         //GETTING ITEM COMPLEATE DETAIL (attributes and its option wil get)
         //$itemDetail=$model->getItemCompleteDetail($item_id);
         //getting stock min max,cat,store_id
         $this->itemdetail = $model->getItemRec($item_id);
         if (!empty($this->itemdetail)) {
             ///get attributes
             $this->attributes = $model->getAttributes($item_id);
             // for RELEATED PROD FROM CATEGORY
             $product_path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
             if (!class_exists('productHelper')) {
                 //require_once $path;
                 JLoader::register('productHelper', $product_path);
                 JLoader::load('productHelper');
             }
             $productHelper = new productHelper();
             // get free products media file
             $this->mediaFiles = $productHelper->getProdmediaFiles($item_id);
             $this->prodFromCat = $productHelper->getSimilarProdFromCat($this->itemdetail->category, $this->item_id);
             $this->prodFromSameStore = $productHelper->prodFromSameStore($this->itemdetail->store_id, $this->item_id);
             $this->peopleAlsoBought = $productHelper->peopleAlsoBought($this->item_id);
             $this->peopleWhoBought = $productHelper->peopleWhoBought($this->item_id);
             //print_r($this->peopleWhoBought);die;
             $social_options = '';
             $route = $comquick2cartHelper->getProductLink($this->item_id);
             // Jilke
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('system');
             $result = $dispatcher->trigger('onProductDisplaySocialOptions', array($this->item_id, 'com_quick2cart.productpage', $this->itemdetail->name, $route));
             //Call the plugin and get the result
             if (!empty($result)) {
                 $social_options = $result[0];
             }
             $this->social_options = $social_options;
             $this->showBuyNowBtn = $productHelper->isInStockProduct($this->itemdetail);
         }
     } elseif ($layout == 'popupslide') {
         $this->item_id = $item_id = $input->get('qtc_prod_id', '');
         JLoader::import('cart', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
         $model = new Quick2cartModelcart();
         if (empty($item_id)) {
             // # if entry is not present in kart_item
             return false;
         }
         $this->itemdetail = $model->getItemRec($item_id);
     }
     $this->item = $this->itemdetail;
     $this->_prepareDocument();
     parent::display($tpl);
 }
Exemplo n.º 28
0
 /**
  * $res is an object
  * */
 function addPayoutEntry($order_id, $txnid, $status, $pg_plugin)
 {
     // GET BUSINESS EMAIL
     $plugin = JPluginHelper::getPlugin('payment', $pg_plugin);
     $pluginParams = json_decode($plugin->params);
     $businessPayEmial = "";
     if (property_exists($pluginParams, 'business')) {
         $businessPayEmial = trim($pluginParams->business);
     } else {
         return array();
     }
     $params = JComponentHelper::getParams('com_quick2cart');
     $send_payments_to_owner = $params->get('send_payments_to_owner', 0);
     if ($pg_plugin == 'adaptive_paypal') {
         $comquick2cartHelper = new comquick2cartHelper();
         $storeHelper = new storeHelper();
         $adaptiveDetails = $storeHelper->getorderItemsStoreInfo($order_id);
         $Quick2cartModelReports = $comquick2cartHelper->loadqtcClass(JPATH_SITE . "/components/com_quick2cart/models/reports.php", 'Quick2cartModelReports');
         $reportStatus = $status == 'C' ? 1 : 0;
         foreach ($adaptiveDetails as $userReport) {
             $Quick2cartModelpayment = new Quick2cartModelpayment();
             $payDetail = $Quick2cartModelpayment->getPayoutId($txnid, $userReport['owner']);
             if (!empty($payDetail) && $payDetail['status'] == $reportStatus) {
                 // payout already present mean $payDetail will not empty AND STATUS is same then dont process.
                 // for new payout,thisl will not process
                 break;
             }
             $post = array();
             $post['id'] = empty($payDetail['id']) ? '' : $payDetail['id'];
             $post['user_id'] = $userReport['owner'];
             $post['payee_name'] = $comquick2cartHelper->getUserName($post['user_id']);
             $post['paypal_email'] = $userReport['store_email'];
             $post['transaction_id'] = $txnid;
             $post['payment_amount'] = $userReport['commissonCutPrice'];
             $post['payout_date'] = date('Y-m-d');
             $post['status'] = $reportStatus;
             $post['payment_comment'] = "adaptive pay";
             $Quick2cartModelReports->savePayout($post);
         }
     }
 }
Exemplo n.º 29
0
 function csvexport()
 {
     $model = $this->getModel("vendor");
     $CSVData = $model->getCsvexportData();
     $filename = "SalesPerSellerReport_" . date("Y-m-d");
     $csvData = null;
     //$csvData.= "Item_id;Product Name;Store Name;Store Id;Sales Count;Amount;Created By;";
     $headColumn = array();
     $headColumn[0] = JText::_('COM_QUICK2CART_SALESPERSELLER_STORENAME');
     $headColumn[1] = JText::_('COM_QUICK2CART_SALESPERSELLER_VENDORNAME');
     // 'Product Name';
     $headColumn[2] = JText::_('COM_QUICK2CART_SALESPERSELLER_STATUS');
     $headColumn[3] = JText::_('COM_QUICK2CART_SALESPERSELLER_EMAIL');
     $headColumn[4] = JText::_('COM_QUICK2CART_SALESPERSELLER_PHONE');
     $headColumn[5] = JText::_('COM_QUICK2CART_SALESPERSELLER_SALE');
     $csvData .= implode(";", $headColumn);
     $csvData .= "\n";
     header("Content-type: application/vnd.ms-excel");
     header("Content-disposition: csv" . date("Y-m-d") . ".csv");
     header("Content-disposition: filename=" . $filename . ".csv");
     if (!empty($CSVData)) {
         $storeHelper = new storeHelper();
         foreach ($CSVData as $data) {
             $csvrow = array();
             $csvrow[0] = '"' . $data['title'] . '"';
             $csvrow[1] = '"' . $data['username'] . '"';
             if ($data['published'] == 1) {
                 $status = JText::_('COM_QUICK2CART_PUBLISH');
             } else {
                 $status = JText::_('COM_QUICK2CART_UNPUBLISH');
             }
             $csvrow[2] = '"' . $status . '"';
             $csvrow[3] = '"' . $data['store_email'] . '"';
             $csvrow[4] = '"' . $data['phone'] . '"';
             $storeHelper = new storeHelper();
             $comquick2cartHelper = new comquick2cartHelper();
             $total_sale = $storeHelper->getTotalSalePerStore($data['id']);
             if ($total_sale) {
                 $sale = $comquick2cartHelper->getFromattedPrice($total_sale);
             }
             $csvrow[5] = '"' . $sale . '"';
             $csvData .= implode(";", $csvrow);
             $csvData .= "\n";
         }
     }
     ob_clean();
     echo $csvData . "\n";
     jexit();
     $link = JUri::base() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=salespervendor', false), strlen(JUri::base(true)) + 1);
     $this->setRedirect($link);
 }
Exemplo n.º 30
0
echo $align_style;
?>
><b><?php 
echo JText::_('QTC_CART_TOTAL_PRICE');
?>
 </b></th>
					<!--<th width="5%"	align="left"></th>-->
				</tr>
			</thead>
	<tbody>
			<?php 
$tprice = 0;
$store_array = array();
$params = JComponentHelper::getParams('com_quick2cart');
$multivendor_enable = $params->get('multivendor');
$storeHelper = new storeHelper();
foreach ($cart_session as $cart) {
    ?>
			<?php 
    // IF MUTIVENDER ENDABLE
    if (!empty($multivendor_enable)) {
        if (!in_array($cart['store_id'], $store_array)) {
            $store_array[] = $cart['store_id'];
            $storeinfo = $helperobj->getSoreInfo($cart['store_id']);
            $storeLink = $storeHelper->getStoreLink($cart['store_id']);
            ?>
	<!-- STORE TITILE -->
					<tr class="info">
							<td colspan="5" ><strong><a href="<?php 
            echo $storeLink;
            ?>