예제 #1
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JController
  * @since   1.6
  */
 public function __construct($config = array())
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $this->my_stores_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=stores&layout=my');
     $this->create_store_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore');
     parent::__construct($config);
 }
예제 #2
0
 /**
  * Class constructor.
  *
  * @param   array  $config  A named array of configuration variables.
  *
  * @since   1.6
  */
 public function __construct($config = array())
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $this->my_coupons_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=coupons&layout=my');
     $this->create_coupon_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=couponform');
     parent::__construct($config);
     $this->view_list = 'coupons';
 }
예제 #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)
 {
     $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);
 }
예제 #4
0
 function getShipView()
 {
     $app = JFactory::getApplication();
     $qtcshiphelper = new qtcshiphelper();
     $comquick2cartHelper = new comquick2cartHelper();
     $plgActionRes = array();
     $jinput = $app->input;
     $extension_id = $jinput->get('extension_id');
     $plugview = $jinput->get('plugview');
     // Plugin view is not found in URL then check in post array.
     if (empty($plugview)) {
         $plugview = $jinput->post->get('plugview');
     }
     // If extension related view
     if (!empty($extension_id)) {
         $plugName = $qtcshiphelper->getPluginDetail($extension_id);
         // Call specific plugin trigger
         JPluginHelper::importPlugin('tjshipping', $plugName);
         $dispatcher = JDispatcher::getInstance();
         $plgRes = $dispatcher->trigger('TjShip_plugActionkHandler', array($jinput));
         if (!empty($plgRes)) {
             $plgActionRes = $plgRes[0];
         }
     }
     // Enque msg
     if (!empty($plgActionRes['statusMsg'])) {
         $app->enqueueMessage($plgActionRes['statusMsg']);
     }
     // Extra plugin Url params.
     if (!empty($plgActionRes['urlPramStr'])) {
         $plgUrlParam = '&' . $plgActionRes['urlPramStr'];
     } else {
         $plgUrlParam = '&plugview=';
     }
     //print" kasdflkjsdk $plgUrlParam"; die;
     $itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
     $link = 'index.php?option=com_quick2cart&view=shipping&layout=list' . $plgUrlParam . '&extension_id=' . $extension_id . '&Itemid=' . $itemid;
     $this->setRedirect(JRoute::_($link, false));
 }
예제 #5
0
 /**
  * Returns edit or details link for given product as per cck or native parent.
  *
  * @param   int     $item_id    The product id
  * @param   string  $linkType   Type of link
  *
  * @return  string
  * @since   2.2
  */
 public function getProductLink($item_id, $linkType = 'detailsLink')
 {
     $helperobj = new comquick2cartHelper();
     $db = JFactory::getDBO();
     $query = "select `product_id`,`parent` from `#__kart_items` where item_id=" . $item_id;
     $db->setQuery($query);
     $res = $db->loadAssoc();
     $link = "";
     $uri = JUri::getInstance();
     switch ($res["parent"]) {
         case "com_content":
             if ($linkType == 'detailsLink') {
                 require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
                 $query = 'SELECT a.id, ' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug' . ' FROM #__content AS a ' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' WHERE a.id=' . $res["product_id"];
                 $db->setQuery($query);
                 $article = $db->loadObject();
                 $link = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false);
             } elseif ($linkType == 'editLink') {
                 $link = JUri::base() . 'index.php?option=com_content&task=article.edit&id=' . $res["product_id"];
             }
             break;
         default:
         case "com_quick2cart":
             if ($linkType == 'detailsLink') {
                 $catpage_Itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=category');
                 $link = JRoute::_('index.php?option=com_quick2cart&view=productpage&layout=default&item_id=' . $res["product_id"] . "&Itemid=" . $catpage_Itemid, false);
             } elseif ($linkType == 'editLink') {
                 $link = JUri::base() . 'index.php?option=com_quick2cart&view=products&layout=new&item_id=' . $res["product_id"];
             }
             break;
         case "com_zoo":
             if ($linkType == 'detailsLink') {
                 $Itemid = $helperobj->getitemid('index.php?option=com_zoo&task=item');
                 $link = JRoute::_("index.php?option=com_zoo&task=item&item_id=" . $res["product_id"] . "&Itemid=" . $Itemid, false);
             } elseif ($linkType == 'editLink') {
                 if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_zoo/config.php')) {
                     require_once JPATH_ADMINISTRATOR . '/components/com_zoo/config.php';
                 }
                 $zooApp = App::getInstance('zoo');
                 $zoo_item = $zooApp->table->item->get($res["product_id"]);
                 $link = JUri::base() . 'index.php?option=com_zoo&controller=item&changeapp=' . $zoo_item->application_id . '&task=edit&cid[]=' . $res["product_id"];
             }
             break;
         case "com_k2":
             require_once JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'route.php';
             $Itemid = $helperobj->getitemid('index.php?option=com_k2&view=item');
             if ($linkType == 'detailsLink') {
                 $query = "SELECT a.id, a.alias, a.catid,\n\t\t\t\t\t b.alias as categoryalias\n\t\t\t\t\t FROM #__k2_items as a\n\t\t\t\t\t LEFT JOIN #__k2_categories AS b ON b.id = a.catid\n\t\t\t\t\t WHERE a.id = " . $res["product_id"];
                 $db->setQuery($query);
                 $k2item = $db->loadObject();
                 $link = JRoute::_(K2HelperRoute::getItemRoute($k2item->id . ':' . urlencode($k2item->alias), $k2item->catid . ':' . urlencode($k2item->categoryalias)), false);
             } elseif ($linkType == 'editLink') {
                 $link = JUri::base() . 'index.php?option=com_k2&view=item&cid=' . $res["product_id"];
             }
             break;
         case "com_flexicontent":
             if ($linkType == 'detailsLink') {
                 $link = JUri::base() . 'index.php?option=com_flexicontent&task=items.edit&cid[]=' . $res["product_id"];
             } elseif ($linkType == 'editLink') {
                 $link = JUri::base() . 'index.php?option=com_flexicontent&task=items.edit&cid[]=' . $res["product_id"];
             }
             break;
     }
     return $link;
 }
예제 #6
0
        }
        if (!empty($social_options)) {
            ?>
									<span class="social_options">
										<?php 
            echo $social_options;
            ?>
									</span>
								<?php 
        }
    }
    if (!empty($this->editstoreBtn)) {
        // JRoute::_('index.php?option=com_quick2cart&view=orders&layout=mycustomer'),'_self'
        if (!empty($this->store_id)) {
            $storeid = $this->store_id;
            $createstore_Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore');
            echo "<button type='button' title=" . JText::_('SA_EDIT') . " class='btn  btn_margin pull-right btn-mini' onclick=\"window.open('" . JRoute::_("index.php?option=com_quick2cart&view=vendor&layout=createstore&store_id=" . $storeid . "&Itemid=" . $createstore_Itemid) . "')\" >\n\t\t\t\t\t\t\t\t\t<i class='" . QTC_ICON_EDIT . "'></i></button>";
        }
    }
    if ($integrate_with != 'none') {
        ?>
							<p style="font-size: 13px;"><?php 
        echo JText::sprintf('COM_QUICK2CART_CREATED_BY', $profile_path);
        ?>
</p>
							<?php 
    }
    ?>
					</legend>

					<span>
예제 #7
0
    /*BS start*/
    $document->addStyleSheet(JUri::base() . 'components/com_quick2cart/bootstrap/css/bootstrap.css');
    //aniket
    /*BS end*/
}
//$document->addStyleSheet(JUri::base().'components/com_quick2cart/assets/css/quick2cart.css');//aniket
$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');
}
$helperobj = new comquick2cartHelper();
$user = JFactory::getUser();
$checkout = 'index.php?option=com_quick2cart&view=cart';
$itemid = $helperobj->getitemid($checkout);
$checkout = JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=cartcheckout&Itemid=' . $itemid, false), strlen(JUri::base(true)) + 1);
$session = JFactory::getSession();
$cart_session = $this->cart;
if (empty($cart_session)) {
    ?>
<div class="well" >
	<div class="alert alert-error">
		<span ><?php 
    echo JText::_('QTC_EMPTY_CART');
    ?>
 </span>
	</div>
</div>
<?php 
    return false;
예제 #8
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JController
  * @since   1.6
  */
 public function __construct($config = array())
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $this->my_products_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=category&layout=my');
     parent::__construct($config);
 }
예제 #9
0
 function updatestatus($order_id, $status, $comment = '', $send_mail = 1, $store_id = 0)
 {
     global $mainframe;
     $params = JComponentHelper::getParams('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     switch ($status) {
         case 'C':
             /// to reduce stock
             $usestock = $params->get('usestock');
             $outofstock_allowship = $params->get('outofstock_allowship');
             if ($usestock == 1) {
                 $comquick2cartHelper->updateItemStock($order_id);
             }
             $comquick2cartHelper->updateStoreFee($order_id);
     }
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     if ($send_mail == 1) {
         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`';
             //die(" work is in progress(store product status change) die in helper ");
         } else {
             $query = "SELECT o.status FROM #__kart_orders as o WHERE o.id =" . $order_id;
         }
         $db->setQuery($query);
         $order_oldstatus = $db->loadResult();
     }
     $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);
         if (empty($isOrderStatusChanged)) {
             //	return ;
         }
     } else {
         // IF admin changes ORDER status
         $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
     }
     //START Q2C Sample development
     $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));
     //Call the plugin and get the result
     //END Q2C Sample development
     if ($send_mail == 1 && $order_oldstatus != $status) {
         $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\tFROM #__kart_users as ou \n\t\t\t\tWHERE ou.address_type='BT' AND ou.order_id IS NULL AND 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*/
                 $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;
                 } else {
                     if ($this->orderinfo[1]->address_type == 'BT') {
                         $billemail = $this->orderinfo[1]->user_email;
                     }
                 }
                 $fullorder_id = $order['order_info'][0]->prefix . $order_id;
                 if (!JFactory::getUser()->id && $params->get('guest')) {
                     $jinput->set('email', md5($billemail));
                 }
                 // check for view override
                 $view = $comquick2cartHelper->getViewpath('orders', 'invoice');
                 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'));
             $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
             $replace = array($fullorder_id, $orderstatus, $site, $orderuser->firstname, $comment);
         } else {
             $find = array('{ORDERNO}', '{STATUS}', '{SITENAME}', '{NAME}', '{COMMENTTEXT}');
             $replace = array($fullorder_id, $orderstatus, $site, $orderuser->firstname, '');
         }
         $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');
         $link = JURI::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=orders&layout=order' . $guest_email . '&orderid=' . $order_id . '&Itemid=' . $Itemid), 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);
         if (!empty($invoicehtml)) {
             $body = $body . '<div>' . JText::_('QTC_ORDER_INVOICE_IN_MAIL') . '</div>';
             $invoicehtml = $body . $invoicehtml;
             $invoicesubject = JText::sprintf('QTC_INVOICE_MAIL_SUB', $site, $fullorder_id);
             $comquick2cartHelper->sendmail($orderuser->user_email, $invoicesubject, $invoicehtml, $params->get('sale_mail'));
         } else {
             $subject = JText::sprintf('QTC_STATUS_CHANGE_SUBJECT', $fullorder_id);
             $comquick2cartHelper->sendmail($orderuser->user_email, $subject, $body, $params->get('sale_mail'));
         }
     }
 }
예제 #10
0
 /**
  * Get store Home Button
  *
  * @since   2.2
  * @return  button html.
  */
 public function getStoreHomeBtn()
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $cp_Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
     return "<button type=\"button\"  title='" . JText::_('QTC_BACK_TO_DASH_TTITLE') . "' class=\"btn btn-primary  btn_margin btn-small qtc_float_right\" onclick=\"window.open('" . JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=cp&Itemid=' . $cp_Itemid) . "','_self')\"  > <i class=\"icon-home icon-white\"></i> <?php echo JText::_( 'QTC_BACK_TO_DASH' ); ?>\n\t\t\t</button>";
 }
예제 #11
0
		</div>
	</div>
	<!-- eoc techjoomla-bootstrap -->
	<?php 
    return false;
}
// CHECK WHETHER User HAS STORE
if (!$this->store_id) {
    ?>
	<div class="<?php 
    echo Q2C_WRAPPER_CLASS;
    ?>
">
		<?php 
    if ($this->params->get('multivendor')) {
        $createstore_Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore');
        $createStore_link = JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=createstore&Itemid=' . $createstore_Itemid);
        $clickhere = '<a href="' . $createStore_link . '">' . JText::_('QTC_CLICK_HERE') . '</a> ' . JText::_('QTC_TO_CREATE_STORE');
        $msg = JText::sprintf('NO_STORE_FOUND', $clickhere);
    } else {
        $msg = JText::sprintf('COM_QUICK2CART_MULTIVENDOR_OFF_CANNT_CREATE_MSG');
    }
    JFactory::getApplication()->enqueueMessage($msg, 'Notice');
    ?>
	</div>
	<!-- eoc techjoomla-bootstrap -->
	<?php 
    return false;
}
// Take date a one year back in past.
$backdate = date('Y-m-d', strtotime(date('Y-m-d') . ' - 365 days'));
예제 #12
0
// 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;
    }
}
?>
<script type="text/javascript">

function qtcAddShipMethRates()
{
	var SelectedZoneVal  = document.id('zone_id').value;

예제 #13
0
 /**
  * This public function  give product link.
  *
  * @param   integer  $item_id   primary key of kart_items table.
  * @param   string   $linkType  Product link while displaying product or edit product.
  * @param   integer  $absolute  Link type.
  *
  * @since   2.2.2
  * @return  Object list.
  */
 public function getProductLink($item_id, $linkType = 'detailsLink', $absolute = 0)
 {
     $helperobj = new comquick2cartHelper();
     $db = JFactory::getDBO();
     $query = "SELECT `product_id`, `parent`\n\t\t FROM `#__kart_items`\n\t\t WHERE item_id=" . $item_id;
     $db->setQuery($query);
     $res = $db->loadAssoc();
     $link = "";
     $uri = JUri::getInstance();
     switch ($res["parent"]) {
         default:
         case "com_quick2cart":
             if ($linkType == 'detailsLink') {
                 $catpage_Itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=category');
                 $link = 'index.php?option=com_quick2cart&view=productpage&layout=default&item_id=' . $res["product_id"] . "&Itemid=" . $catpage_Itemid;
                 $link = JRoute::_($link, false);
             } elseif ($linkType == 'editLink') {
                 $add_product_itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=product');
                 $link = 'index.php?option=com_quick2cart&view=product&item_id=' . $res["product_id"] . '&Itemid=' . $add_product_itemid;
                 $link = JRoute::_($link, false);
             }
             break;
         case "com_content":
             if ($linkType == 'detailsLink') {
                 require_once JPATH_SITE . '/components/com_content/helpers/route.php';
                 $query = 'SELECT a.id, ' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug' . ' FROM #__content AS a ' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' WHERE a.id=' . $res["product_id"];
                 $db->setQuery($query);
                 $article = $db->loadObject();
                 $link = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false);
             } elseif ($linkType == 'editLink') {
                 $link = JRoute::_('index.php?option=com_content&task=article.edit&a_id=' . $res["product_id"] . '&return=' . base64_encode($uri), false);
             }
             break;
         case "com_zoo":
             if ($linkType == 'detailsLink') {
                 $Itemid = $helperobj->getitemid('index.php?option=com_zoo&task=item');
                 $link = "index.php?option=com_zoo&task=item&item_id=" . $res["product_id"] . "&Itemid=" . $Itemid;
                 $link = JRoute::_($link, false);
             } elseif ($linkType == 'editLink') {
                 $zooConfigFile = JPATH_ADMINISTRATOR . '/components/com_zoo/config.php';
                 if (JFile::exists($zooConfigFile)) {
                     require_once $zooConfigFile;
                 }
                 $zooApp = App::getInstance('zoo');
                 /*$add_product_itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=product');
                 		$link = JRoute::_('index.php?option=com_quick2cart&view=product&item_id=' . $res["product_id"] . '&Itemid=' . $add_product_itemid, false);*/
                 $item = $zooApp->table->item->get($res["product_id"]);
                 // Get submission type of item
                 $type = $item->type;
                 /*// Here is the exact hash for the record
                 					$hashRelated = $zooApp->submission->getSubmissionHash(1, $type, $res["product_id"]);
                 
                 					@TODO - get and use submission_id insted of using hardcoded value 1
                 					Construct link as zoo
                 						$link = JRoute::_('index.php?option=com_zoo&view=submission&layout=submission&submission_id=1&type_id='
                 						 . $type. '&item_id=' . $res["product_id"] . '&submission_hash=' . $hashRelated, false);*/
                 $link = $zooApp->route->submission($item->getApplication()->getItemEditSubmission(), $item->type, null, $item->id, 'itemedit');
             }
             break;
         case "com_k2":
             require_once JPATH_SITE . '/components/com_k2/helpers/route.php';
             $Itemid = $helperobj->getitemid('index.php?option=com_k2&view=item');
             if ($linkType == 'detailsLink') {
                 $query = "SELECT a.id, a.alias, a.catid,\n\t\t\t\t b.alias as categoryalias\n\t\t\t\t FROM #__k2_items as a\n\t\t\t\t LEFT JOIN #__k2_categories AS b ON b.id = a.catid\n\t\t\t\t WHERE a.id = " . $res["product_id"];
                 $db->setQuery($query);
                 $k2item = $db->loadObject();
                 $link = K2HelperRoute::getItemRoute($k2item->id . ':' . urlencode($k2item->alias), $k2item->catid . ':' . urlencode($k2item->categoryalias));
             } elseif ($linkType == 'editLink') {
                 $Itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=product');
                 $link = 'index.php?option=com_k2&view=item&layout=itemform&task=edit&cid=' . $res["product_id"] . '&Itemid=' . $Itemid;
             }
             $link = JRoute::_($link, false);
             break;
         case "com_flexicontent":
             $Itemid = $helperobj->getitemid('index.php?option=com_flexicontent&view=item');
             if ($linkType == 'detailsLink') {
                 $link = 'index.php?option=com_flexicontent&view=item&id=' . $res["product_id"] . "&Itemid=" . $Itemid;
             } elseif ($linkType == 'editLink') {
                 // @TODO - add catid, alias etc here
                 $link = 'index.php?option=com_flexicontent&view=item&task=edit&id=' . $res["product_id"] . "&Itemid=" . $Itemid;
             }
             $link = JRoute::_($link, false);
             break;
     }
     if ($absolute == 1) {
         $link = JUri::root() . substr($link, strlen(JUri::base(true)) + 1);
     }
     return $link;
 }
예제 #14
0
    $path = JPATH_SITE . DS . 'libraries' . DS . 'joomla' . DS . 'html' . DS . 'html' . DS . 'category.php';
    if (!class_exists('JHtmlCategory')) {
        JLoader::register('JHtmlCategory', $path);
        JLoader::load('JHtmlCategory');
    }
    // JUGAD fix for error #20162
    if (!empty($comp_option)) {
        $qtc_cat_options = JHtml::_('category.options', 'com_quick2cart', array('filter.published' => array(1)));
    } else {
        // Get categories manually
        $qtc_cat_options = $comquick2cartHelper->getQ2cCats(1);
    }
    $cats = array_merge($options, $qtc_cat_options);
}
// GETTING ITEM ID
$catItemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&' . $qtc_linkparam);
?>

<div class="row-fluid qtc_category_list <?php 
echo $classes;
?>
" style="<?php 
echo $scroll_style;
?>
">
	<div class="span12">
		<div class="tj-list-group">
			<strong class="tj-list-group-item"><?php 
echo JText::_('QTC_PROD_SEL_CAT_HEADER');
?>
</strong>
예제 #15
0
//$this->params->get('multivendor');
if (empty($multivendor_enable)) {
    return;
}
$jinput = JFactory::getApplication()->input;
$preview = $jinput->get("preview");
if (!empty($preview)) {
    return;
}
?>

<div class="qtc_toolbarDiv">
	<?php 
if (!$user->guest) {
    $comquick2cartHelper = new comquick2cartHelper();
    $this->store_cp_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
    $this->create_store_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=createstore');
    $this->my_stores_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=stores&layout=my');
    $this->my_payouts_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=payouts&layout=my');
    $this->my_coupons_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=coupons&layout=my');
    $this->store_customers_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders&layout=mycustomer');
    $this->store_orders_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders&layout=storeorder');
    $this->view_products_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=category');
    $this->add_product_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=product');
    $this->my_products_itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=category&layout=my');
    $this->store_id = !empty($this->store_id) ? $this->store_id : 0;
    $storeLimitPerUser = $this->params->get('storeLimitPerUser');
    $storeHelper = new storeHelper();
    $allowToCreateStore = $storeHelper->isAllowedToCreateNewStore();
    ?>
예제 #16
0
}
/*if (empty($showqty) )
		{
			?>
			<div class="controls">
				<button class="btn btn-small btn-success qtc_buyBtn_style" type="button"
					onclick="qtc_addtocart('<?php echo $fun_param; ?>');">
						<i class="<?php echo QTC_ICON_CART;?>"></i> <?php echo JText::_('QTC_ITEM_BUY');?>
				</button>
			</div>
			<?php
		}*/
$popup_buynow = $this->params->get('popup_buynow', 1);
if ($popup_buynow == 2) {
    $checkout = 'index.php?option=com_quick2cart&view=cart';
    $itemid = $comquick2cartHelper->getitemid($checkout);
    $action_link = JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=cartcheckout&Itemid=' . $itemid, false), strlen(JUri::base(true)) + 1);
    ?>

									<div class="cart-popup" id="<?php 
    echo $fun_param;
    ?>
_popup" style="display: none;">
										<div class="message"></div>
										<div class="cart_link">
											<a class="btn btn-success" href="<?php 
    echo $action_link;
    ?>
">
												<?php 
    echo JText::_('COM_QUICK2CART_VIEW_CART');
예제 #17
0
 /**
  * Function used to process free orders
  *
  * @return  void
  *
  * @since  1.0.0
  */
 public function processFreeOrder()
 {
     $jinput = JFactory::getApplication()->input;
     $comquick2cartHelper = new comquick2cartHelper();
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $post = $jinput->post;
     $orderid = $post->get('orderid', '', 'STRING');
     $guest_email = '';
     if (!empty($orderid)) {
         $query = "SELECT `amount`,`email` FROM `#__kart_orders` where `id`=" . $orderid;
         $db->setQuery($query);
         $orderDetail = $db->loadAssoc();
         $orderPrice = (int) $orderDetail['amount'];
         if (empty($orderPrice)) {
             if (empty($user->id) && $orderDetail['email']) {
                 $guest_email = "&email=" . md5($orderDetail['email']);
             }
             // CONFORM ONLY 0 PRICE ORDER
             $comquick2cartHelper->updatestatus($orderid, 'C', $comment = '', $send_mail = 1, $store_id = 0);
         }
     }
     global $mainframe;
     $mainframe = JFactory::getApplication();
     $orderItemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders');
     $orderLink = 'index.php?option=com_quick2cart&view=orders&layout=order&orderid=' . $orderid . '&Itemid=' . $orderItemid . $guest_email;
     $link = JUri::base() . substr(JRoute::_($orderLink, false), strlen(JUri::base(true)) + 1);
     $mainframe->redirect($link);
 }
예제 #18
0
 * @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">
		<div class="tj-list-group">
			<strong class="tj-list-group-item"><?php 
echo JText::_('QTC_SEL_VENDOR');
?>
</strong>
예제 #19
0
 /**
  * Method to save a user's profile data.
  *
  * @return    void
  *
  * @since    1.6
  */
 public function save()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialise variables.
     $app = JFactory::getApplication();
     $model = $this->getModel('ZoneForm', 'quick2cartModel');
     // Get the user data.
     $data = JFactory::getApplication()->input->get('jform', array(), 'array');
     $task = JFactory::getApplication()->input->get('task', null, '');
     // Validate the posted data.
     $form = $model->getForm();
     if (!$form) {
         JError::raiseError(500, $model->getError());
         return false;
     }
     // Validate the posted data.
     $data = $model->validate($form, $data);
     // Check for errors.
     if ($data === false) {
         // Get the validation messages.
         $errors = $model->getErrors();
         // Push up to three validation messages out to the user.
         for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
             if ($errors[$i] instanceof Exception) {
                 $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
             } else {
                 $app->enqueueMessage($errors[$i], 'warning');
             }
         }
         $input = $app->input;
         $jform = $input->get('jform', array(), 'ARRAY');
         // Save the data in the session.
         $app->setUserState('com_quick2cart.edit.zone.data', $jform, array());
         // Redirect back to the edit screen.
         $id = (int) $app->getUserState('com_quick2cart.edit.zone.id');
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=zoneform&layout=edit&id=' . $id, false));
         return false;
     }
     // Attempt to save the data.
     $return = $model->save($data);
     // Check for errors.
     if ($return === false) {
         // Save the data in the session.
         $app->setUserState('com_quick2cart.edit.zone.data', $data);
         // Redirect back to the edit screen.
         $id = (int) $app->getUserState('com_quick2cart.edit.zone.id');
         $this->setMessage(JText::sprintf('Save failed', $model->getError()), 'warning');
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=zoneform&layout=edit&id=' . $id, false));
         return false;
     }
     // Check in the profile.
     if ($return) {
         $model->checkin($return);
     }
     // Clear the profile id from the session.
     $app->setUserState('com_quick2cart.edit.zone.id', null);
     $comquick2cartHelper = new comquick2cartHelper();
     $itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
     if ($task == "save") {
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=zoneform&layout=edit&id=' . $return . '&Itemid=' . $itemid, false));
     } else {
         // Task= save and close
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=zones&Itemid=' . $itemid, false));
     }
     // Flush the data from the session.
     $app->setUserState('com_quick2cart.edit.zone.data', null);
 }
예제 #20
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);
 }
예제 #21
0
 /** This function starts download*/
 function downStart()
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $Quick2cartControllerProduct = new Quick2cartControllerProduct();
     $productHelper = new productHelper();
     global $mainframe;
     $mainframe = JFactory::getApplication();
     $myDonloadItemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=downloads');
     $jinput = JFactory::getApplication()->input;
     $file_id = $jinput->get('fid', 0, 'INTEGER');
     $strorecall = $jinput->get('strorecall', 0, 'INTEGER');
     $guest_email = $jinput->get('guest_email', '', 'RAW');
     $orderid = $jinput->get('orderid', 0, 'INTEGER');
     $order_item_id = $jinput->get('order_item_id', 0, 'INTEGER');
     $authorize = $productHelper->mediaFileAuthorise($file_id, $strorecall, $guest_email, $order_item_id);
     if (!empty($authorize['validDownload']) && $authorize['validDownload'] == 1) {
         $productHelper = new productHelper();
         $filepath = $productHelper->getFilePathToDownload($file_id);
         // Download will start
         $down_status = $productHelper->download($filepath, '', '', 0);
         if ($down_status === 2) {
             // If filepath not exists The requested download file does not exists
             JFactory::getApplication()->enqueueMessage(JText::_('QTC_DOWNLOAD_FILEPATH_NOTEXISTS'), 'error');
             $mainframe->redirect(JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=downloads&Itemid=' . $myDonloadItemid), strlen(JUri::base(true)) + 1));
         } elseif (!empty($authorize['orderItemFileId'])) {
             // YOU WILL GET FOR THIS FIELD ONLY FOR PURCHASE REQUIRED FILE
             $productHelper->updateFileDownloadCount($authorize['orderItemFileId']);
             // kart_orderItemFiles tables primary key
         }
         // Exit tab
         return;
     } else {
         JFactory::getApplication()->enqueueMessage(JText::_('QTC_DOWNLOAD_NOT_AUTHORIZED'), 'error');
         $mainframe->redirect(JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=downloads&Itemid=' . $myDonloadItemid), strlen(JUri::base(true)) + 1));
     }
     JFactory::getApplication()->enqueueMessage(JText::_('SOME_ERROR_OCCURRED'), 'error');
     $mainframe->redirect(JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=downloads&Itemid=' . $myDonloadItemid), strlen(JUri::base(true)) + 1));
 }
예제 #22
0
 /**
  * This function provide href field contains. Specified where to go(which task), onclick of download link
  *
  * @param   INT  $item_id integer    item_id of prod
  * @param   INT  $purchase_required  integer if set if 1, return all files else only free file are
  *
  * @return  VOID
  */
 function getMediaDownloadLinkHref($fileid, $extraUrlPrams = '')
 {
     $helperobj = new comquick2cartHelper();
     //  If url extra param is present
     if (!empty($extraUrlPrams)) {
         $extraUrlPrams = '&' . $extraUrlPrams;
     }
     $storecp_Itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=downloads');
     $link = JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&task=product.downStart&fid=' . $fileid . $extraUrlPrams . '&Itemid=' . $storecp_Itemid), strlen(JUri::base(true)) + 1);
     return $link;
 }
예제 #23
0
 function processpayment($post, $pg_plugin, $order_id)
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $jinput = JFactory::getApplication()->input;
     $jinput->set('remote', 1);
     $sacontroller = new quick2cartController();
     $sacontroller->execute('clearcart');
     $orderItemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=orders');
     $chkoutItemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=cartcheckout');
     $return_resp = array();
     //Authorise Post Data
     if (!empty($post['plugin_payment_method']) && $post['plugin_payment_method'] == 'onsite') {
         $plugin_payment_method = $post['plugin_payment_method'];
     }
     $order_id = $this->extract_prefix($order_id);
     $vars = $this->getPaymentVars($pg_plugin, $order_id);
     // Payment trigger
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('payment', $pg_plugin);
     $data = $dispatcher->trigger('onTP_Processpayment', array($post, $vars));
     //$vars added by aniket
     $data = $data[0];
     $res = @$this->storelog($pg_plugin, $data);
     //get order id
     if (empty($order_id)) {
         $order_id = $data['order_id'];
     }
     $order_id = $this->extract_prefix($order_id);
     /*start for guest checkout*/
     $query = "SELECT ou.user_id,ou.user_email\n\t\t\tFROM #__kart_users as ou\n\t\t\tWHERE ou.address_type='BT' AND ou.order_id = " . $order_id;
     $this->_db->setQuery($query);
     $user_detail = $this->_db->loadObject();
     $params = JComponentHelper::getParams('com_quick2cart');
     $guest_email = "";
     if (!$user_detail->user_id && $params->get('guest')) {
         $guest_email = "&email=" . md5($user_detail->user_email);
     }
     /*end for guest checkout*/
     $data['processor'] = $pg_plugin;
     $data['status'] = trim($data['status']);
     $query = "SELECT o.amount\n\t\t\t\tFROM #__kart_orders  as o\n\t\t\t\twhere o.id=" . $order_id;
     $this->_db->setQuery($query);
     $order_amount = $this->_db->loadResult();
     $return_resp['status'] = '0';
     $epsilon = 0.0;
     $epsilon2 = 0.01;
     $return_resp['msg'] = JText::_('COM_QUICK2CART_ORDER_THNX');
     if ($data['status'] == 'C' && $data['total_paid_amt'] - $order_amount >= $epsilon) {
         // received amount is greater or equal to order amount
         $data['status'] = 'C';
         $return_resp['status'] = '1';
         $return_resp['msg'] = JText::_('COM_QUICK2CART_ORDER_THNX_CONFIRM');
     } else {
         if ($order_amount - $data['total_paid_amt'] > $epsilon2) {
             // received amount les
             $data['status'] = 'E';
             $return_resp['status'] = '0';
             $comp_pay = "&paybuttonstatus=1";
             $return_resp['msg'] = JText::_('COM_QUICK2CART_ORDER_THNX_ERROR');
         } else {
             if (empty($data['status'])) {
                 $data['status'] = 'P';
                 $return_resp['status'] = '0';
                 $comp_pay = "&paybuttonstatus=1";
                 $return_resp['msg'] = JText::_('COM_QUICK2CART_ORDER_THNX');
             }
         }
     }
     if ($data['status'] != 'C' && !empty($data['error'])) {
         $return_resp['msg'] = $data['error']['code'] . " " . $data['error']['desc'];
         $comp_pay = "&paybuttonstatus=1";
         $link = '<a href="#complete-order">' . JText::_('COM_QUICK2CART_ORDER_PROCESS_AGAIN_TEXT') . '</a>';
         $comp_pay_msg = '</br>' . JText::sprintf('COM_QUICK2CART_ORDER_PROCESS_AGAIN', $link);
         $return_resp['msg'] .= $comp_pay_msg;
     }
     $this->updateOrder($data, $pg_plugin);
     $comquick2cartHelper->updatestatus($order_id, $data['status']);
     $return_resp['return'] = JUri::root() . substr(JRoute::_("index.php?option=com_quick2cart&view=orders&layout=order" . $guest_email . "&orderid=" . $order_id . "&processor={$pg_plugin}" . $comp_pay . "&Itemid=" . $orderItemid, false), strlen(JUri::base(true)) + 1);
     return $return_resp;
 }
예제 #24
0
 /**
  * Change state of an item.
  *
  * @return  void
  *
  * @since  1.0.0
  */
 public function unpublish()
 {
     $input = JFactory::getApplication()->input;
     $cid = $input->get('cid', '', 'array');
     JArrayHelper::toInteger($cid);
     $model = $this->getModel('zones');
     if ($model->setItemState($cid, 0)) {
         $count = count($cid);
         if ($count > 1) {
             $msg = JText::sprintf(JText::_('COM_QUICK2CART_ZONE_UNPUBLISHED'), $count);
         } else {
             $msg = JText::sprintf(JText::_('COM_QUICK2CART_ZONE_UNPUBLISHED'), $count);
         }
     } else {
         $msg = $model->getError();
     }
     $comquick2cartHelper = new comquick2cartHelper();
     $itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=zones');
     $redirect = JRoute::_('index.php?option=com_quick2cart&view=zones&Itemid=' . $itemid, false);
     $this->setMessage($msg);
     $this->setRedirect($redirect);
 }
예제 #25
0
 * @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;
$lang = JFactory::getLanguage();
$lang->load('mod_quick2cart', JPATH_ROOT);
$comparams = JComponentHelper::getParams('com_quick2cart');
$document = JFactory::getDocument();
$document->addStyleSheet(JUri::root(true) . '/components/com_quick2cart/assets/css/quick2cart.css');
$ckout_text = $params->get('checkout_text', '');
$ckout_text = trim($ckout_text);
$comquick2cartHelper = new comquick2cartHelper();
$Itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=cart');
?>

<script type="text/javascript">
	function divHideShow(key)
	{
		/* toggle is for changing state - from hide to visible and vice versa*/
		techjoomla.jQuery("#qtc_showhide"+key).slideToggle('', '', function()
		{
			var isVisible = techjoomla.jQuery('#qtc_showhide'+key).is(':visible');
			var className = techjoomla.jQuery('#qtc_item_id'+key).attr('class');

			if (isVisible)
			{
				techjoomla.jQuery('#qtc_item_id'+key).removeClass('qtc_icon-plus').addClass('qtc_icon-minus');
			}
예제 #26
0
        ?>
');"><i class="<?php 
        echo QTC_ICON_CART;
        ?>
"></i> <?php 
        echo JText::_('QTC_ITEM_BUY');
        ?>
</button>
			</div>
		<?php 
    }
    // Get pop up style
    $popup_buynow = $params->get('popup_buynow', 1);
    if ($popup_buynow == 2) {
        $checkout = 'index.php?option=com_quick2cart&view=cart';
        $itemid = $comquick2cartHelper->getitemid($checkout);
        $action_link = JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=cartcheckout&Itemid=' . $itemid, false), strlen(JUri::base(true)) + 1);
        ?>
			<div class="cart-popup" id="<?php 
        echo $this->product_id;
        ?>
_popup" style="display: none;">
				<div class="message"></div>
				<div class="cart_link"><a class="btn btn-success" href="<?php 
        echo $action_link;
        ?>
"><?php 
        echo JText::_('COM_QUICK2CART_VIEW_CART');
        ?>
</a></div>
				<i class="icon-remove cart-popup_close" onclick="techjoomla.jQuery(this).parent().slideUp().hide();"></i>
예제 #27
0
 /**
  * Method to save a user's profile data.
  *
  * @return	void
  * @since	1.6
  */
 public function save()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialise variables.
     $app = JFactory::getApplication();
     $editId = JFactory::getApplication()->input->getInt('id', null, 'array');
     $task = JFactory::getApplication()->input->get('task', null, '');
     // Set the user id for the user to edit in the session.
     $app->setUserState('taxrateform.id', $editId);
     $model = $this->getModel('TaxrateForm', 'Quick2cartModel');
     // Get the user data.
     $data = JFactory::getApplication()->input->get('jform', array(), 'array');
     // Add current id
     $data['id'] = $editId;
     // Validate the posted data.
     $form = $model->getForm();
     if (!$form) {
         JError::raiseError(500, $model->getError());
         return false;
     }
     // Validate the posted data.
     $data = $model->validate($form, $data);
     // Check for errors.
     if ($data === false) {
         // Get the validation messages.
         $errors = $model->getErrors();
         // Push up to three validation messages out to the user.
         for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
             if ($errors[$i] instanceof Exception) {
                 $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
             } else {
                 $app->enqueueMessage($errors[$i], 'warning');
             }
         }
         $input = $app->input;
         $jform = $input->get('jform', array(), 'ARRAY');
         // Save the data in the session.
         $app->setUserState('com_quick2cart.edit.taxrate.data', $jform, array());
         // Redirect back to the edit screen.
         $id = (int) $app->getUserState('com_quick2cart.edit.taxrateform.id');
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=taxrateform&layout=edit&id=' . $id, false));
         return false;
     }
     // Attempt to save the data.
     $return = $model->save($data);
     // Check for errors.
     if ($return === false) {
         // Save the data in the session.
         $app->setUserState('com_quick2cart.edit.taxrate.data', $data);
         // Redirect back to the edit screen.
         $id = (int) $app->getUserState('com_quick2cart.edit.taxrateform.id');
         $this->setMessage(JText::sprintf(JText::_('COM_QUICK2CART_ITEM_SAVED_FAIL'), $model->getError()), 'warning');
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=taxrateform&&id=' . $id, false));
         return false;
     }
     // Check in the profile.
     if ($return) {
         $model->checkin($return);
     }
     // Clear the profile id from the session.
     $app->setUserState('com_quick2cart.edit.taxrateform.id', null);
     // Redirect to the list screen.
     $this->setMessage(JText::_('COM_QUICK2CART_ITEM_SAVED_SUCCESSFULLY'));
     // To get active menu
     //$menu = JSite::getMenu();
     //$item = $menu->getActive();
     //$menuItem = $menu->getItems( 'link', 'index.php?option=com_quick2cart&view=vendor&layout=cp', true );
     $comquick2cartHelper = new comquick2cartHelper();
     $itemid = $comquick2cartHelper->getitemid('index.php?option=com_quick2cart&view=vendor&layout=cp');
     if ($task == "save") {
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=taxrateform&id=' . $return . '&Itemid=' . $itemid, false));
     } else {
         // Task= save and close
         $this->setRedirect(JRoute::_('index.php?option=com_quick2cart&view=taxrates&Itemid=' . $itemid, false));
     }
     // Flush the data from the session.
     $app->setUserState('com_quick2cart.edit.taxrate.data', null);
 }