本文整理汇总了PHP中producthelper::getProductCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductCategory方法的具体用法?PHP producthelper::getProductCategory怎么用?PHP producthelper::getProductCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getProductCategory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onRSProductSearch
//.........这里部分代码省略.........
$template_org = $template_d1[0] . $template_d2[1];
}
// End skip html if nosubcategory
$template_org = str_replace("{print}", $print_tag, $template_org);
$template_org = str_replace("{product_price_slider}", '', $template_org);
$template_org = str_replace("{filter_by}", '', $template_org);
$template_org = str_replace("{template_selector_category_lbl}", '', $template_org);
$template_org = str_replace("{template_selector_category}", '', $template_org);
$template_org = str_replace("{category_main_description}", '', $template_org);
$template_org = str_replace("{category_main_name}", $cat_name, $template_org);
$template_org = str_replace("{category_description}", '', $template_org);
$template_org = str_replace("{category_short_desc}", '', $template_org);
$template_org = str_replace("{category_name}", '', $template_org);
$template_org = str_replace("{if subcats}", '', $template_org);
$template_org = str_replace("{subcats end if}", '', $template_org);
$template_org = str_replace("{category_main_thumb_image_3}", '', $template_org);
$template_org = str_replace("{category_main_short_desc}", '', $template_org);
$template_org = str_replace("{category_main_thumb_image_2}", '', $template_org);
$template_org = str_replace("{category_main_thumb_image_1}", '', $template_org);
$template_org = str_replace("{category_main_thumb_image}", '', $template_org);
$template_org = str_replace("{attribute_price_without_vat}", '', $template_org);
$template_org = str_replace("{redproductfinderfilter_formstart}", '', $template_org);
$template_org = str_replace("{redproductfinderfilter:rp_myfilter}", '', $template_org);
$template_org = str_replace("{redproductfinderfilter_formend}", '', $template_org);
// Replace redproductfilder filter tag
if (strstr($template_org, "{redproductfinderfilter:")) {
$redProductFinerHelper = JPATH_SITE . "/components/com_redproductfinder/helpers/redproductfinder_helper.php";
if (file_exists($redProductFinerHelper)) {
include_once $redProductFinerHelper;
$redproductfinder_helper = new redproductfinder_helper();
$hdnFields = array('texpricemin' => '0', 'texpricemax' => '0', 'manufacturer_id' => $filter_by, 'category_template' => $templateid);
$hide_filter_flag = false;
if ($this->_id) {
$prodctofcat = $producthelper->getProductCategory($this->_id);
if (empty($prodctofcat)) {
$hide_filter_flag = true;
}
}
$template_org = $redproductfinder_helper->replaceProductfinder_tag($template_org, $hdnFields, $hide_filter_flag);
}
}
// Replace redproductfilder filter tag end here
$template_d1 = explode("{product_loop_start}", $template_org);
$template_d2 = explode("{product_loop_end}", $template_d1[1]);
$template_tmp_desc = $template_d2[0];
$template_desc = $template_d2[0];
// Order By
$order_by = "";
$orderby_form = "<form name='orderby_form' action='' method='post' >";
$orderby_form .= $this->lists['order_select'];
$orderby_form .= "<input type='hidden' name='view' value='search'>\n\t\t\t<input type='hidden' name='layout' value='{$layout}'>\n\t\t\t<input type='hidden' name='keyword' value='{$keyword}'>\n\t\t\t<input type='hidden' name='category_id' value='{$cid}'>\n\t\t\t<input type='hidden' name='manufacture_id' value='{$manufacture_id}'>\n\t\t\t<input type='hidden' name='templateid' value='{$templateid}'></form>";
if (strstr($template_desc, '{order_by}')) {
$order_by = $orderby_form;
}
$extraFieldName = $extraField->getSectionFieldNameArray(1, 1, 1);
$attribute_template = $producthelper->getAttributeTemplate($template_desc);
$total_product = $model->_total;
$endlimit = $this->limit;
$start = JRequest::getInt('limitstart', 0, '', 'int');
if (strstr($template_org, "{pagination}")) {
if (strstr($template_org, "{product_display_limit}")) {
$endlimit = JRequest::getInt('limit', $endlimit, '', 'int');
}
} else {
$endlimit = $model->getData();
}
示例2: delete
public function delete($cid = array())
{
$layout = JRequest::getVar('layout');
$producthelper = new producthelper();
if (count($cid)) {
$cids = implode(',', $cid);
$query = 'SELECT * FROM ' . $this->_table_prefix . 'mass_discount WHERE mass_discount_id in (' . $cids . ') ';
$this->_db->setQuery($query);
$massDList = $this->_db->loadObjectList();
for ($m = 0; $m < count($massDList); $m++) {
if (!empty($massDList[$m]->discount_product)) {
$this->updateProduct($massDList[$m]->discount_product);
}
$categoryArr = explode(',', $massDList[$m]->category_id);
for ($c = 0; $c < count($categoryArr); $c++) {
$product_Ids = $producthelper->getProductCategory($categoryArr[$c]);
$cproduct = $this->customImplode($product_Ids);
$this->updateProduct($cproduct);
}
$manufacturerArr = explode(',', $massDList[$m]->manufacturer_id);
for ($mn = 0; $mn < count($manufacturerArr); $mn++) {
$product_Ids = $this->GetProductmanufacturer($manufacturerArr[$mn]);
$mproduct = $this->customImplode($product_Ids);
$this->updateProduct($mproduct);
}
}
$query = 'DELETE FROM ' . $this->_table_prefix . 'mass_discount WHERE mass_discount_id IN ( ' . $cids . ' )';
$this->_db->setQuery($query);
if (!$this->_db->query()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
return true;
}
示例3: count
$data_add = str_replace("{category_name}", $cat_name, $data_add);
}
if (strstr($data_add, '{category_readmore}')) {
$cat_name = '<a href="' . $link . '" ' . $title . '>' . JText::_('COM_REDSHOP_READ_MORE') . '</a>';
$data_add = str_replace("{category_readmore}", $cat_name, $data_add);
}
if (strstr($data_add, '{category_description}')) {
$cat_desc = $config->maxchar($row->category_description, CATEGORY_SHORT_DESC_MAX_CHARS, CATEGORY_SHORT_DESC_END_SUFFIX);
$data_add = str_replace("{category_description}", $cat_desc, $data_add);
}
if (strstr($data_add, '{category_short_desc}')) {
$cat_s_desc = $config->maxchar($row->category_short_description, CATEGORY_SHORT_DESC_MAX_CHARS, CATEGORY_SHORT_DESC_END_SUFFIX);
$data_add = str_replace("{category_short_desc}", $cat_s_desc, $data_add);
}
if (strstr($data_add, '{category_total_product}')) {
$totalprd = $producthelper->getProductCategory($row->category_id);
$data_add = str_replace("{category_total_product}", count($totalprd), $data_add);
$data_add = str_replace("{category_total_product_lbl}", JText::_('COM_REDSHOP_TOTAL_PRODUCT'), $data_add);
}
/*
* category template extra field
* "2" argument is set for category
*/
$data_add = $producthelper->getExtraSectionTag($extraFieldName, $row->category_id, "2", $data_add);
if (strstr($data_add, "{product_loop_start}") && strstr($data_add, "{product_loop_end}")) {
$template_d1 = explode("{product_loop_start}", $data_add);
$template_d2 = explode("{product_loop_end}", $template_d1[1]);
$template_product = $template_d2[0];
$attribute_template = $producthelper->getAttributeTemplate($template_product);
$extraFieldName = $extraField->getSectionFieldNameArray(1, 1, 1);
$product_data = '';
示例4: array
} else {
$endlimit = $model->getProductPerPage();
}
$app = JFactory::getApplication();
$router = $app->getRouter();
$document = JFactory::getDocument();
$model = $this->getModel('category');
// Replace redproductfilder filter tag
if (strstr($template_desc, "{redproductfinderfilter:")) {
if (file_exists(JPATH_SITE . '/components/com_redproductfinder/helpers/redproductfinder_helper.php')) {
include_once JPATH_SITE . "/components/com_redproductfinder/helpers/redproductfinder_helper.php";
$redproductfinder_helper = new redproductfinder_helper();
$hdnFields = array('texpricemin' => '0', 'texpricemax' => '0', 'manufacturer_id' => $filter_by, 'category_template' => $category_template);
$hide_filter_flag = false;
if ($this->catid) {
$prodctofcat = $producthelper->getProductCategory($this->catid);
if (empty($prodctofcat)) {
$hide_filter_flag = true;
}
}
$template_desc = $redproductfinder_helper->replaceProductfinder_tag($template_desc, $hdnFields, $hide_filter_flag);
}
}
// Replace redproductfilder filter tag end here
if (!$slide) {
echo '<div class="category">';
if ($this->params->get('show_page_heading', 0)) {
?>
<div class="componentheading<?php
echo $this->params->get('pageclass_sfx');
?>