本文整理汇总了PHP中comquick2cartHelper::addJSnotify方法的典型用法代码示例。如果您正苦于以下问题:PHP comquick2cartHelper::addJSnotify方法的具体用法?PHP comquick2cartHelper::addJSnotify怎么用?PHP comquick2cartHelper::addJSnotify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comquick2cartHelper
的用法示例。
在下文中一共展示了comquick2cartHelper::addJSnotify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addSaveOrderItems
//.........这里部分代码省略.........
$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) {
$userLink = '<a class="" href="' . JUri::root() . substr(CRoute::_('index.php?option=com_community&view=profile&userid=' . $userid), strlen(JUri::base(true)) + 1) . '">' . JFactory::getUser()->name . '</a>';
} else {
$userLink = $bill['email1'];
}
//Get connected Users of logged in user
$jsuser = CFactory::getUser($userid);
$connections_aa = $jsuser->getFriendIds();
if (!empty($connections_aa)) {
foreach ($connections_aa as $connections) {
$notification_subject = JText::sprintf('QTC_NOTIFIY_BUY_PROD_FRN', $userLink, $prodLink);
@$comquick2cartHelper->addJSnotify($userid, $connections, $notification_subject, 'notif_system_messaging', '0', '');
}
}
$groupIDs = explode(",", $jsuser->_groups);
if (empty($groupIDs)) {
$query = "SELECT groupid FROM #__community_groups_members " . "WHERE memberid=" . $userid;
$this->_db->setQuery($query);
$groupIDs = $this->_db->loadColumn();
}
if (!empty($groupIDs)) {
foreach ($groupIDs as $groupID) {
if (!empty($groupID)) {
$query = "SELECT name FROM #__community_groups " . " WHERE id=" . $groupID;
$this->_db->setQuery($query);
$groupName = $this->_db->loadResult();
$query = "SELECT memberid " . "FROM #__community_groups_members " . "WHERE groupid=" . $groupID . " AND approved=1 AND memberid<>" . $userid . "";
$this->_db->setQuery($query);
$group_ids = $this->_db->loadColumn();
if (!empty($group_ids)) {
foreach ($group_ids as $group_id) {
$notification_subject = JText::sprintf('QTC_NOTIFIY_BUY_PROD_GRP', $userLink, $groupName, $prodLink);
$comquick2cartHelper->addJSnotify($userid, $group_id, $notification_subject, 'notif_system_messaging', '0', '');
}
}
}
}
}
}
}
// end of if (0)
// REMOVED JS CODE
/* end add to JS stream*/
}
// ENd of cart item for each
// For JS notification is sent
if (!empty($storeLink) && JFile::exists(JPATH_SITE . '/components/com_community/libraries/core.php')) {
require_once JPATH_SITE . '/components/com_community/libraries/core.php';
$commented_by_userid = JFactory::getUser()->id;
if ($commented_by_userid) {
$userLink = '<a class="" href="' . JUri::root() . substr(CRoute::_('index.php?option=com_community&view=profile&userid=' . $commented_by_userid), strlen(JUri::base(true)) + 1) . '">' . JFactory::getUser()->name . '</a>';
} else {
$userLink = $bill['email1'];
}
foreach ($store_info as $store_id => $storeinfo) {
$storeLink = '<a class="" href="' . JUri::root() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=store&store_id=' . $store_id), strlen(JUri::base(true)) + 1) . '">' . $storeinfo['title'] . '</a>';
$notification_subject = JText::sprintf('QTC_NOTIFIY_BUY_STORE', $userLink, $storeLink);
@$comquick2cartHelper->addJSnotify($commented_by_userid, $storeinfo['owner'], $notification_subject, 'notif_system_messaging', '0', '');
}
}
}
示例2: updateItemStock
/**
* Call this function after conform payment status
* This funtion deduct stock
*
* @param INTEGER $order_id orderid
*
* @return array() of Attribute details
*/
public function updateItemStock($order_id)
{
$db = JFactory::getDBO();
$q = "SELECT `item_id`,`product_quantity`\n\t\t\tFROM `#__kart_order_item`\n\t\t\tWHERE `order_id` =" . (int) $order_id;
$db->setQuery($q);
$result = $db->loadObjectList();
foreach ($result as $res) {
$minus_qty = "-" . $res->product_quantity;
$minus_qty = (int) $minus_qty;
$query = "UPDATE `#__kart_items`\n\t\t\t\t\t\tSET `stock` =\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tCASE\n\t\t\t\t\t\t\t WHEN\n\t\t\t\t\t\t\t\t `stock` IS NOT NULL\n\t\t\t\t\t\t\t THEN\n\t\t\t\t\t\t\t\t (`stock` - " . $res->product_quantity . ")\n\t\t\t\t\t\t\t ELSE\n\t\t\t\t\t\t\t\t ('" . $minus_qty . "')\n\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t)\n\t\t\t\t\t\tWHERE `item_id`=" . $res->item_id;
$db->setQuery($query);
$db->Query();
// Low stock notification
$q = "SELECT stock\n\t\t\t\tFROM `#__kart_items`\n\t\t\t\tWHERE `item_id` =" . (int) $res->item_id;
$db->setQuery($q);
$resultstock = $db->loadResult();
$params = JComponentHelper::getParams('com_quick2cart');
if ($params->get('usestock') == 0 && $resultstock <= 0) {
$q = "SELECT name,store_id\n\t\t\t\t\tFROM `#__kart_items`\n\t\t\t\t\tWHERE `item_id` =" . (int) $res->item_id;
$db->setQuery($q);
$itemresult = $db->loadAssoc();
$commented_by_userid = JFactory::getUser()->id;
$comquick2cartHelper = new comquick2cartHelper();
$prodLink = '<a class="" href="' . $comquick2cartHelper->getProductLink($res->item_id) . '">' . $itemresult['name'] . '</a>';
$store_info = $comquick2cartHelper->getSoreInfo($itemresult['store_id']);
$tempStoreLink = 'index.php?option=com_quick2cart&view=vendor&layout=store&store_id=' . $itemresult['store_id'];
$storeLink = '<a class="" href="' . JUri::root() . substr(JRoute::_($tempStoreLink), strlen(JUri::base(true)) + 1) . '">' . $store_info['title'] . '</a>';
$notification_subject = JText::sprintf('QTC_NOTIFIY_LOW_STOCK', $prodLink, $storeLink);
$comquick2cartHelper->addJSnotify($commented_by_userid, $store_info['owner'], $notification_subject, 'notif_system_messaging', '0', '');
}
}
}