Example #1
0
 function StoreAllAttribute($item_id, $allAttrib, $sku, $client)
 {
     // get  attributeid list FROM POST
     $attIdList = array();
     foreach ($allAttrib as $attributes) {
         if (!empty($attributes['attri_id'])) {
             $attIdList[] = $attributes['attri_id'];
         }
     }
     // DEL EXTRA ATTRIBUTES
     if (!class_exists('productHelper')) {
         // require while called from backend
         JLoader::register('productHelper', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php');
         JLoader::load('productHelper');
     }
     //THIS  DELETE db attributes which is not present now or removed
     $productHelper = new productHelper();
     $productHelper->deleteExtaAttribute($item_id, $attIdList);
     if (!class_exists('quick2cartModelAttributes')) {
         // require while called from backend
         JLoader::register('quick2cartModelAttributes', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models' . DS . 'attributes.php');
         JLoader::load('quick2cartModelAttributes');
     }
     $quick2cartModelAttributes = new quick2cartModelAttributes();
     foreach ($allAttrib as $key => $attr) {
         $attr['sku'] = $sku;
         $attr['client'] = $client;
         $attr['item_id'] = $item_id;
         // Dont consider empty attributes
         if (!empty($attr['attri_name'])) {
             $quick2cartModelAttributes->store($attr);
         }
     }
 }
Example #2
0
 /**
  * Gives sales reports csv export.
  *
  * @since   2.2.2
  * @return   null.
  */
 public function csvexport()
 {
     $model = $this->getModel("salesreport");
     $CSVData = $model->getCsvexportData();
     $filename = "SalesReport_" . date("Y-m-d");
     $csvDataString = null;
     $headColumn = array();
     $headColumn[0] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ITEMID');
     $headColumn[1] = JText::_('COM_QUICK2CART_SALESREPORT_PROD_NAME');
     $headColumn[2] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_NAME');
     $headColumn[3] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ID');
     $headColumn[4] = JText::_('COM_QUICK2CART_SALESREPORT_SALES_COUNT');
     $headColumn[5] = JText::_('COM_QUICK2CART_SALESREPORT_AMOUNT');
     $headColumn[6] = JText::_('COM_QUICK2CART_SALESREPORT_CREATED_BY');
     $csvDataString .= implode(";", $headColumn);
     $csvDataString .= "\n";
     header("Content-type: application/vnd.ms-excel");
     header("Content-disposition: csv" . date("Y-m-d") . ".csv");
     header("Content-disposition: filename=" . $filename . ".csv");
     // Getting all store list
     $comquick2cartHelper = new comquick2cartHelper();
     $store_details = $comquick2cartHelper->getAllStoreDetails();
     $productHelper = new productHelper();
     if (!empty($CSVData)) {
         foreach ($CSVData as $data) {
             $store_id = $data['store_id'];
             $csvrow = array();
             $csvrow[0] = '"' . $data['item_id'] . '"';
             $csvrow[1] = '"' . $data['item_name'] . '"';
             $csvrow[2] = '""';
             if (!empty($store_details[$store_id])) {
                 $csvrow[2] = '"' . $store_details[$store_id]['title'] . '"';
             }
             $csvrow[3] = '"' . $data['store_id'] . '"';
             $csvrow[4] = '"' . $data['saleqty'] . '"';
             // GETTING PRODUCT PRICE
             $prodAttDetails = $productHelper->getProdPriceWithDefltAttributePrice($data['item_id']);
             // CONSIDERING FIELD DISCOUNT, NOT COUPON DISCOUNT
             $discountPrice = $prodAttDetails['itemdetail']['discount_price'];
             $prodBasePrice = !empty($discountPrice) ? $discountPrice : $prodAttDetails['itemdetail']['price'];
             $prodPrice = $prodBasePrice + $prodAttDetails['attrDetail']['tot_att_price'];
             $prodPrice = strip_tags($comquick2cartHelper->getFromattedPrice($prodPrice));
             $csvrow[5] = '"' . $prodPrice . '"';
             $csvrow[6] = '""';
             if (!empty($store_details[$store_id])) {
                 $csvrow[6] = '"' . $store_details[$store_id]['firstname'] . '"';
             }
             $csvDataString .= implode(";", $csvrow);
             $csvDataString .= "\n";
         }
     }
     ob_clean();
     echo $csvDataString . "\n";
     jexit();
     $link = 'index.php?option=com_quick2cart&view=salesreport';
     $this->setRedirect($link);
 }
Example #3
0
 /**
  * This function delete item / product
  *
  * @return : integer (1/0)
  * */
 function deleteProduct()
 {
     // load model attribute
     /*JLoader::import('attributes', JPATH_SITE.DS.'components'.DS.'com_quick2cart'.DS.'models');
     		$attrmodel =  new quick2cartModelAttributes();
     		*/
     $productHelper = new productHelper();
     $jinput = JFactory::getApplication()->input;
     $item_id = $jinput->get('item_id', '', 'INTEGETR');
     $res = $productHelper->deleteWholeProduct($item_id);
     $productHelper = new productHelper();
     $productHelper->deleteNotReqProdImages($item_id, '');
     if (!empty($res)) {
         echo 1;
     } else {
         echo 0;
     }
     jexit();
 }
 function _getquick2cartstoreHTML()
 {
     jimport('joomla.filesystem.file');
     if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
         $lang = JFactory::getLanguage();
         $lang->load('com_quick2cart', JPATH_SITE);
         $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php';
         if (!class_exists('comquick2cartHelper')) {
             //require_once $path;
             JLoader::register('comquick2cartHelper', $path);
             JLoader::load('comquick2cartHelper');
         }
         // Load assets
         comquick2cartHelper::loadQuicartAssetFiles();
         $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');
         }
         $params = $this->params;
         $no_of_stores = $params->get('no_of_stores', '2');
         //Get profile id
         $user = CFactory::getRequestUser();
         $model = new productHelper();
         $target_data = $model->getUserStores($user->_userid, $no_of_stores);
         if (!empty($target_data)) {
             $html = "\n\t\t\t\t<div class='techjoomla-bootstrap' >\n\t\t\t\t\t<div  class='row-fluid'>\n\t\t\t\t\t<ul class='thumbnails'  >\n\t\t\t\t\t";
             foreach ($target_data as $data) {
                 $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'views' . DS . 'vendor' . DS . 'tmpl' . DS . 'thumbnail.php';
                 //@TODO  condition vise mod o/p
                 ob_start();
                 include $path;
                 $html .= ob_get_contents();
                 ob_end_clean();
             }
             $html .= "\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
             return $html;
         }
     }
 }
Example #5
0
 /**
  * Amol change : Get order items info. This is used for order edit from backend
  *
  * @param   integer  $orderid  order id.
  *
  * @since   2.2.7
  *
  * @return   object.
  */
 public function getorderinfo($orderid)
 {
     // Get Order Info
     $order = $this->comquick2cartHelper->getorderinfo($orderid);
     // Get item attribute details
     foreach ($order['items'] as $key => $item) {
         $productHelper = new productHelper();
         // Get cart items attribute details
         $item->prodAttributeDetails = $productHelper->getItemCompleteAttrDetail($item->item_id);
         $product_attributes = explode(',', $item->product_attributes);
         /* E.g data
         		 *
         		 *  [prodAttributeDetails] => Array
         		 (
         		 [0] => stdClass Object
         		 (
         		 [itemattribute_id] => 93
         		 [itemattribute_name] => Colors3
         		 [attribute_compulsary] => 1
         		 [attributeFieldType] => Select
         		 [optionDetails] => Array
         		 (
         		 [0] => stdClass Object
         		 (
         		 [itemattributeoption_id] => 231
         		 [itemattributeoption_name] => Red
         		 [itemattributeoption_price] => 0.00
         		 [itemattributeoption_prefix] => +
         		 [ordering] => 1
         		 [itemattribute_id] => 93
         		 [USD] => 0.00
         		 )
         		 */
         foreach ($item->prodAttributeDetails as $optionDetails) {
             foreach ($optionDetails->optionDetails as $option) {
                 if (in_array($option->itemattributeoption_id, $product_attributes)) {
                     $selected_value = $option->itemattributeoption_id;
                     if (!empty($selected_value)) {
                         $query = $this->_db->getQuery(true);
                         $query->select("`orderitemattribute_id`, `orderitemattribute_name`");
                         $query->from('#__kart_order_itemattributes');
                         $query->where("itemattributeoption_id =" . $selected_value . "");
                         $query->where("order_item_id = " . $item->order_item_id);
                         $this->_db->setQuery($query);
                         $itemattributes = $this->_db->LoadObject();
                         $optionDetails->orderitemattribute_id = $itemattributes->orderitemattribute_id;
                         $optionDetails->selected = $selected_value;
                         if (!empty($optionDetails->attributeFieldType) && $optionDetails->attributeFieldType == 'Textbox') {
                             $optionDetails->orderitemattribute_name = $itemattributes->orderitemattribute_name;
                         }
                         break;
                     }
                 }
             }
         }
     }
     return $order;
 }
Example #6
0
		<input type="hidden" name="controller" value="" />
	</form>
</div>

<?php 
// Start Integration with JLike
if (file_exists(JPATH_SITE . '/' . 'components/com_jlike/helper.php')) {
    // Getting item id
    $catpage_Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=category');
    // p_link:: if product has attribute then use plink to open product page
    $p_link = 'index.php?option=com_quick2cart&view=productpage&layout=default&item_id=' . $this->item_id . '&Itemid=' . $catpage_Itemid;
    // $product_link=JUri::base().$p_link;
    $product_link = JUri::root() . substr(JRoute::_($p_link), strlen(JUri::base(true)) + 1);
    // Check if required content available
    if (!empty($this->item_id) && !empty($this->itemdetail->name)) {
        $productHelper = new productHelper();
        $jlikehtml = $productHelper->DisplayjlikeButton($product_link, $this->item_id, $this->itemdetail->name);
        // JLike Html
        if ($jlikehtml) {
            echo $jlikehtml;
        }
    }
}
// End Integration with JLike
?>

<!-- Below code is used for slide show-->
<script type="text/javascript">
	techjoomla.jQuery(document).ready(function (){
		techjoomla.jQuery('.swipebox').swipebox();
	});
Example #7
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);
 }
Example #8
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;
jimport('activity.socialintegration.profiledata');
require_once JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
$productHelper = new productHelper();
// Get Item Id by url parameter
$params = JComponentHelper::getParams('com_quick2cart');
$socialintegration = $params->get('integrate_with', 'none');
$who_bought_limit = $params->get('who_bought_limit', 2);
$peopleWhoBought = $productHelper->peopleWhoBought(JRequest::getInt('itemid'), $params->get('who_bought_limit', 2));
?>
<div class="<?php 
echo Q2C_WRAPPER_CLASS;
?>
">
		<div class="row-fluid">
					<div class="span12 well well-small">
						<div align="center"><h4><?php 
echo JText::_('COM_QUICK2CART_WHO_BOUGHT');
?>
</h4></div>
						<ul class="center thumbnails qtc_ForLiStyle" >
Example #9
0
			</div>
		</div>
	</div>
	<?php 
    return false;
}
//load style sheet
$document = JFactory::getDocument();
// for featured and top seller product
$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();
$comquick2cartHelper = new comquick2cartHelper();
$store_id = $this->store_id;
?>

<div class="<?php 
echo Q2C_WRAPPER_CLASS;
?>
">
	<form name="adminForm" id="adminForm" class="form-validate" method="post">
		<div class="row-fluid">
			<div class="span9">
				<!-- START ::for store info  -->
				<?php 
if (!empty($this->storeDetailInfo)) {
    $sinfo = $this->storeDetailInfo;
Example #10
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)
 {
     /*$this->load($pk);
     		//$result = parent::delete($pk);
     
     		if ($result)
     		{
     		}
     		return $result;
     		*/
     $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
     if (!class_exists('productHelper')) {
         JLoader::register('productHelper', $path);
         JLoader::load('productHelper');
     }
     $productHelper = new productHelper();
     if (is_array($pk)) {
         $status = false;
         foreach ($pk as $pkid) {
             $oneProdStatus = $productHelper->deleteWholeProduct($pkid);
             if ($oneProdStatus === true) {
                 // If atleast one prod is deleted successfull and other not still reurn true.
                 $status = true;
             }
         }
     } else {
         $status = $productHelper->deleteWholeProduct($pk);
     }
     return $status;
 }
Example #11
0
$lang->load('com_quick2cart', JPATH_SITE);
$document = JFactory::getDocument();
$addpre_select[] = JHtml::_('select.option', '+', JText::_('QTC_ADDATTRI_PREADD'));
$addpre_select[] = JHtml::_('select.option', '-', JText::_('QTC_ADDATTRI_PRESUB'));
//$addpre_select[] = JHtml::_('select.option','=', JText::_('QTC_ADDATTRI_PRESAM'));
$del_link = $qtc_base_url . 'index.php?option=com_quick2cart&task=attributes.delattribute';
if (!empty($pid) && $client) {
    // declaration section
    $quick2cartModelAttributes = new quick2cartModelAttributes();
    $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
    if (!class_exists('productHelper')) {
        //require_once $path;
        JLoader::register('productHelper', $path);
        JLoader::load('productHelper');
    }
    $productHelper = new productHelper();
    if (empty($item_id)) {
    } else {
        $attributes = $quick2cartModelAttributes->getItemAttributes($item_id);
        $getMediaDetail = $productHelper->getMediaDetail($item_id);
        $addMediaLink = $qtc_base_url . 'index.php?option=com_quick2cart&view=attributes&layout=media&tmpl=component&item_id=' . $item_id;
    }
    ?>
	<script type="text/javascript">

		function EditFile(file_id,pid)
		{
				var tr_id = '.file_'+file_id;
				techjoomla.jQuery.ajax({
				url:'<?php 
    echo $qtc_base_url;
if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
    $path = JPATH_SITE . '/components/com_quick2cart/helper.php';
    if (!class_exists('comquick2cartHelper')) {
        JLoader::register('comquick2cartHelper', $path);
        JLoader::load('comquick2cartHelper');
    }
    // Load assets
    comquick2cartHelper::loadQuicartAssetFiles();
    // LOAD LANGUAGE FILES
    $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();
Example #13
0
 /**
  * amol changes
  * Get details of checkout cart items
  */
 function getCheckoutCartItemsDetails()
 {
     // GETTING CART ITEMS
     JLoader::import('cart', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
     $cartmodel = new Quick2cartModelcart();
     $cart = $cartmodel->getCartitems();
     foreach ($cart as $key => $rec) {
         JLoader::import('product', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models');
         $quick2cartModelProduct = new quick2cartModelProduct();
         $cart[$key]['item_images'] = $quick2cartModelProduct->getProdutImages($rec['item_id']);
         $productHelper = new productHelper();
         // Get cart items attribute details
         $cart[$key]['prodAttributeDetails'] = $productHelper->getItemCompleteAttrDetail($rec['item_id']);
         $product_attributes = rtrim($cart[$key]['product_attributes'], ",");
         if (!empty($product_attributes)) {
             // Get Cart Item attribute seleted value
             if ($cart[$key]['product_attributes']) {
                 $db = JFactory::getDBO();
                 $query = $db->getQuery(true);
                 $query->select("`cartitemattribute_id`, `itemattributeoption_id`, `cartitemattribute_name`");
                 $query->from('#__kart_cartitemattributes');
                 $query->where("itemattributeoption_id IN(" . $product_attributes . ")");
                 $query->where(" cart_item_id = " . $cart[$key]['id']);
                 $db->setQuery($query);
                 $cart[$key]['product_attributes_values'] = $db->loadObjectList('itemattributeoption_id');
             }
         }
     }
     return $cart;
 }
    function getFieldHtmlForShippingType($fieldData)
    {
        $productHelper = new productHelper();
        $shipping_type = !empty($fieldData['shipping_type']) ? $fieldData['shipping_type'] : 0;
        $fieldHtml = '';
        /*		if ($limitLield  == 'MIN')
        		{
        			$fieldName = "shipForm[min_value]";
        		}
        		else
        		{
        			$fieldName = "shipForm[max_value]";
        		}
        */
        $minFieldHtml = '';
        $maxFieldHtml = '';
        switch ($shipping_type) {
            case 3:
                $currFieldValues = !empty($fieldData['DefFieldValues']['min']) ? $fieldData['DefFieldValues']['min'] : array();
                $minFieldHtml = $productHelper->getMultipleCurrFields($name = 'shipForm[min_value]', $currFieldValues);
                //  Get maximum field detail
                $currFieldValues = !empty($fieldData['DefFieldValues']['max']) ? $fieldData['DefFieldValues']['max'] : array();
                $maxFieldHtml = $productHelper->getMultipleCurrFields($name = 'shipForm[max_value]', $currFieldValues);
                $maxFieldHtml .= '<p class="text-info">' . JText::_("PLG_QTC_DEFAULT_ZONESHIPPING_MAXIMUM_AMT_HELP") . '</p>';
                $fieldLable = JText::_("PLG_QTC_DEFAULT_ZONESHIPPING_PRICE_LABLE");
                break;
            case 1 || 2 || 0:
                // Minimum amount field
                $minFieldAmount = !empty($fieldData['minFieldAmt']) ? $fieldData['minFieldAmt'] : 0;
                $minFieldName = !empty($fieldData['minFieldName']) ? $fieldData['minFieldName'] : 'shipForm[min_value]';
                $minFieldId = !empty($fieldData['minFieldId']) ? $fieldData['minFieldId'] : 'qtcMinAmount';
                $minFieldHtml = '<input id="' . $minFieldId . '" name="' . $minFieldName . '" class="input-large bill inputbox required validate-name" type="text" value="' . $minFieldAmount . '">';
                // Max amount field
                $maxFieldAmount = !empty($fieldData['maxFieldAmt']) ? $fieldData['maxFieldAmt'] : -1;
                $maxFieldName = !empty($fieldData['maxFieldName']) ? $fieldData['maxFieldName'] : 'shipForm[max_value]';
                $maxFieldId = !empty($fieldData['maxFieldId']) ? $fieldData['maxFieldId'] : 'qtcMaxAmount';
                $maxFieldHtml = '<input id="' . $maxFieldId . '" name="' . $maxFieldName . '" class="input-large bill inputbox required validate-name" type="text" value="' . $maxFieldAmount . '">
			<p class="text-info">' . JText::_("PLG_QTC_DEFAULT_ZONESHIPPING_MAXIMUM_AMT_HELP") . '</p>';
                switch ($shipping_type) {
                    case 1:
                        $fieldLable = JText::_("PLG_QTC_DEFAULT_ZONESHIPPING_QTY_LABLE");
                        break;
                    case 2:
                        $fieldLable = JText::_("PLG_QTC_DEFAULT_ZONESHIPPING_WT_LABLE");
                        break;
                    case 0:
                        $fieldLable = '';
                        break;
                }
                break;
        }
        $return['minFieldHtml'] = $minFieldHtml;
        $return['maxFieldHtml'] = $maxFieldHtml;
        $return['minFieldLable'] = JText::sprintf("PLG_QTC_DEFAULT_ZONESHIPPING_MIN_LMIT", $fieldLable);
        $return['maxFieldLable'] = JText::sprintf("PLG_QTC_DEFAULT_ZONESHIPPING_MAX_LMIT", $fieldLable);
        return json_encode($return);
    }
Example #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;
$user = JFactory::getUser();
$document = JFactory::getDocument();
$expiryMode = $this->params->get('eProdUExpiryMode');
$jinput = JFactory::getApplication()->input;
//$orderid = $jinput->get('orderid','');
$guest_email = $jinput->get('guest_email', '', 'RAW');
$productHelper = new productHelper();
?>

<div class="<?php 
echo Q2C_WRAPPER_CLASS;
?>
" >
	<form action="" name="adminForm" id="adminForm" class="form-validate" method="post">

	<?php 
// STEP 1: check for user login or not
if (!$user->id && empty($this->guest_email_chk)) {
    ?>
		<div class="well" >
			<div class="alert alert-error">
				<span><?php 
Example #16
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;
jimport('joomla.html.html.list');
$comquick2cartHelper = new comquick2cartHelper();
$productHelper = new productHelper();
$input = JFactory::getApplication()->input;
// Start vars
$qtc_catname = !empty($qtc_catname) ? $qtc_catname : "prod_cat";
$qtc_store_id = !empty($qtc_store_id) ? $qtc_store_id : "";
$qtc_view = !empty($qtc_view) ? $qtc_view : "category";
$qtc_layout = !empty($qtc_layout) ? $qtc_layout : "";
$categoryProductsCount = $productHelper->getCategoryProductsCount($qtc_store_id);
$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;";
?>

<?php 
$qtc_linkparam = array();
if (!empty($qtc_view)) {
    $qtc_linkparam[] = "view=" . $qtc_view;
}
Example #17
0
 /**
  * public function to update status of order
  *
  * @param   INTEGER  $order_id   : int id of order
  * @param   STRING   $status     : string status of order
  * @param   STRING   $comment    : string default='' comment added if any
  * @param   INTEGER  $send_mail  : int default=1 weather to send status change mail or not.
  * @param   INTEGER  $store_id   :: INTEGER (1/0) if we are updating store product status
  *
  * @return  void
  */
 public function updatestatus($order_id, $status, $comment = '', $send_mail = 1, $store_id = 0)
 {
     global $mainframe;
     $params = JComponentHelper::getParams('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     $productHelper = new productHelper();
     $mainframe = JFactory::getApplication();
     $order_oldstatus = '';
     $db = JFactory::getDBO();
     if ($send_mail == 1) {
         // For changing store product order
         if (!empty($store_id)) {
             $query = 'SELECT o.status FROM `#__kart_order_item` as o WHERE o.order_id =' . $order_id . ' AND o.`store_id`=' . $store_id . ' order by `order_item_id`';
         } else {
             $query = "SELECT o.status FROM #__kart_orders as o WHERE o.id =" . $order_id;
         }
         $db->setQuery($query);
         $order_oldstatus = $db->loadResult();
     }
     switch ($status) {
         case 'C':
             // To reduce stock
             $usestock = $params->get('usestock');
             $outofstock_allowship = $params->get('outofstock_allowship');
             // $outofstock_allowship==1)
             if ($usestock == 1 && $order_oldstatus != $status) {
                 $comquick2cartHelper->updateItemStock($order_id);
                 $comquick2cartHelper->updateStoreFee($order_id);
                 $productHelper->addEntryInOrderItemFiles($order_id);
                 $productHelper->addPoint($order_id);
             }
             break;
     }
     $res = new stdClass();
     // UPDATING STORE ORDER CHANGES
     if (!empty($store_id)) {
         // Change ORDER_ITEM STATUS// here i want order_item_id to update status of all order item releated to store
         $isOrderStatusChanged = $comquick2cartHelper->updateOrderItemStatus($order_id, $store_id, $status);
         // 1 for order status change, 0 for order item change
         if (empty($isOrderStatusChanged)) {
             // $return ;
         }
     } else {
         // IF admin changes ORDER status
         if (empty($status) || $status == -1) {
             $res->status = $status;
         }
         $res->id = $order_id;
         if (!$db->updateObject('#__kart_orders', $res, 'id')) {
             return 2;
         }
         $isOrderStatusChanged = $comquick2cartHelper->updateOrderItemStatus($order_id, 0, $status);
         // UPDATE ORDER ITEM STATUS ALSO
     }
     // Call the plugin and get the result
     $query = "SELECT o.* FROM #__kart_orders as o WHERE o.id =" . $order_id;
     $db->setQuery($query);
     $orderobj = $db->loadObject();
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('system');
     $result = $dispatcher->trigger('Onq2cOrderUpdate', array($orderobj));
     // END Q2C Sample development
     //if ($send_mail == 1 && $order_oldstatus != $status)
     if ($send_mail == 1) {
         $params = JComponentHelper::getParams('com_quick2cart');
         // $adminemails = comquick2cartHelper::adminMails();
         $query = "SELECT ou.user_id,ou.user_email,ou.firstname FROM #__kart_users as ou WHERE ou.address_type='BT' AND ou.order_id = " . $order_id;
         $db->setQuery($query);
         $orderuser = $db->loadObjectList();
         // Change for backward compatiblity for user info not saving order id against it
         if (empty($orderuser)) {
             $query = "SELECT ou.user_id,ou.user_email,ou.firstname\n\t\t\t\t\t\t\tFROM #__kart_users as ou\n\t\t\t\t\t\t\tWHERE ou.address_type='BT' AND ou.order_id IS NULL\n\t\t\t\t\t\t\tAND ou.user_id = (SELECT o.user_info_id FROM #__kart_orders as o WHERE o.id =" . $order_id . ")";
             $db->setQuery($query);
             $orderuser = $db->loadObjectList();
         }
         $orderuser = $orderuser[0];
         switch ($status) {
             case 'C':
                 $orderstatus = JText::_('QTC_CONFR');
                 /*for invoice*/
                 $useinvoice = $params->get('useinvoice', '1');
                 if ($useinvoice == '1') {
                     $this->invoice = 1;
                     $jinput = JFactory::getApplication()->input;
                     $jinput->set('orderid', $order_id);
                     $order = $order_bk = $comquick2cartHelper->getorderinfo($order_id);
                     $this->orderinfo = $order['order_info'];
                     $this->orderitems = $order['items'];
                     $this->orders_site = 1;
                     $this->orders_email = 1;
                     $this->order_authorized = 1;
                     if ($this->orderinfo[0]->address_type == 'BT') {
                         $billemail = $this->orderinfo[0]->user_email;
                     } elseif ($this->orderinfo[1]->address_type == 'BT') {
                         $billemail = $this->orderinfo[1]->user_email;
                     }
                     $fullorder_id = $order['order_info'][0]->prefix . $order_id;
                     $this->qtcSystemEmails = 1;
                     if (!JFactory::getUser()->id && $params->get('guest')) {
                         $jinput->set('email', md5($billemail));
                     }
                     // Getting the site info for site invoice layout
                     $this->siteInvoiceInfo = $this->getSiteInvoiceInfo();
                     // Check for view override
                     $view = $comquick2cartHelper->getViewpath('orders', 'order');
                     ob_start();
                     include $view;
                     $invoicehtml = ob_get_contents();
                     ob_end_clean();
                 }
                 /*for invoice*/
                 break;
             case 'RF':
                 $orderstatus = JText::_('QTC_REFUN');
                 break;
             case 'S':
                 $orderstatus = JText::_('QTC_SHIP');
                 break;
             case 'E':
                 $orderstatus = JText::_('QTC_ERR');
                 break;
             case 'P':
                 $orderstatus = JText::_('QTC_PENDIN');
                 break;
             default:
                 $orderstatus = $status;
                 break;
         }
         $fullorder_id = $orderobj->prefix . $order_id;
         if (!empty($store_id)) {
             $productStatus = $comquick2cartHelper->getProductStatus($order_id);
             $body = JText::sprintf('QTC_STORE_PRODUCT_STATUS_CHANGE_BODY', $productStatus);
         } else {
             $body = JText::_('QTC_STATUS_CHANGE_BODY');
         }
         $site = $mainframe->getCfg('sitename');
         if ($comment) {
             $comment = str_replace('{COMMENT}', $comment, JText::_('QTC_COMMENT_TEXT'));
         } else {
             $comment = '';
         }
         $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
         $replace = array($fullorder_id, $orderstatus, $site, $orderuser->firstname, $comment);
         $body = str_replace($find, $replace, $body);
         $guest_email = '';
         if (!$orderuser->user_id && $params->get('guest')) {
             $guest_email = "&email=" . md5($orderuser->user_email);
         }
         $Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders');
         $tempLink = JRoute::_('index.php?option=com_quick2cart&view=orders&layout=order' . $guest_email . '&orderid=' . $order_id . '&Itemid=' . $Itemid);
         $link = JUri::root() . substr($tempLink, strlen(JUri::base(true)) + 1);
         $order_link = '<a href="' . $link . '">' . JText::_('QTC_ORDER_GUEST_LINK') . '</a>';
         $body = str_replace('{LINK}', $order_link, $body);
         $body = nl2br($body);
         // GETTING BODY AND MAIL SUBJECT
         if (!empty($invoicehtml)) {
             $body = $body . '<div>' . JText::_('QTC_ORDER_INVOICE_IN_MAIL') . '</div>' . $invoicehtml;
             $subject = JText::sprintf('QTC_INVOICE_MAIL_SUB', $site, $fullorder_id);
         } else {
             $subject = JText::sprintf('QTC_STATUS_CHANGE_SUBJECT', $fullorder_id);
         }
         // Call the plugin and get the result
         $dispatcher = JDispatcher::getInstance();
         JPluginHelper::importPlugin('system');
         $result = $dispatcher->trigger('OnBeforeq2cOrderUpdateEmail', array($orderobj, $subject, $body));
         if (!empty($result[0])) {
             $subject = $result[0][0];
             $body = $result[0][1];
         }
         // Send mail
         $comquick2cartHelper->sendmail($orderuser->user_email, $subject, $body, $params->get('sale_mail'));
     }
 }
Example #18
0
    function EditMediFile()
    {
        // Add Language file.
        $lang = JFactory::getLanguage();
        $lang->load('com_quick2cart', JPATH_ADMINISTRATOR);
        $qtc_base_url = JUri::root();
        // get Product_id via ajax url.
        $jinput = JFactory::getApplication()->input;
        $item_id = $jinput->get('pid');
        // Get file id for delete.
        $file_id = $jinput->get('file_id');
        $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models' . DS . 'attributes.php';
        if (!class_exists('attributes')) {
            // require_once $path;
            JLoader::register('attributes', $path);
            JLoader::load('attributes');
        }
        $quick2cartModelAttributes = new quick2cartModelAttributes();
        $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php';
        if (!class_exists('productHelper')) {
            // require_once $path;
            JLoader::register('productHelper', $path);
            JLoader::load('productHelper');
        }
        $productHelper = new productHelper();
        $delFiles = array();
        $delFiles[] = $file_id;
        $attributes = $quick2cartModelAttributes->getItemAttributes($item_id);
        $getMediaDetail = $productHelper->getMediaDetail($item_id, $file_id);
        $addMediaLink = $qtc_base_url . 'index.php?option=com_quick2cart&view=attributes&layout=media&tmpl=component&item_id=' . $item_id;
        $html = '';
        $count = $jinput->get('count');
        $count = $count - 1;
        if (!empty($getMediaDetail)) {
            for ($i = 0; $i < count($getMediaDetail); $i++) {
                if ($i > $count) {
                    $html .= '<tr class="' . "file_" . $getMediaDetail[$i]['file_id'] . '">
							<td>' . $getMediaDetail[$i]['file_display_name'] . '</td>
							<td>';
                    $mediaClass = ' badge';
                    $purchaseStatus = JText::_('QTC_ADDATTRI_PURCHASE_REQ_NO');
                    if (!empty($getMediaDetail[$i]['purchase_required'])) {
                        $mediaClass = ' badge badge-success';
                        $purchaseStatus = JText::_('QTC_ADDATTRI_PURCHASE_REQ_YES');
                    }
                    $html .= '<span class="' . $mediaClass . '">' . $purchaseStatus . '</span>
							</td>';
                    $edit_link = $addMediaLink . '&file_id=' . $getMediaDetail[$i]['file_id'] . '&edit=1';
                    $del_link = $addMediaLink . '&file_id=' . $getMediaDetail[$i]['file_id'];
                    $html .= '<td>
								<a  rel="{handler: \'iframe\', size: {x: 800, y: 550}, onClose: function(){EditFile(' . $getMediaDetail[$i]['file_id'] . ',' . $item_id . ');}}" class="btn btn-mini btn-primary modal qtc_modal" href="' . $edit_link . '"> <i class="icon-pencil-2 icon-white"></i>
								</a>
								<button type="button" class="btn btn-mini btn-danger "  onclick="deleteMediFile(' . $getMediaDetail[$i]['file_id'] . ',' . $item_id . ' )"><i class="icon-trash icon-white"></i></button>

							 </td>
						</tr>';
                }
            }
            $data['html'] = $html;
            echo json_encode($html);
        }
        jexit();
    }
Example #19
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;
JHtml::_('behavior.modal');
require_once JPATH_SITE . '/plugins/tjshipping/qtc_default_zoneshipping/qtc_default_zoneshipping/qtczoneShipHelper.php';
$qtczoneShipHelper = new qtczoneShipHelper();
$comquick2cartHelper = new comquick2cartHelper();
$productHelper = new productHelper();
$zoneHelper = new zoneHelper();
$qtcshiphelper = new qtcshiphelper();
$taxHelper = new taxHelper();
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$extension_id = $jinput->get('extension_id');
$methodId = $jinput->get('methodId', 0);
$shipMethDetail = $qtcshiphelper->getShipMethDetail($methodId);
$itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
if (!empty($methodId)) {
    $status = $comquick2cartHelper->store_authorize('', $shipMethDetail['store_id']);
    if (!$status) {
        $zoneHelper->showUnauthorizedMsg();
        return false;
    }
" class="input input-small" value ="<?php 
                        echo $itemattributeoption_id;
                        ?>
" />

												</div>

												<?php 
                    } else {
                        foreach ($attribute->optionDetails as $optionDetail) {
                            if (in_array($optionDetail->itemattributeoption_id, $product_attributes)) {
                                $data['default_value'] = $optionDetail->itemattributeoption_id;
                                break;
                            }
                        }
                        $productHelper = new productHelper();
                        $data['itemattribute_id'] = $attribute->itemattribute_id;
                        $data['fieldType'] = $attribute->attributeFieldType;
                        $data['product_id'] = $order->item_id;
                        $data['attribute_compulsary'] = $attribute->attribute_compulsary;
                        $data['field_name'] = 'cartDetail[' . $order->order_item_id . '][attrDetail][' . $attribute->itemattribute_id . '][value]';
                        // Generate field html (select box)
                        $fieldHtml = $productHelper->getAttrFieldTypeHtml($data);
                        ?>
													<div class="controls">
														<?php 
                        echo $fieldHtml;
                        ?>
													</div>
													<?php 
                    }
Example #21
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);
 }
Example #22
0
    echo Q2C_WRAPPER_CLASS;
    ?>
" >
			<div class="well" >
				<div class="alert alert-error">
					<span ><?php 
    echo JText::_('QTC_MEDIA_INVALID_ITEM_ID');
    ?>
 </span>
				</div>
			</div>
		</div>
		<?php 
    return false;
}
$productHelper = new productHelper();
$m = 0;
$attribute_container_id = "qtc_mediaContainer" . $m;
$mediafile_id = $jinput->get('file_id', '', 'INT');
$mediaDetail = array();
// for edit media
if (!empty($mediafile_id)) {
    $mediaDetail = $productHelper->getMediaDetail(0, $mediafile_id);
}
?>
<div class="<?php 
echo Q2C_WRAPPER_CLASS;
?>
" >
<form method="POST" name="adminForm" class="form-validate" action="index.php">
if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
    $path = JPATH_SITE . '/components/com_quick2cart/helper.php';
    if (!class_exists('comquick2cartHelper')) {
        JLoader::register('comquick2cartHelper', $path);
        JLoader::load('comquick2cartHelper');
    }
    // Load assets
    comquick2cartHelper::loadQuicartAssetFiles();
    // LOAD LANGUAGE FILES
    $doc = JFactory::getDocument();
    $lang = JFactory::getLanguage();
    $lang->load('mod_qtcproductdisplay', JPATH_SITE);
    // GETTING MODULE PARAMS
    $prodLimit = $params->get('limit', 2);
    $module_mode = $params->get('module_mode', 'qtc_featured');
    $productHelper = new productHelper();
    if (!empty($module_mode)) {
        switch ($module_mode) {
            case 'qtc_featured':
                $target_data = $productHelper->getAllFeturedProducts('', '', $prodLimit);
                break;
            case 'qtc_recentlyAdded':
                $target_data = $productHelper->getNewlyAdded_products($prodLimit);
                break;
            case 'qtc_recentlyBought':
                $target_data = $productHelper->getRecentlyBoughtproducts($prodLimit);
                break;
            case 'qtc_topSeller':
                $target_data = $productHelper->getTopSellerProducts('', '', $prodLimit);
                break;
        }
    function _getquick2cartproductHTML()
    {
        jimport('joomla.filesystem.file');
        if (JFile::exists(JPATH_SITE . '/components/com_quick2cart/quick2cart.php')) {
            $lang = JFactory::getLanguage();
            $lang->load('com_quick2cart', JPATH_SITE);
            $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helper.php';
            if (!class_exists('comquick2cartHelper')) {
                JLoader::register('comquick2cartHelper', $path);
                JLoader::load('comquick2cartHelper');
            }
            // Load assets
            comquick2cartHelper::loadQuicartAssetFiles();
            $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');
            }
            $params = $this->params;
            $no_of_prod = $params->get('no_of_prod', '2');
            // Get profile id
            $user = CFactory::getRequestUser();
            $model = new productHelper();
            $target_data = $model->getUserProducts($user->_userid, $no_of_prod);
            if (!empty($target_data)) {
                $random_container = 'q2c_pc_js_my_products';
                $html = "\n\t\t\t\t\t<div class='" . Q2C_WRAPPER_CLASS . "' >\n\t\t\t\t\t\t<div class='row-fluid'>\n\t\t\t\t\t\t\t<div id='q2c_pc_js_my_products'>";
                foreach ($target_data 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();
                }
                $html .= "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
                ob_start();
                ?>
					<?php 
                // Get pin width
                $pin_width = $params->get('pin_width');
                if (empty($pin_width)) {
                    $pin_width = 170;
                }
                // Get pin padding
                $pin_padding = $params->get('pin_padding');
                if (empty($pin_padding)) {
                    $pin_padding = 7;
                }
                // Calulate columnWidth (columnWidth = pin_width+pin_padding)
                $columnWidth = $pin_width + $pin_padding;
                ?>

					<style type="text/css">
						.q2c_pin_item_<?php 
                echo $random_container;
                ?>
 { width: <?php 
                echo $pin_width . 'px';
                ?>
 !important; }
					</style>

					<script type="text/javascript">
						var pin_container_<?php 
                echo $random_container;
                ?>
 = 'q2c_pc_js_my_products';

						techjoomla.jQuery(document).ready(function()
						{
							var container_<?php 
                echo $random_container;
                ?>
 = document.getElementById(pin_container_<?php 
                echo $random_container;
                ?>
);
							var msnry = new Masonry( container_<?php 
                echo $random_container;
                ?>
, {
								columnWidth: <?php 
                echo $columnWidth;
                ?>
,
								itemSelector: '.q2c_pin_item_<?php 
                echo $random_container;
                ?>
',
								gutter: <?php 
                echo $pin_padding;
                ?>
});

							setTimeout(function(){
								var container_<?php 
                echo $random_container;
                ?>
 = document.getElementById(pin_container_<?php 
                echo $random_container;
                ?>
);
								var msnry = new Masonry( container_<?php 
                echo $random_container;
                ?>
, {
									columnWidth: <?php 
                echo $columnWidth;
                ?>
,
									itemSelector: '.q2c_pin_item_<?php 
                echo $random_container;
                ?>
',
									gutter: <?php 
                echo $pin_padding;
                ?>
});
							}, 1000);

							setTimeout(function(){
								var container_<?php 
                echo $random_container;
                ?>
 = document.getElementById(pin_container_<?php 
                echo $random_container;
                ?>
);
								var msnry = new Masonry( container_<?php 
                echo $random_container;
                ?>
, {
									columnWidth: <?php 
                echo $columnWidth;
                ?>
,
									itemSelector: '.q2c_pin_item_<?php 
                echo $random_container;
                ?>
',
									gutter: <?php 
                echo $pin_padding;
                ?>
});
							}, 3000);
						});
					</script>
				<?php 
                $pin_html .= ob_get_contents();
                ob_end_clean();
                $html .= $pin_html;
                return $html;
            }
        }
    }
Example #25
0
    }
    // Don't Show media file if you found qtcFreeDdownloads=true.
    if (!empty($this->mediaFiles)) {
        $hideAtt = !empty($this->qtcExtraParam['hideAttributes']) ? 'qtc_hideEle' : '';
        ?>
			<div class="control-group <?php 
        echo $hideAtt;
        ?>
" >
				<div class="control-label"><strong><?php 
        echo JText::_("COM_QUICK2CART_PROD_FREE_DOWNLOAD");
        ?>
		</strong></div>
				<div class="controls qtc_padding_class_attributes">
				<?php 
        $productHelper = new productHelper();
        foreach ($this->mediaFiles as $mediaFile) {
            $linkData = array();
            $linkData['linkName'] = $mediaFile['file_display_name'];
            $linkData['href'] = $productHelper->getMediaDownloadLinkHref($mediaFile['file_id']);
            $linkData['event'] = '';
            $linkData['functionName'] = '';
            $linkData['fnParam'] = '';
            echo $productHelper->showMediaDownloadLink($linkData) . "<br>";
        }
        ?>
				</br>
				</div>
			</div>
		<?php 
    }
Example #26
0
        ?>
</a>
				<?php 
    }
    ?>
			<?php 
    if ($showoptioncol == 1) {
        ?>
				<td class="cartitem_opt" >
					<span><?php 
        if (!empty($cart['options'])) {
            echo nl2br(str_replace(",", "\n", $cart['options']));
        }
        // user field data - eg text to print on T-shirt
        if (!empty($cart['product_attributesUserData']) && 0) {
            $productHelper = new productHelper();
            $userdata = json_decode($cart['product_attributesUserData'], true);
            echo $productHelper->getFormattedAttributesUserData($userdata);
        }
        ?>
</span>
				</td>
			<?php 
    }
    ?>
				<td class="cartitem_price" id="cart_price[]" name="cart_price[]">
					<div>
						<span><?php 
    echo $helperobj->getFromattedPrice(number_format($cart['amt'] + $cart['opt_amt'], 2));
    ?>
 </span>
Example #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);
 }
Example #28
0
 /**
  * Method to delete a row from the database table by primary key value.
  *
  * @param   array  $items  An array of primary key value to delete.
  *
  * @return  int  Returns count of success
  */
 public function delete($items)
 {
     $db = $this->getDbo();
     $app = JFactory::getApplication();
     $count = 0;
     if (is_array($items)) {
         foreach ($items as $id) {
             $productHelper = new productHelper();
             $res = $productHelper->deleteWholeProduct($id);
             $productHelper->deleteNotReqProdImages($id, '');
             if (!empty($res)) {
                 $count++;
             } else {
                 $app->enqueueMessage(JText::_('COM_QUICK2CART_MSG_ERROR_DELETE_PRODUCT'), 'error');
                 return 0;
             }
         }
     }
     return $count;
 }
Example #29
0
								<td class="q2c_width_10 center" data-title="<?php 
        echo JText::_('COM_QUICK2CART_SALESREPORT_QTY');
        ?>
">
									<?php 
        echo $row->saleqty;
        ?>
								</td>

								<td class="q2c_width_10" data-title="<?php 
        echo JText::_('COM_QUICK2CART_SALESREPORT_AMOUNT');
        ?>
">
									<?php 
        $productHelper = new productHelper();
        $prodAttDetails = $productHelper->getProdPriceWithDefltAttributePrice($row->item_id);
        // CONSIDERING FIELD DISCOUND, NOT COUP DISCOUNT
        $prodBasePrice = !empty($prodAttDetails['itemdetail']['discount_price']) ? $prodAttDetails['itemdetail']['discount_price'] : $prodAttDetails['itemdetail']['price'];
        $prodPrice = $prodBasePrice + $prodAttDetails['attrDetail']['tot_att_price'];
        echo $comquick2cartHelper->getFromattedPrice($prodPrice);
        ?>
								</td>

								<!-- created by-->
								<td class="q2c_width_10" data-title="<?php 
        echo JText::_('COM_QUICK2CART_SALESREPORT_CREATED_BY');
        ?>
">
									<?php 
        if (!empty($store_details[$row->store_id])) {
Example #30
0
 public function getItemCompleteAttrDetail($item_id)
 {
     $productHelper = new productHelper();
     return $productHelper->getItemCompleteAttrDetail($item_id);
 }