本文整理汇总了PHP中comquick2cartHelper::getProductLink方法的典型用法代码示例。如果您正苦于以下问题:PHP comquick2cartHelper::getProductLink方法的具体用法?PHP comquick2cartHelper::getProductLink怎么用?PHP comquick2cartHelper::getProductLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comquick2cartHelper
的用法示例。
在下文中一共展示了comquick2cartHelper::getProductLink方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit()
{
$input = JFactory::getApplication()->input;
$cid = $input->get('cid', '', 'array');
JArrayHelper::toInteger($cid);
$comquick2cartHelper = new comquick2cartHelper();
$edit_link = $comquick2cartHelper->getProductLink($cid[0], 'editLink');
$this->setRedirect($edit_link);
}
示例2: display
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);
}
示例3: sendcontactUsEmail
function sendcontactUsEmail($post)
{
jimport('joomla.utilities.utility');
$lang = JFactory::getLanguage();
$lang->load('com_quick2cart', JPATH_ADMINISTRATOR);
global $mainframe;
$mainframe = JFactory::getApplication();
$comquick2cartHelper = new comquick2cartHelper();
// GETTING CONFIGURATION PROPERTIES
$from = $mainframe->getCfg('mailfrom');
$fromname = $mainframe->getCfg('fromname');
$sitename = $mainframe->getCfg('sitename');
$store_id = $post->get("store_id", '', "INTEGER");
$item_id = $post->get("item_id", '', "INTEGER");
$cust_email = $post->get("cust_email", '', "STRING");
$store_info = $comquick2cartHelper->getSoreInfo($store_id);
$recipient = $store_info['store_email'];
// Get enquiry
$enquiry = $post->get("message", '', "RAW");
// Get prod detail
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('name')->from('#__kart_items AS i')->where("i.item_id= " . $item_id);
$db->setQuery($query);
$itemresult = $db->loadAssoc();
// Get Product link
$prodLink = '<a class="" href="' . $comquick2cartHelper->getProductLink($item_id) . '">' . $itemresult['name'] . '</a>';
$body = JText::sprintf('COM_QUICK2CART_CONTACT_US_BODY', $cust_email, $prodLink, $enquiry);
$body = str_replace('{sitename}', $sitename, $body);
// $bcc = array('0'=>$mainframe->getCfg('mailfrom') );
$cc = null;
$bcc = array();
$attachment = null;
$replyto = null;
$replytoname = null;
$subject = JText::_('COM_QUICK2CART_CONTACT_US_SUBJECT');
$status = JFactory::getMailer()->sendMail($from, $fromname, $recipient, $subject, $body, $mode = 1, $cc, $bcc, $attachment, $replyto, $replytoname);
}
示例4:
$storeLink = $storeHelper->getStoreLink($cart['store_id']);
?>
<!-- STORE TITILE -->
<tr class="info">
<td colspan="5" ><strong><a href="<?php
echo $storeLink;
?>
"><?php
echo $storeinfo['title'];
?>
</a><strong></td>
</tr>
<?php
}
}
$product_link = $helperobj->getProductLink($cart['item_id']);
?>
<tr>
<td class="cartitem_name" ><input class="inputbox cart_fields" id="cart_id[]" name="cart_id[]" type="hidden" value="<?php
echo $cart['id'];
?>
" size="5">
<?php
if (empty($product_link)) {
echo $cart['title'];
} else {
?>
<a href="<?php
echo $product_link;
?>
"><?php
示例5: 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) {
//.........这里部分代码省略.........
示例6: count
?>
</th>
</tr>
</thead>
<tbody>
<?php
$comquick2cartHelper = new comquick2cartHelper();
$k = 0;
if (!empty($this->products)) {
$n = count($this->products);
for ($i = 0; $i < $n; $i++) {
$zone_type = '';
$row = $this->products[$i];
$link = $comquick2cartHelper->getProductLink($row->item_id, 'detailsLink');
$edit_link = $comquick2cartHelper->getProductLink($row->item_id, 'editLink');
$link = '<a href="' . $link . '">' . $row->name . '</a>';
$edit_link = '<a href="' . $edit_link . '">' . JText::_('QTC_EDIT') . '</a>';
?>
<tr class="<?php
echo 'row' . $k;
?>
">
<td class="q2c_width_1 nowrap center">
<?php
echo JHtml::_('grid.id', $i, $row->item_id);
?>
</td>
示例7: 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', '');
}
}
}
示例8: 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';
}
//.........这里部分代码省略.........
示例9: foreach
$attri_model = $comquick2cartHelper->loadqtcClass($path = JPATH_SITE . '/components/com_quick2cart/models/attributes.php', "quick2cartModelAttributes");
foreach ($itemWiseShipDetail as $item) {
$itemDetail = $item['itemDetail'];
$item_id = $itemDetail['item_id'];
$shippingMeths = $item['shippingMeths'];
// Some product doesn't want shipping
if (!empty($shippingMeths)) {
?>
<tr>
<td width="40%">
<div class="">
<?php
// GET ITEM DETAIL
// converting to array
$data = (array) ($itemDetail = $attri_model->getItemDetail(0, '', $item_id));
$product_link = $comquick2cartHelper->getProductLink($data['item_id'], 'detailsLink');
$images = json_decode($data['images'], true);
$img = JUri::base() . 'components' . DS . 'com_quick2cart' . DS . 'assets' . DS . 'images' . DS . 'default_product.jpg';
if (!empty($images)) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'media.php';
// create object of media helper class
$media = new qtc_mediaHelper();
$file_name_without_extension = $media->get_media_file_name_without_extension($images[0]);
$media_extension = $media->get_media_extension($images[0]);
$img = $comquick2cartHelper->isValidImg($file_name_without_extension . '_L.' . $media_extension);
if (empty($img)) {
$img = JUri::base() . 'components' . DS . 'com_quick2cart' . DS . 'assets' . DS . 'images' . DS . 'default_product.jpg';
}
}
?>
示例10:
// Getting item id
$catpage_Itemid = $helperobj->getitemid('index.php?option=com_quick2cart&view=category');
?>
<div class="q2c_pin_item_<?php
echo $random_container;
?>
">
<div class="q2c_pin_wrapper">
<div class="thumbnail">
<div class="caption">
<?php
// 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=' . $data['item_id'] . '&Itemid=' . $catpage_Itemid;
// $product_link = JUri::root() . substr(JRoute::_($p_link), strlen(JUri::base(true)) + 1);
$product_link = $helperobj->getProductLink($data['item_id'], 'detailsLink');
if (isset($data['featured'])) {
if ($data['featured'] == '1') {
?>
<img title="<?php
echo JText::_('QTC_FEATURED_PROD');
?>
"
src="<?php
echo JUri::base() . 'components' . DS . 'com_quick2cart' . DS . 'assets' . DS . 'images' . DS . 'featured.png';
?>
" />
<?php
}
}
// GETTIN PRODUCT TITLE LIMIT