本文整理汇总了PHP中producthelper::getRelatedProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getRelatedProduct方法的具体用法?PHP producthelper::getRelatedProduct怎么用?PHP producthelper::getRelatedProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getRelatedProduct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: producthelper
<?php
/**
* @package RedSHOP.Frontend
* @subpackage Template
*
* @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
$producthelper = new producthelper();
$config = new Redconfiguration();
$related_product = $producthelper->getRelatedProduct($this->pid);
$template = $this->input->getString('template', '');
$relptemplate = $this->redTemplate->getTemplate("related_product", 0, $template);
$related_template = $relptemplate[0]->template_desc;
if (count($relptemplate) > 0) {
$related_template_data = '';
$product_start = explode("{related_product_start}", $related_template);
$product_end = explode("{related_product_end}", $product_start[1]);
$tempdata_div_start = $product_start[0];
$tempdata_div_middle = $product_end[0];
$tempdata_div_end = $product_end[1];
$extra_field = new extraField();
$fieldArray = $extra_field->getSectionFieldList(17, 0, 0);
$attribute_template = $producthelper->getAttributeTemplate($tempdata_div_middle);
/************************************************************ **********************************************/
for ($r = 0; $r < count($related_product); $r++) {
$related_template_data .= $tempdata_div_middle;
$rlink = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $related_product[$r]->product_id . '&Itemid=' . $this->itemId);
if (strstr($related_template_data, "{relproduct_image_3}")) {
示例2: onRSProductSearch
//.........这里部分代码省略.........
$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);
}
$data_add = $producthelper->replaceVatinfo($data_add);
/************************************
* Conditional tag
* if product on discount : Yes
* {if product_on_sale} This product is on sale {product_on_sale end if} // OUTPUT : This product is on sale
* NO : // OUTPUT : Display blank
************************************/
$data_add = $producthelper->getProductOnSaleComment($this->search[$i], $data_add);
$data_add = $stockroomhelper->replaceStockroomAmountDetail($data_add, $this->search[$i]->product_id);
if (strstr($data_add, "{product_thumb_image_3}")) {
$cimg_tag = '{product_thumb_image_3}';
$ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_3;
$cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_3;
} elseif (strstr($data_add, "{product_thumb_image_2}")) {
$cimg_tag = '{product_thumb_image_2}';
示例3: explode
if (strstr($data_add, '{category_product_link}')) {
$data_add = str_replace("{category_product_link}", $link, $data_add);
}
if (strstr($data_add, '{read_more}')) {
$rmore = "<a href='" . $link . "' title='" . $product->product_name . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a>";
$data_add = str_replace("{read_more}", $rmore, $data_add);
}
if (strstr($data_add, '{read_more_link}')) {
$data_add = str_replace("{read_more_link}", $link, $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($product->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=" . $product->product_id . "&tmpl=component&template=" . $rtln . "&for=rtln";
$rtlna = '<a class="redcolorproductimg" href="' . $linktortln . '" >' . JText::_('COM_REDSHOP_RELATED_PRODUCT_LIST_IN_LIGHTBOX') . '</a>';
} else {
$rtlna = "";
}