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


PHP producthelper::makeCompareProductDiv方法代码示例

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


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

示例1: addtocompare

 /**
  * Add to compare function
  *
  * @access public
  * @return product compare list through ajax
  */
 public function addtocompare()
 {
     ob_clean();
     require_once JPATH_COMPONENT_SITE . '/helpers/product.php';
     $producthelper = new producthelper();
     // GetVariables
     $post = JRequest::get('REQUEST');
     $pid = null;
     if (isset($post['pid'])) {
         $pid = (int) $post['pid'];
     }
     // Initiallize variable
     $model = $this->getModel('product');
     if ($post['cmd'] == 'add') {
         $checkCompare = $model->checkComparelist($pid);
         $countCompare = $model->checkComparelist(0);
         if ($countCompare < PRODUCT_COMPARE_LIMIT) {
             if ($checkCompare) {
                 if ($model->addtocompare($post)) {
                     $Message = "1`";
                 } else {
                     $Message = "1`" . JText::_('COM_REDSHOP_ERROR_ADDING_PRODUCT_TO_COMPARE');
                 }
             } else {
                 $Message = JText::_('COM_REDSHOP_ALLREADY_ADDED_TO_COMPARE');
             }
             $Message .= $producthelper->makeCompareProductDiv();
             echo $Message;
         } else {
             $Message = "0`" . JText::_('COM_REDSHOP_LIMIT_CROSS_TO_COMPARE');
             echo $Message;
         }
     } elseif ($post['cmd'] == 'remove') {
         $model->removeCompare($pid);
         $Message = "1`" . $producthelper->makeCompareProductDiv();
         echo $Message;
     }
     exit;
 }
开发者ID:,项目名称:,代码行数:45,代码来源:

示例2: onRSProductSearch

 /**
  * Generate product search output
  */
 public function onRSProductSearch()
 {
     if (count($this->search) > 0) {
         $app = JFactory::getApplication();
         require_once JPATH_COMPONENT . '/helpers/product.php';
         require_once JPATH_COMPONENT . '/helpers/pagination.php';
         require_once JPATH_COMPONENT . '/helpers/extra_field.php';
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/text_library.php';
         $dispatcher = JDispatcher::getInstance();
         $redTemplate = new Redtemplate();
         $Redconfiguration = new Redconfiguration();
         $producthelper = new producthelper();
         $extraField = new extraField();
         $texts = new text_library();
         $stockroomhelper = new rsstockroomhelper();
         $Itemid = JRequest::getInt('Itemid');
         $search_type = JRequest::getCmd('search_type');
         $cid = JRequest::getInt('category_id');
         $manisrch = $this->search;
         $manufacture_id = $manisrch[0]->manufacturer_id;
         $templateid = JRequest::getInt('templateid');
         // Cmd removes space between to words
         $keyword = JRequest::getWord('keyword');
         $layout = JRequest::getCmd('layout', 'default');
         $db = JFactory::getDbo();
         $query = 'SELECT category_name' . ' FROM #__redshop_category  ' . 'WHERE category_id=' . JRequest::getInt('cid');
         $db->setQuery($query);
         $cat_name = null;
         if ($catname_array = $db->loadObjectList()) {
             $cat_name = $catname_array[0]->category_name;
         }
         $session = JFactory::getSession();
         $model = $this->getModel('search');
         $limit = $this->limit;
         $limitstart = JRequest::getInt('limitstart', 0);
         $total = $model->_total;
         JHTML::_('behavior.tooltip');
         JHTMLBehavior::modal();
         $url = JURI::base();
         if ($this->params->get('page_title') != "") {
             $pagetitle = $this->params->get('page_title');
         } else {
             $pagetitle = JText::_('COM_REDSHOP_SEARCH');
         }
         if ($this->params->get('show_page_heading', 1)) {
             echo '<h1 class="componentheading' . $this->escape($this->params->get('pageclass_sfx')) . '">';
             echo $pagetitle;
             echo '</h1>';
         }
         echo '<div style="clear:both"></div>';
         $category_tmpl = "";
         if (count($this->templatedata) > 0 && $this->templatedata[0]->template_desc != "") {
             $template_desc = $this->templatedata[0]->template_desc;
         } else {
             $template_desc = "<div class=\"category_print\">{print}</div>\r\n<div style=\"clear: both;\"></div>\r\n<div class=\"category_main_description\">{category_main_description}</div>\r\n<p>{if subcats} {category_loop_start}</p>\r\n<div id=\"categories\">\r\n<div style=\"float: left; width: 200px;\">\r\n<div class=\"category_image\">{category_thumb_image}</div>\r\n<div class=\"category_description\">\r\n<h2 class=\"category_title\">{category_name}</h2>\r\n{category_description}</div>\r\n</div>\r\n</div>\r\n<p>{category_loop_end} {subcats end if}</p>\r\n<div style=\"clear: both;\"></div>\r\n<div id=\"category_header\">\r\n<div class=\"category_order_by\">{order_by}</div>\r\n</div>\r\n<div class=\"category_box_wrapper\">{product_loop_start}\r\n<div class=\"category_box_outside\">\r\n<div class=\"category_box_inside\">\r\n<div class=\"category_product_image\">{product_thumb_image}</div>\r\n<div class=\"category_product_title\">\r\n<h3>{product_name}</h3>\r\n</div>\r\n<div class=\"category_product_price\">{product_price}</div>\r\n<div class=\"category_product_readmore\">{read_more}</div>\r\n<div>{product_rating_summary}</div>\r\n<div class=\"category_product_addtocart\">{form_addtocart:add_to_cart1}</div>\r\n</div>\r\n</div>\r\n{product_loop_end}\r\n<div class=\"category_product_bottom\" style=\"clear: both;\"></div>\r\n</div>\r\n<div class=\"category_pagination\">{pagination}</div>";
         }
         if (strstr($template_desc, "{product_display_limit}")) {
             $endlimit = $model->getProductPerPage();
             $limit = JRequest::getInt('limit', $endlimit, '', 'int');
         }
         $template_org = $template_desc;
         $template_d1 = explode("{category_loop_start}", $template_org);
         if (count($template_d1) > 1) {
             $template_d2 = explode("{category_loop_end}", $template_d1[1]);
             if (count($template_d2) > 0) {
                 $category_tmpl = $template_d2[0];
             }
         }
         $template_org = str_replace($category_tmpl, "", $template_org);
         $template_org = str_replace("{category_loop_start}", "", $template_org);
         $template_org = str_replace("{category_loop_end}", "", $template_org);
         $print = JRequest::getInt('print');
         $p_url = @explode('?', $_SERVER['REQUEST_URI']);
         $print_tag = '';
         if ($print) {
             $print_tag = "<a onclick='window.print();' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' ><img src=" . JSYSTEM_IMAGES_PATH . "printButton.png  alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' /></a>";
         } else {
             $print_url = $url . "index.php?option=com_redshop&view=search&print=1&tmpl=component";
             $print_tag = "<a href='#' onclick='window.open(\"{$print_url}\",\"mywindow\",\"scrollbars=1\",\"location=1\")' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' ><img src=" . JSYSTEM_IMAGES_PATH . "printButton.png  alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' /></a>";
         }
         $template_org = str_replace("{total_product}", count($this->search), $template_org);
         $template_org = str_replace("{total_product_lbl}", JText::_('COM_REDSHOP_TOTAL_PRODUCT'), $template_org);
         if (strstr($template_org, "{compare_product_div}")) {
             $compare_product_div = "";
             if (PRODUCT_COMPARISON_TYPE != "") {
                 $comparediv = $producthelper->makeCompareProductDiv();
                 $compareUrl = JRoute::_('index.php?option=com_redshop&view=product&layout=compare&Itemid=' . $Itemid);
                 $compare_product_div = "<form name='frmCompare' method='post' action='" . $compareUrl . "' >";
                 $compare_product_div .= "<a href='javascript:compare();' >" . JText::_('COM_REDSHOP_COMPARE') . "</a>";
                 $compare_product_div .= "<div id='divCompareProduct'>" . $comparediv . "</div>";
                 $compare_product_div .= "</form>";
             }
             $template_org = str_replace("{compare_product_div}", $compare_product_div, $template_org);
         }
         // Skip html if nosubcategory
         if (strstr($template_org, "{if subcats}")) {
             $template_d1 = explode("{if subcats}", $template_org);
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例3: explode

 } else {
     $tmpItemid = $this->itemid;
 }
 $link = JRoute::_('index.php?option=' . $this->option . '&view=category&cid=' . $this->catid . '&manufacturer_id=' . $this->manufacturer_id . '&layout=detail&Itemid=' . $tmpItemid);
 $cat_main_thumb = "";
 if ($this->maincat->category_full_image && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . 'category/' . $this->maincat->category_full_image)) {
     $water_cat_img = $objhelper->watermark('category', $this->maincat->category_full_image, $cw_thumb, $ch_thumb, WATERMARK_CATEGORY_THUMB_IMAGE, '0');
     $cat_main_thumb = "<a href='" . $link . "' title='" . $main_cat_name . "'><img src='" . $water_cat_img . "' alt='" . $main_cat_name . "' title='" . $main_cat_name . "'></a>";
 }
 $template_desc = str_replace($ctag, $cat_main_thumb, $template_desc);
 $extraFieldName = $extraField->getSectionFieldNameArray(2, 1, 1);
 $template_desc = $producthelper->getExtraSectionTag($extraFieldName, $this->catid, "2", $template_desc, 0);
 if (strstr($template_desc, "{compare_product_div}")) {
     $compare_product_div = "";
     if (PRODUCT_COMPARISON_TYPE != "") {
         $comparediv = $producthelper->makeCompareProductDiv();
         $compareUrl = JRoute::_('index.php?option=com_redshop&view=product&layout=compare&Itemid=' . $this->itemid);
         $compare_product_div = "<form name='frmCompare' method='post' action='" . $compareUrl . "' >";
         $compare_product_div .= "<a href='javascript:compare();' >" . JText::_('COM_REDSHOP_COMPARE') . "</a>";
         $compare_product_div .= "<div id='divCompareProduct'>" . $comparediv . "</div>";
         $compare_product_div .= "</form>";
     }
     $template_desc = str_replace("{compare_product_div}", $compare_product_div, $template_desc);
 }
 if (strstr($template_desc, "{category_loop_start}") && strstr($template_desc, "{category_loop_end}")) {
     $template_d1 = explode("{category_loop_start}", $template_desc);
     $template_d2 = explode("{category_loop_end}", $template_d1[1]);
     $subcat_template = $template_d2[0];
     if (strstr($subcat_template, '{category_thumb_image_2}')) {
         $tag = '{category_thumb_image_2}';
         $h_thumb = THUMB_HEIGHT_2;
开发者ID:,项目名称:,代码行数:31,代码来源:


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