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


PHP producthelper::getProductRating方法代码示例

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


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

示例1:

     $prddata_add = str_replace("{read_more}", $rmore, $prddata_add);
 }
 if (strstr($prddata_add, '{read_more_link}')) {
     $prddata_add = str_replace("{read_more_link}", $link, $prddata_add);
 }
 if (strstr($prddata_add, '{product_s_desc}')) {
     $p_s_desc = $config->maxchar($product->product_s_desc, CATEGORY_PRODUCT_SHORT_DESC_MAX_CHARS, CATEGORY_PRODUCT_SHORT_DESC_END_SUFFIX);
     $prddata_add = str_replace("{product_s_desc}", $p_s_desc, $prddata_add);
 }
 if (strstr($prddata_add, '{product_desc}')) {
     $p_desc = $config->maxchar($product->product_desc, CATEGORY_PRODUCT_DESC_MAX_CHARS, CATEGORY_PRODUCT_DESC_END_SUFFIX);
     $prddata_add = str_replace("{product_desc}", $p_desc, $prddata_add);
 }
 if (strstr($prddata_add, '{product_rating_summary}')) {
     // Product Review/Rating Fetching reviews
     $final_avgreview_data = $producthelper->getProductRating($product->product_id);
     $prddata_add = str_replace("{product_rating_summary}", $final_avgreview_data, $prddata_add);
 }
 if (strstr($prddata_add, '{manufacturer_link}')) {
     $manufacturer_link_href = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $product->manufacturer_id . '&Itemid=' . $this->temid);
     $manufacturer_link = '<a href="' . $manufacturer_link_href . '" title="' . $product->manufacturer_name . '">' . $product->manufacturer_name . '</a>';
     $prddata_add = str_replace("{manufacturer_link}", $manufacturer_link, $prddata_add);
     if (strstr($prddata_add, "{manufacturer_link}")) {
         $prddata_add = str_replace("{manufacturer_name}", "", $prddata_add);
     }
 }
 if (strstr($prddata_add, '{manufacturer_product_link}')) {
     $manuUrl = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=products&mid=' . $product->manufacturer_id . '&Itemid=' . $this->itemid);
     $manufacturerPLink = "<a href='" . $manuUrl . "'>" . JText::_("COM_REDSHOP_VIEW_ALL_MANUFACTURER_PRODUCTS") . " " . $product->manufacturer_name . "</a>";
     $prddata_add = str_replace("{manufacturer_product_link}", $manufacturerPLink, $prddata_add);
 }
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: onRSProductSearch


//.........这里部分代码省略.........
                     $pname = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pname);
                     $pro_s_desc = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pro_s_desc);
                     $pro_desc = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pro_desc);
                 }
             }
             $pro_s_desc = $Redconfiguration->maxchar($pro_s_desc, CATEGORY_PRODUCT_DESC_MAX_CHARS, CATEGORY_PRODUCT_DESC_END_SUFFIX);
             $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $this->search[$i]->product_id . '&Itemid=' . $Itemid);
             if (strstr($template_desc, '{product_name}')) {
                 $pname = "<a href='" . $link . "'>" . $pname . "</a>";
                 $data_add = str_replace("{product_name}", $pname, $template_desc);
             }
             if (strstr($template_desc, '{product_name_nolink}')) {
                 $data_add = str_replace("{product_name_nolink}", $pname, $template_desc);
             }
             $readmore = "<a href='" . $link . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a>";
             $data_add = str_replace("{read_more}", $readmore, $data_add);
             $data_add = str_replace("{read_more_link}", $link, $data_add);
             // RedSHOP Product Plugin
             JPluginHelper::importPlugin('redshop_product');
             $results = $dispatcher->trigger('onPrepareProduct', array(&$data_add, &$params, $this->search[$i]));
             // End
             if (strstr($data_add, "{product_delivery_time}")) {
                 $product_delivery_time = $producthelper->getProductMinDeliveryTime($this->search[$i]->product_id);
                 if ($product_delivery_time != "") {
                     $data_add = str_replace("{delivery_time_lbl}", JText::_('DELIVERY_TIME'), $data_add);
                     $data_add = str_replace("{product_delivery_time}", $product_delivery_time, $data_add);
                 } else {
                     $data_add = str_replace("{delivery_time_lbl}", "", $data_add);
                     $data_add = str_replace("{product_delivery_time}", "", $data_add);
                 }
             }
             // Product Review/Rating
             // Fetching reviews
             $final_avgreview_data = $producthelper->getProductRating($this->search[$i]->product_id);
             // Attribute ajax chage
             $data_add = str_replace("{product_rating_summary}", $final_avgreview_data, $data_add);
             $data_add = $producthelper->getJcommentEditor($this->search[$i], $data_add);
             $data_add = $producthelper->getExtraSectionTag($extraFieldName, $this->search[$i]->product_id, "1", $data_add, 1);
             $data_add = str_replace("{product_s_desc}", $pro_s_desc, $data_add);
             $data_add = str_replace("{product_desc}", $pro_desc, $data_add);
             $data_add = str_replace("{product_id_lbl}", JText::_('COM_REDSHOP_PRODUCT_ID_LBL'), $data_add);
             $data_add = str_replace("{product_id}", $this->search[$i]->product_id, $data_add);
             $data_add = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER_LBL'), $data_add);
             $data_add = str_replace("{product_number}", $product_number, $data_add);
             /**
              * related Product List in Lightbox
              * Tag Format = {related_product_lightbox:<related_product_name>[:width][:height]}
              */
             if (strstr($data_add, '{related_product_lightbox:')) {
                 $related_product = $producthelper->getRelatedProduct($this->search[$i]->product_id);
                 $rtlnone = explode("{related_product_lightbox:", $data_add);
                 $rtlntwo = explode("}", $rtlnone[1]);
                 $rtlnthree = explode(":", $rtlntwo[0]);
                 $rtln = $rtlnthree[0];
                 $rtlnfwidth = isset($rtlnthree[1]) ? $rtlnthree[1] : "900";
                 $rtlnwidthtag = isset($rtlnthree[1]) ? ":" . $rtlnthree[1] : "";
                 $rtlnfheight = isset($rtlnthree[2]) ? $rtlnthree[2] : "600";
                 $rtlnheighttag = isset($rtlnthree[2]) ? ":" . $rtlnthree[2] : "";
                 $rtlntag = "{related_product_lightbox:{$rtln}{$rtlnwidthtag}{$rtlnheighttag}}";
                 if (count($related_product) > 0) {
                     $linktortln = JUri::root() . "index.php?option=com_redshop&view=product&pid=" . $this->search[$i]->product_id . "&tmpl=component&template=" . $rtln . "&for=rtln";
                     $rtlna = '<a class="modal" href="' . $linktortln . '" rel="{handler:\'iframe\',size:{x:' . $rtlnfwidth . ',y:' . $rtlnfheight . '}}" >' . JText::_('COM_REDSHOP_RELATED_PRODUCT_LIST_IN_LIGHTBOX') . '</a>';
                 } else {
                     $rtlna = "";
                 }
                 $data_add = str_replace($rtlntag, $rtlna, $data_add);
开发者ID:,项目名称:,代码行数:67,代码来源:


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