当前位置: 首页>>代码示例>>PHP>>正文


PHP comquick2cartHelper::getQtcSocialLibObj方法代码示例

本文整理汇总了PHP中comquick2cartHelper::getQtcSocialLibObj方法的典型用法代码示例。如果您正苦于以下问题:PHP comquick2cartHelper::getQtcSocialLibObj方法的具体用法?PHP comquick2cartHelper::getQtcSocialLibObj怎么用?PHP comquick2cartHelper::getQtcSocialLibObj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comquick2cartHelper的用法示例。


在下文中一共展示了comquick2cartHelper::getQtcSocialLibObj方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store


//.........这里部分代码省略.........
         $header_path = '';
         $row->header = $header_path;
         $extra = $post->get('extra', '', 'RAW');
         if (!empty($extra)) {
             // While update , AVOID DONT MAKE EMPTY
             $row->extra = $extra;
         }
         $row->payment_mode = $post->get('paymentMode');
         if (empty($row->payment_mode)) {
             $row->pay_detail = $post->get('paypalemail', '', 'RAW');
         } else {
             $row->pay_detail = $post->get('otherPayMethod', '', 'RAW');
         }
         $quick2cartModelVendor = new quick2cartModelVendor();
         //$row->live =$post['title'];
         //$row->extra=
         $id = "";
         $title = $post->get('title', '', 'RAW');
         $storeVanityUrl = $post->get('storeVanityUrl', '', 'RAW');
         $id = $post->get('id', '', 'RAW');
         // If already present then update
         if (!empty($oldData)) {
             $row->title = $quick2cartModelVendor->formatttedTitle($title, $id);
             $row->vanityurl = $quick2cartModelVendor->formatttedVanityURL($storeVanityUrl, $title, $id);
             $row->id = $id = $oldData['id'];
             $row->mdate = date("Y-m-d");
             try {
                 $db->updateObject('#__kart_store', $row, 'id');
             } catch (RuntimeException $e) {
                 $this->setError($e->getMessage());
                 return 0;
             }
             $mail_on_store_edit = (int) $params->get('mail_on_store_edit');
             if ($mail_on_store_edit === 1) {
                 // Send store edited email to admin
                 $this->SendMailAdminOnStoreEdit($row);
             }
             $role = 1;
             $quick2cartModelVendor->addRoleEntry($id, $role, $row->owner);
             return $id;
         } else {
             // Insert
             $row->title = $quick2cartModelVendor->formatttedTitle($title);
             $row->vanityurl = $quick2cartModelVendor->formatttedVanityURL($storeVanityUrl, $title);
             $row->cdate = date("Y-m-d");
             $row->mdate = date("Y-m-d");
             $mail_on_store_create = (int) $params->get('mail_on_store_create');
             if ($mail_on_store_create == 1) {
                 $row->live = 0;
             }
             if (!$db->insertObject('#__kart_store', $row, 'id')) {
                 echo $db->stderr();
                 return 0;
             }
             if ($mail_on_store_create === 1) {
                 // Send Approval mail to admin
                 $this->SendMailAdminOnCreateStore($row);
                 $this->SendMailOwnerOnCreateStore($row);
             }
             $id = $db->insertid();
             global $mainframe;
             $mainframe = JFactory::getApplication();
             $socialintegration = $params->get('integrate_with', 'none');
             $streamOnCeateStore = $params->get('streamCeateStore', 1);
             // If (!$mainframe->isAdmin() && $streamOnCeateStore && $socialintegration != 'none')
             if ($socialintegration != 'none') {
                 $user = JFactory::getUser();
                 $libclass = $comquick2cartHelper->getQtcSocialLibObj();
                 // Add in activity.
                 if ($streamOnCeateStore) {
                     $action = 'addstore';
                     $storeLink = '<a class="" href="' . JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=store&store_id=' . $id), strlen(JUri::base(true)) + 1) . '">' . $title . '</a>';
                     $originalMsg = JText::sprintf('QTC_ACTIVITY_ADD_STORE', $storeLink);
                     $libclass->pushActivity($user->id, $act_type = '', $act_subtype = '', $originalMsg, $act_link = '', $title = '', $act_access = 0);
                 }
                 // Add points
                 $point_system = $params->get('point_system');
                 $options['extension'] = 'com_quick2cart';
                 if ($socialintegration == "EasySocial") {
                     $options['command'] = 'create_store';
                     $libclass->addpoints($user, $options);
                 } elseif ($socialintegration == "JomSocial") {
                     $options['command'] = 'CreateStore.points';
                     $libclass->addpoints($user, $options);
                 }
             }
         }
         $role = 1;
         $uid = $user->id;
         if ($userid != '') {
             $uid = $userid;
         }
         $quick2cartModelVendor = new quick2cartModelVendor();
         $quick2cartModelVendor->addRoleEntry($id, $role, $uid);
         // Add only on creating store insted of edit
         return $id;
     } else {
         return 0;
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:vendor.php

示例2: storeHelper

<?php

/**
 * @version    SVN: <svn_id>
 * @package    Quick2cart
 * @author     Techjoomla <extensions@techjoomla.com>
 * @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');
//jimport( 'activity.socialintegration.profiledata' );
$comquick2cartHelper = new comquick2cartHelper();
$libclass = $comquick2cartHelper->getQtcSocialLibObj();
$mainframe = JFactory::getApplication();
$input = $mainframe->input;
$layout = $input->get('layout');
$params = JComponentHelper::getParams('com_quick2cart');
// Get store Owner.
if (!class_exists('storeHelper')) {
    $path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'storeHelper.php';
    JLoader::register('storeHelper', $path);
    JLoader::load('storeHelper');
}
$storeHelper = new storeHelper();
$storeOwner = $storeHelper->getStoreOwner($this->store_id);
$integrate_with = $params->get('integrate_with', 'none');
if ($integrate_with != 'none') {
    $profile_url = $libclass->getProfileUrl(JFactory::getUser($storeOwner));
    $UserName = JFactory::getUser($storeOwner)->name;
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:storeinfo.php

示例3: storeInKartItem

 public function storeInKartItem($operation, $images, $price, $curr_post)
 {
     $db = JFactory::getDbo();
     $params = JComponentHelper::getParams('com_quick2cart');
     $on_editor = $params->get('enable_editor', 0);
     $kart_item = new stdClass();
     $kart_item->parent = $curr_post->get('client', '', 'STRING');
     $kart_item->store_id = $curr_post->get('store_id', '', 'INT');
     //@TODO check - ^manoj
     //$kart_item->store_id = $curr_post->get('current_store','','INT');
     $kart_item->product_id = $curr_post->get('pid', '', 'INT');
     $kart_item->name = $curr_post->get('item_name', '', 'STRING');
     $kart_item->price = $price;
     $kart_item->category = $curr_post->get('prod_cat', '', 'INT');
     $kart_item->sku = $curr_post->get('sku', '', 'RAW');
     $des = $curr_post->get('description', array(), 'ARRAY');
     if (!$on_editor) {
         // Remove html when editor is OFF
         $kart_item->description = !empty($des['data']) ? strip_tags($des['data']) : '';
     } else {
         $kart_item->description = !empty($des['data']) ? $des['data'] : '';
     }
     $kart_item->video_link = $curr_post->get('youtube_link', '', 'STRING');
     // #40581 = temporary fix (For zoo state field is overlapping with item's state field)
     $stateField = $curr_post->get('qtcProdState', '', 'INT');
     if ($stateField === 0 || $stateField === 1) {
         $kart_item->state = $stateField;
     } else {
         $kart_item->state = $curr_post->get('state', '0', 'INT');
     }
     $stock = $curr_post->get('stock');
     // @HAVE TO CODE TO STORE IMAGES
     if ($stock !== "") {
         $kart_item->stock = $stock;
     }
     $kart_item->metadesc = $curr_post->get('metadesc', '', 'STRING');
     $kart_item->metakey = $curr_post->get('metakey', '', 'STRING');
     // Added by sanjivani
     $kart_item->item_length = $curr_post->get('qtc_item_length', '', 'FLOAT');
     $kart_item->item_width = $curr_post->get('qtc_item_width', '', 'FLOAT');
     $kart_item->item_height = $curr_post->get('qtc_item_height', '', 'FLOAT');
     $kart_item->item_length_class_id = $curr_post->get('length_class_id', '', 'INT');
     $kart_item->item_weight = $curr_post->get('qtc_item_weight', '', 'FLOAT');
     $kart_item->item_weight_class_id = $curr_post->get('weigth_class_id', '', 'INT');
     $kart_item->taxprofile_id = $curr_post->get('taxprofile_id', '', 'INT');
     $kart_item->shipProfileId = $curr_post->get('qtc_shipProfile', '', 'INT');
     $min_quantity = $curr_post->get('min_item', 1, 'INT');
     $max_quantity = $curr_post->get('max_item', 999, 'INT');
     if ($min_quantity == 0) {
         $kart_item->min_quantity = 1;
     } else {
         $kart_item->min_quantity = $min_quantity;
     }
     if ($max_quantity == 0) {
         $kart_item->max_quantity = 999;
     } else {
         $kart_item->max_quantity = $max_quantity;
     }
     $kart_item->slab = $curr_post->get('item_slab', '', 'INT');
     if ($operation == 'insert') {
         if (!empty($images)) {
             $kart_item->images = $images;
         }
         $kart_item->cdate = date("Y-m-d");
         $kart_item->mdate = date("Y-m-d");
         if (!$db->insertObject('#__kart_items', $kart_item, 'item_id')) {
             $messagetype = 'notice';
             $message = JText::_('QTC_PARAMS_SAVE_FAIL') . " - " . $db->stderr();
         } else {
             $inserid = $db->insertid();
             if ($kart_item->parent == "com_quick2cart") {
                 $quick2cartModelAttributes = new quick2cartModelAttributes();
                 $quick2cartModelAttributes->copyItemidToProdid($inserid);
             }
             // Add point to Community extension when product added into Quick2cart
             $params = JComponentHelper::getParams('com_quick2cart');
             $integrate_with = $params->get('integrate_with', 'none');
             $user = JFactory::getUser();
             if ($integrate_with != 'none') {
                 $streamAddProd = $params->get('streamAddProd', 1);
                 $point_system = $params->get('point_system', '0');
                 // According to integration create social lib class obj.
                 $comquick2cartHelper = new comquick2cartHelper();
                 $libclass = $comquick2cartHelper->getQtcSocialLibObj();
                 // Add in activity.
                 if ($streamAddProd) {
                     $prodLink = '<a class="" href="' . $comquick2cartHelper->getProductLink($inserid) . '">' . $kart_item->name . '</a>';
                     $store_info = $comquick2cartHelper->getSoreInfo($kart_item->store_id);
                     $storeLink = '<a class="" href="' . JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=store&store_id=' . $kart_item->store_id), strlen(JUri::base(true)) + 1) . '">' . $store_info['title'] . '</a>';
                     $originalMsg = JText::sprintf('QTC_ACTIVITY_ADD_PROD', $prodLink, $storeLink);
                     $libclass->pushActivity($user->id, $act_type = '', $act_subtype = '', $originalMsg, $act_link = '', $title = '', $act_access = '');
                 }
                 // Add points
                 $point_system = $params->get('point_system');
                 $options['extension'] = 'com_quick2cart';
                 if ($integrate_with == "EasySocial") {
                     $options['command'] = 'add_product';
                 } elseif ($integrate_with == "JomSocial") {
                     $options['command'] = 'addproduct.points';
                 }
//.........这里部分代码省略.........
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:attributes.php

示例4: addSaveOrderItems

 function addSaveOrderItems($insert_order_id, $cart_itemsdata, $data, $updateOrderstatus)
 {
     $productHelper = new productHelper();
     // GET BILLING AND SHIPPING ADDRESS
     $bill = $data->get('bill', array(), "ARRAY");
     $ship = $data->get('ship', array(), "ARRAY");
     $comquick2cartHelper = new comquick2cartHelper();
     $data->set('order_id', $insert_order_id);
     // row_id= last insert id
     $store_info = array();
     $itemsTaxDetail = $data->get('itemsTaxDetail', array(), 'ARRAY');
     $itemShipMethDetail = $data->get('itemShipMethDetail', array(), 'ARRAY');
     foreach ($cart_itemsdata as $cart_items) {
         $item_id = $cart_items['item_id'];
         $taxdetail = '';
         $shipdetail = '';
         // Get item tax detail
         if (!empty($itemsTaxDetail[$item_id])) {
             // Get current item tax detail
             $taxdetail = $itemsTaxDetail[$item_id];
         }
         // Get item ship detail
         if (!empty($itemShipMethDetail[$item_id])) {
             // Get current item tax detail
             $shipdetail = $itemShipMethDetail[$item_id];
         }
         $items = new stdClass();
         $items->order_id = $insert_order_id;
         $items->item_id = $item_id;
         // Getting store id from item_id
         $items->store_id = $comquick2cartHelper->getSoreID($cart_items['item_id']);
         $items->product_attributes = $cart_items['product_attributes'];
         $items->product_attribute_names = $cart_items['options'];
         $items->order_item_name = $cart_items['title'];
         $items->product_quantity = $cart_items['qty'];
         $items->product_item_price = $cart_items['amt'];
         $items->product_attributes_price = $cart_items['opt_amt'];
         // This field store price without cop, tax,shipp etc
         //~ $originalProdPrice = ($items->product_item_price + $items->product_attributes_price ) * $items->product_quantity;
         //~ $items->original_price = isset($cart_items['original_price']) ? $cart_items['original_price'] : $originalProdPrice;
         $items->original_price = $cart_items['original_price'];
         $items->item_tax = !empty($taxdetail['taxAmount']) ? $taxdetail['taxAmount'] : 0;
         $items->item_tax_detail = !empty($taxdetail) ? json_encode($taxdetail) : '';
         $items->item_shipcharges = !empty($shipdetail['totalShipCost']) ? $shipdetail['totalShipCost'] : 0;
         $items->item_shipDetail = !empty($shipdetail) ? json_encode($shipdetail) : '';
         $items->product_final_price = $cart_items['tamt'] + $items->item_tax + $items->item_shipcharges;
         $items->params = $cart_items['params'];
         $items->cdate = date("Y-m-d H:i:s");
         //$cart_items['cdate'];
         $items->mdate = date("Y-m-d H:i:s");
         //$cart_items['mdate'];
         $items->status = 'P';
         if (!$this->_db->insertObject('#__kart_order_item', $items, 'order_item_id')) {
             echo $this->_db->stderr();
             return 0;
         }
         // Add entry in order_itemattributes
         $query = "Select *\n\t\t\t FROM #__kart_cartitemattributes\n\t\t\t WHERE cart_item_id=" . (int) $cart_items['id'];
         // cart_item_id as id
         $this->_db->setQuery($query);
         $cartresult = $this->_db->loadAssocList();
         if (!empty($cartresult)) {
             foreach ($cartresult as $key => $cart_itemopt) {
                 $items_opt = new stdClass();
                 $items_opt->order_item_id = $items->order_item_id;
                 $items_opt->itemattributeoption_id = $cart_itemopt['itemattributeoption_id'];
                 $items_opt->orderitemattribute_name = $cart_itemopt['cartitemattribute_name'];
                 $attopprice = $this->getAttrOptionPrice($cart_itemopt['itemattributeoption_id']);
                 $items_opt->orderitemattribute_price = $attopprice;
                 $items_opt->orderitemattribute_prefix = $cart_itemopt['cartitemattribute_prefix'];
                 if (!$this->_db->insertObject('#__kart_order_itemattributes', $items_opt, 'orderitemattribute_id')) {
                     echo $this->_db->stderr();
                     return 0;
                 }
             }
         }
         $params = JComponentHelper::getParams('com_quick2cart');
         $socialintegration = $params->get('integrate_with', 'none');
         $streamBuyProd = $params->get('streamBuyProd', 0);
         //$libclass = new activityintegrationstream();
         if ($streamBuyProd && $socialintegration != 'none') {
             // adding msg in stream
             $user = JFactory::getUser();
             $action = 'buyproduct';
             $prodLink = '<a class="" href="' . $comquick2cartHelper->getProductLink($cart_items['item_id']) . '">' . $cart_items['title'] . '</a>';
             $store_info[$items->store_id] = $comquick2cartHelper->getSoreInfo($items->store_id);
             $storeLink = '<a class="" href="' . JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=store&store_id=' . $items->store_id), strlen(JUri::base(true)) + 1) . '">' . $store_info[$items->store_id]['title'] . '</a>';
             $originalMsg = JText::sprintf('QTC_ACTIVITY_BUY_PROD', $prodLink, $storeLink);
             $title = '{actor} ' . $originalMsg;
             // According to integration create social lib class obj.
             $libclass = $comquick2cartHelper->getQtcSocialLibObj();
             $libclass->pushActivity($user->id, $act_type = '', $act_subtype = '', $originalMsg, $act_link = '', $title = '', $act_access = '');
         }
         if (0) {
             // add to JS stream
             if (JFile::exists(JPATH_SITE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php')) {
                 @$comquick2cartHelper->addJSstream($user->id, $user->id, $title, '', $action, 0);
                 require_once JPATH_SITE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
                 $userid = JFactory::getUser()->id;
                 if ($userid) {
//.........这里部分代码省略.........
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:cartcheckout.php

示例5: addPoint

 /**
  * After Order Confirm Add point to buyer
  * count of order item X point allocate to action perform
  *
  * @param   INT  $oid  oid
  *
  * @return  VOID
  */
 public function addPoint($oid)
 {
     $db = JFactory::getDBO();
     $query = 'SELECT sum( `product_quantity` )  as count FROM `#__kart_order_item` WHERE `order_id`="' . $oid . '"';
     $db->setQuery($query);
     $count_item = $db->loadResult();
     //  Add point to Community extension when product added into Quick2cart
     $params = JComponentHelper::getParams('com_quick2cart');
     $point_system = $params->get('point_system');
     $integrate_with = $params->get('integrate_with');
     $user = JFactory::getUser();
     if ($point_system === '1') {
         //  According to integration create social lib class obj.
         $comquick2cartHelper = new comquick2cartHelper();
         $libclass = $comquick2cartHelper->getQtcSocialLibObj();
         $options['extension'] = 'com_quick2cart';
         if ($integrate_with === 'JomSocial') {
             $options['command'] = 'BuyProduct';
             for ($i = 0; $i < $count_item; $i++) {
                 $libclass->addpoints($user, $options);
             }
         } elseif ($integrate_with === 'EasySocial') {
             $options['command'] = 'buy_product';
             for ($i = 0; $i < $count_item; $i++) {
                 $libclass->addpoints($user, $options);
             }
         }
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:37,代码来源:product.php


注:本文中的comquick2cartHelper::getQtcSocialLibObj方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。