本文整理汇总了PHP中producthelper::getMenuInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getMenuInformation方法的具体用法?PHP producthelper::getMenuInformation怎么用?PHP producthelper::getMenuInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getMenuInformation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProductDetail
private static function getProductDetail($id)
{
$component = JComponentHelper::getComponent("com_redshop");
if (!isset($component->id)) {
JError::raiseError('500', 'redShop Component is not installed');
}
if (!defined('TABLE_PREFIX')) {
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
}
require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php';
$objhelper = new redhelper();
$producthelper = new producthelper();
$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $id);
if (count($ItemData) > 0) {
$pItemid = $ItemData->id;
} else {
$pItemid = $objhelper->getItemid($id);
}
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $id . '&Itemid=' . $pItemid);
$product = $producthelper->getProductById($id);
$product->product_price = $producthelper->getProductPrice($id);
$product->link = $link;
return $product;
}
示例2: renderLayout
//.........这里部分代码省略.........
if ($this->config['news_info2_enabled'] == 1) {
$news_infoo2 = $renderer->info($this->config, $this->content['catname'][$i], $this->content['CID'][$i], $this->content['author'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['rating_count'][$i], $this->content['rating_sum'][$i], 2);
}
} else {
if ($rs_mode == FALSE && $vm_mode == FALSE && $k2_mode == TRUE) {
// GENERATING HEADER
if ($this->config['news_header_enabled'] == 1) {
$news_header = $renderer->header_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['title'][$i]);
}
// GENERATING IMAGE
if ($this->config['news_image_enabled'] == 1) {
$news_image = $renderer->image_k2($this->config, $uri, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['text'][$i], $this->content['title'][$i]);
}
// GENERATING READMORE
if ($this->config['news_readmore_enabled'] == 1) {
$news_readmore = $renderer->readMore_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i]);
}
// GENERATING TEXT
if ($this->config['news_text_enabled'] == 1) {
$news_textt = $renderer->text_k2($this->config, $this->content['ID'][$i], $this->content['alias'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['text'][$i], $news_readmore);
}
// GENERATE NEWS INFO
if ($this->config['news_info_enabled'] == 1) {
$news_infoo = $renderer->info_k2($this->config, $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['author'][$i], $this->content['author_id'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['alias'][$i], $this->content['comments'], $this->content['rating_count'][$i], $this->content['rating_sum'][$i]);
}
// GENERATE NEWS INFO2
if ($this->config['news_info2_enabled'] == 1) {
$news_infoo2 = $renderer->info_k2($this->config, $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['cat_alias'][$i], $this->content['author'][$i], $this->content['author_id'][$i], $this->content['email'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $this->content['hits'][$i], $this->content['ID'][$i], $this->content['alias'][$i], $this->content['comments'], $this->content['rating_count'][$i], $this->content['rating_sum'][$i], 2);
}
// GENERATE STORE BLOCK
$news_k2_store = $renderer->store_k2($this->config, $this->content['ID'][$i], $this->content['plugins'][$i], $this->k2store_params);
} else {
if ($rs_mode == TRUE && $vm_mode == FALSE && $k2_mode == FALSE) {
$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $this->content['ID'][$i]);
$id = $this->content['ID'][$i];
$cid = $producthelper->getCategoryProduct($this->content['ID'][$i]);
$Itemid = $redhelper->getItemid($this->content['ID'][$i]);
$product = $producthelper->getProductById($this->content['ID'][$i]);
// GENERATING HEADER
if ($this->config['news_header_enabled'] == 1) {
$news_header = $renderer->header_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i], $Itemid);
}
// GENERATING IMAGE
if ($this->config['news_image_enabled'] == 1) {
$news_image = $renderer->image_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i], $Itemid);
}
// GENERATING READMORE
if ($this->config['news_readmore_enabled'] == 1) {
$news_readmore = $renderer->readMore_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $Itemid);
}
// GENERATING TEXT
if ($this->config['news_text_enabled'] == 1) {
$news_textt = $renderer->text_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore, $Itemid);
}
// GENERATE NEWS INFO
if ($this->config['news_info_enabled'] == 1) {
$news_infoo = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 1);
}
// GENERATE NEWS INFO2
if ($this->config['news_info2_enabled'] == 1) {
$news_infoo2 = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 2);
}
// COMPUTE PRICE DEPENDS OF USER ID
$user =& JFactory::getUser();
$price = $producthelper->getProductPrice($this->content['ID'][$i], $this->config['rs_price_with_vat'], $user->id);
$price = $producthelper->getProductFormattedPrice($price, true);
示例3:
$product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $product->product_id);
$ufield .= $product_userfileds[1];
if ($product_userfileds[1] != "") {
$count_no_user_field++;
}
$template_userfield = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $template_userfield);
$template_userfield = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $template_userfield);
}
if ($ufield != "") {
$hidden_userfield = "<div style='display:none;'><form method='post' action='' id='user_fields_form_" . $product->product_id . "' name='user_fields_form_" . $product->product_id . "'>" . $template_userfield . "</form></div>";
}
}
}
$prddata_add = $prddata_add . $hidden_userfield;
/************** end user fields ***************************/
$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $product->product_id);
if (count($ItemData) > 0) {
$pItemid = $ItemData->id;
} else {
$pItemid = $objhelper->getItemid($product->product_id);
}
$prddata_add = str_replace("{product_id_lbl}", JText::_('COM_REDSHOP_PRODUCT_ID_LBL'), $prddata_add);
$prddata_add = str_replace("{product_id}", $product->product_id, $prddata_add);
$prddata_add = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER_LBL'), $prddata_add);
$product_number_output = '<span id="product_number_variable' . $product->product_id . '">' . $product->product_number . '</span>';
$prddata_add = str_replace("{product_number}", $product_number_output, $prddata_add);
$product_volume_unit = '<span class="product_unit_variable">' . DEFAULT_VOLUME_UNIT . "3" . '</span>';
$strToInsert = $producthelper->redunitDecimal($product->product_volume) . " " . $product_volume_unit;
$prddata_add = str_replace("{product_size}", $strToInsert, $prddata_add);
$product_unit = '<span class="product_unit_variable">' . DEFAULT_VOLUME_UNIT . '</span>';
$strToInsert = $producthelper->redunitDecimal($product->product_length) . " " . $product_unit;
示例4: add
/**
* Method to add product in cart
*
* @return void
*/
public function add()
{
$app = JFactory::getApplication();
$option = JRequest::getVar('option');
$post = JRequest::get('post');
$parent_accessory_productid = $post['product_id'];
$Itemid = JRequest::getVar('Itemid');
$producthelper = new producthelper();
$redhelper = new redhelper();
$Itemid = $redhelper->getCartItemid();
$model = $this->getModel('cart');
// Call add method of modal to store product in cart session
$userfiled = JRequest::getVar('userfiled');
JPluginHelper::importPlugin('redshop_product');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeAddProductToCart', array(&$post));
$result = $this->_carthelper->addProductToCart($post);
if (is_bool($result) && $result) {
} else {
$errmsg = $result ? $result : JText::_("COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART");
if (AJAX_CART_BOX == 1) {
echo "`0`" . $errmsg;
die;
} else {
$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);
if (count($ItemData) > 0) {
$prdItemid = $ItemData->id;
} else {
$prdItemid = $redhelper->getItemid($post['product_id']);
}
$link = JRoute::_("index.php?option=" . $option . "&view=product&pid=" . $post["product_id"] . "&Itemid=" . $prdItemid, false);
$app->Redirect($link, $errmsg);
}
}
$session = JFactory::getSession();
$cart = $session->get('cart');
if (isset($cart['AccessoryAsProduct'])) {
$attArr = $cart['AccessoryAsProduct'];
if (ACCESSORY_AS_PRODUCT_IN_CART_ENABLE) {
$data['accessory_data'] = $attArr[0];
$data['acc_quantity_data'] = $attArr[1];
$data['acc_attribute_data'] = $attArr[2];
$data['acc_property_data'] = $attArr[3];
$data['acc_subproperty_data'] = $attArr[4];
if (isset($data['accessory_data']) && ($data['accessory_data'] != "" && $data['accessory_data'] != 0)) {
$accessory_data = explode("@@", $data['accessory_data']);
$acc_quantity_data = explode("@@", $data['acc_quantity_data']);
$acc_attribute_data = explode("@@", $data['acc_attribute_data']);
$acc_property_data = explode("@@", $data['acc_property_data']);
$acc_subproperty_data = explode("@@", $data['acc_subproperty_data']);
for ($i = 0; $i < count($accessory_data); $i++) {
$accessory = $producthelper->getProductAccessory($accessory_data[$i]);
$post = array();
$post['parent_accessory_product_id'] = $parent_accessory_productid;
$post['product_id'] = $accessory[0]->child_product_id;
$post['quantity'] = $acc_quantity_data[$i];
$post['category_id'] = 0;
$post['sel_wrapper_id'] = 0;
$post['attribute_data'] = $acc_attribute_data[$i];
$post['property_data'] = $acc_property_data[$i];
$post['subproperty_data'] = $acc_subproperty_data[$i];
$result = $this->_carthelper->addProductToCart($post);
$cart = $session->get('cart');
if (is_bool($result) && $result) {
} else {
$errmsg = $result ? $result : JText::_("COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART");
if (JError::isError(JError::getError())) {
$error = JError::getError();
$errmsg = $error->message;
}
if (AJAX_CART_BOX == 1) {
echo "`0`" . $errmsg;
die;
} else {
$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);
if (count($ItemData) > 0) {
$prdItemid = $ItemData->id;
} else {
$prdItemid = $redhelper->getItemid($post['product_id']);
}
$link = JRoute::_("index.php?option=" . $option . "&view=product&pid=" . $post["product_id"] . "&Itemid=" . $prdItemid, false);
$app->Redirect($link, $errmsg);
}
}
}
}
}
if (!DEFAULT_QUOTATION_MODE || DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE) {
$this->_carthelper->carttodb();
}
$this->_carthelper->cartFinalCalculation();
unset($cart['AccessoryAsProduct']);
} else {
if (!DEFAULT_QUOTATION_MODE || DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE) {
$this->_carthelper->carttodb();
//.........这里部分代码省略.........
示例5: getItemid
public function getItemid($product_id = '', $cat_id = 0)
{
$producthelper = new producthelper();
$catDetailmenu = false;
if ($cat_id) {
$sql = "SELECT id FROM #__menu " . "WHERE published=1 " . "AND `link` LIKE '%com_redshop%' " . "AND `link` LIKE '%view=category%' " . "AND ( link LIKE '%cid=" . (int) $cat_id . "' OR link LIKE '%cid=" . (int) $cat_id . "&%' ) " . "ORDER BY 'ordering'";
$this->_db->setQuery($sql);
if ($Itemid = $this->_db->loadResult()) {
$catDetailmenu = true;
return $Itemid;
}
}
$sql = "SELECT category_id \tFROM " . $this->_table_prefix . "product_category_xref cx WHERE product_id = '{$product_id}'";
$this->_db->setQuery($sql);
$cats = $this->_db->loadObjectList();
for ($i = 0; $i < count($cats); $i++) {
$cat = $cats[$i];
$sql = "SELECT id FROM #__menu " . "WHERE published=1 " . "AND `link` LIKE '%com_redshop%' " . "AND `link` LIKE '%view=category%' " . "AND ( link LIKE '%cid=" . (int) $cat->category_id . "' OR link LIKE '%cid=" . (int) $cat->category_id . "&%' ) " . "ORDER BY 'ordering'";
$this->_db->setQuery($sql);
if ($Itemid = $this->_db->loadResult()) {
return $Itemid;
}
}
$option = JRequest::getVar('option');
if ($option != 'com_redshop') {
if (!$catDetailmenu) {
$sql = "SELECT id FROM #__menu " . "WHERE published=1 " . "AND `link` LIKE '%com_redshop%' " . "AND `link` LIKE '%view=category%' " . "ORDER BY 'ordering'";
$this->_db->setQuery($sql);
if ($Itemid = $this->_db->loadResult()) {
return $Itemid;
}
}
$Itemidlist = $producthelper->getMenuInformation();
if (count($Itemidlist) == 1) {
$Itemid = $Itemidlist->id;
return $Itemid;
}
}
$Itemid = intval(JRequest::getVar('Itemid'));
return $Itemid;
}
示例6: gotonavproduct
/**
* Go to nav Product
*
* @return void
*/
public function gotonavproduct()
{
$producthelper = new producthelper();
$objhelper = new redhelper();
$post = JRequest::get('post');
$cid = $producthelper->getCategoryProduct($post['pid']);
$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['pid']);
if (count($ItemData) > 0) {
$pItemid = $ItemData->id;
} else {
$pItemid = $objhelper->getItemid($product->product_id, $cid);
}
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $post['pid'] . '&cid=' . $cid . '&Itemid=' . $pItemid, false);
$this->setRedirect($link);
}