本文整理汇总了PHP中producthelper::getSection方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getSection方法的具体用法?PHP producthelper::getSection怎么用?PHP producthelper::getSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getSection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onRSProductSearch
//.........这里部分代码省略.........
$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();
}
if ($endlimit == 0) {
$final_endlimit = $total_product;
} else {
$final_endlimit = $endlimit;
}
$tagarray = $texts->getTextLibraryTagArray();
$data = "";
$count_no_user_field = 0;
for ($i = 0; $i < count($this->search); $i++) {
$data_add = "";
$thum_image = "";
$pname = $Redconfiguration->maxchar($this->search[$i]->product_name, CATEGORY_PRODUCT_TITLE_MAX_CHARS, CATEGORY_PRODUCT_TITLE_END_SUFFIX);
if ($search_type == 'product_number') {
$product_number = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $this->search[$i]->product_number);
$pro_s_desc = $this->search[$i]->product_s_desc;
$pro_desc = $this->search[$i]->product_desc;
} else {
$product_number = $this->search[$i]->product_number;
$pro_s_desc = $this->search[$i]->product_s_desc;
$pro_desc = $this->search[$i]->product_desc;
if (!in_array($keyword, $tagarray)) {
示例2:
$div_end = "</div>";
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $product->product_id . '&Itemid=' . $this->itemId);
$link_remove = JRoute::_('index.php?option=com_redshop&view=product&task=removecompare&layout=compare&pid=' . $product->product_id . '&Itemid=' . $this->itemId);
$remove = "<a href='" . $link_remove . "'>" . JText::_('TPL_REDGADGETS_REMOVE_PRODUCT_FROM_COMPARE_LIST') . "</a>";
$thumbUrl = RedShopHelperImages::getImagePath($product->product_full_image, '', 'thumb', 'product', COMPARE_PRODUCT_THUMB_WIDTH, COMPARE_PRODUCT_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
$img = "<div style='width:" . COMPARE_PRODUCT_THUMB_WIDTH . "px;height:" . COMPARE_PRODUCT_THUMB_HEIGHT . "px;float: left;' ><a href='" . $link . "' title='" . $product->product_name . "'><img src='" . $thumbUrl . "'></a></div>";
$expand = "<a href='javascript:void(0)' onClick='expand_collapse(this," . $product->product_id . ")' style='font-size:18px;text-decoration:none;' >-</a>";
if ($i != $compare['idx'] - 1) {
$template = str_replace('{expand_collapse}', $expand . $td_end . '<td align="center">' . "{expand_collapse}", $template);
} else {
$template = str_replace('{expand_collapse}', $expand . $td_end . $td_start . "{expand_collapse}", $template);
}
$template = str_replace('{product_name}', $exp_div . $product->product_name . $div_end . $td_end . $td_start . "{product_name}", $template);
$template = str_replace('{product_image}', $exp_div . $img . $div_end . $td_end . $td_start . "{product_image}", $template);
if (strstr($template, "{manufacturer_name}")) {
$manufacturer = $producthelper->getSection('manufacturer', $product->manufacturer_id);
$template = str_replace('{manufacturer_name}', $exp_div . $manufacturer->manufacturer_name . $div_end . $td_end . $td_start . "{manufacturer_name}", $template);
}
if (strstr($template, "{discount_start_date}")) {
$disc_start_date = "";
if ($product->discount_stratdate) {
$disc_start_date = $config->convertDateFormat($product->discount_stratdate);
}
$template = str_replace('{discount_start_date}', $exp_div . $disc_start_date . $div_end . $td_end . $td_start . "{discount_start_date}", $template);
}
if (strstr($template, "{discount_end_date}")) {
$disc_end_date = "";
if ($product->discount_enddate) {
$disc_end_date = $config->convertDateFormat($product->discount_enddate);
}
$template = str_replace('{discount_end_date}', $exp_div . $disc_end_date . $div_end . $td_end . $td_start . "{discount_end_date}", $template);
示例3: display
//.........这里部分代码省略.........
} elseif ($this->data->product_parent_id != 0 && $this->data->product_parent_id != "") {
$product_parent_data = $prodhelperobj->getProductById($this->data->product_parent_id);
if ($product_parent_data->canonical_url != "") {
$main_url = JURI::root() . $product_parent_data->canonical_url;
$canonical = '<link rel="canonical" href="' . $main_url . '" />';
$this->document->addCustomTag($canonical);
} else {
$main_url = substr_replace(JURI::root(), "", -1);
$main_url .= JRoute::_('index.php?option=com_redshop&view=product&layout=detail&Itemid=' . $this->itemId . '&pid=' . $this->data->product_parent_id, false);
$canonical = '<link rel="canonical" href="' . $main_url . '" />';
$this->document->addCustomTag($canonical);
}
}
$productTemplate = $this->model->getProductTemplate();
/*
* Process the prepare Product plugins
*/
$this->dispatcher->trigger('onPrepareProduct', array(&$productTemplate->template_desc, &$params, $this->data));
$pagetitletag = '';
// For page title
if (AUTOGENERATED_SEO && SEO_PAGE_TITLE != '') {
$pagetitletag = SEO_PAGE_TITLE;
$pagetitletag = str_replace("{productname}", $this->data->product_name, $pagetitletag);
$pagetitletag = str_replace("{categoryname}", $this->data->category_name, $pagetitletag);
$pagetitletag = str_replace("{manufacturer}", $this->data->manufacturer_name, $pagetitletag);
$pagetitletag = str_replace("{productsku}", $this->data->product_number, $pagetitletag);
$pagetitletag = str_replace("{productnumber}", $this->data->product_number, $pagetitletag);
$pagetitletag = str_replace("{shopname}", SHOP_NAME, $pagetitletag);
$pagetitletag = str_replace("{productshortdesc}", strip_tags($this->data->product_s_desc), $pagetitletag);
$pagetitletag = str_replace("{saleprice}", $prodhelperobj_array_main['product_price'], $pagetitletag);
$parentcat = "";
$parentid = $prodhelperobj->getParentCategory($this->data->category_id);
while ($parentid != 0) {
$parentdetail = $prodhelperobj->getSection("category", $parentid);
$parentcat = $parentdetail->category_name . " " . $parentcat;
$parentid = $prodhelperobj->getParentCategory($parentdetail->category_id);
}
$pagetitletag = str_replace("{parentcategoryloop}", $parentcat, $pagetitletag);
$pagetitletag = $prodhelperobj->getProductNotForSaleComment($this->data, $pagetitletag);
}
if ($this->data->pagetitle != '' && AUTOGENERATED_SEO && SEO_PAGE_TITLE != '') {
if ($this->data->append_to_global_seo == 'append') {
$pagetitletag .= " " . $this->data->pagetitle;
$this->document->setTitle($pagetitletag);
$this->document->setMetaData("og:title", $pagetitletag);
} elseif ($this->data->append_to_global_seo == 'prepend') {
$pagetitletag = $this->data->pagetitle . " " . $pagetitletag;
$this->document->setTitle($pagetitletag);
$this->document->setMetaData("og:title", $pagetitletag);
} elseif ($this->data->append_to_global_seo == 'replace') {
$this->document->setTitle($this->data->pagetitle);
$this->document->setMetaData("og:title", $this->data->pagetitle);
}
} else {
if ($this->data->pagetitle != '') {
$this->document->setTitle($this->data->pagetitle);
$this->document->setMetaData("og:title", $this->data->pagetitle);
} elseif (AUTOGENERATED_SEO && SEO_PAGE_TITLE != '') {
$this->document->setTitle($pagetitletag);
$this->document->setMetaData("og:title", $pagetitletag);
} else {
$this->document->setTitle($this->data->product_name . " | " . $this->data->category_name . " | " . $this->app->getCfg('sitename') . " | " . $this->data->product_number);
$this->document->setMetaData("og:title", $this->data->product_name . " | " . $this->data->category_name . " | " . $this->app->getCfg('sitename') . " | " . $this->data->product_number);
}
}
$uri = JFactory::getURI();
示例4: sendOrderMail
/**
* sendOrderMail function.
*
* @param int $order_id Order ID.
*
* @return bool
*/
public function sendOrderMail($order_id, $onlyAdmin = false)
{
$redconfig = new Redconfiguration();
$producthelper = new producthelper();
$session = JFactory::getSession();
$config = JFactory::getConfig();
// Set the e-mail parameters
$from = $config->getValue('mailfrom');
$fromname = $config->getValue('fromname');
$user = JFactory::getUser();
if (USE_AS_CATALOG) {
$mailinfo = $this->getMailtemplate(0, "catalogue_order");
} else {
$mailinfo = $this->getMailtemplate(0, "order");
}
if (count($mailinfo) > 0) {
$message = $mailinfo[0]->mail_body;
$subject = $mailinfo[0]->mail_subject;
} else {
return false;
}
$cart = '';
$row = $this->_order_functions->getOrderDetails($order_id);
$orderpayment = $this->_order_functions->getOrderPaymentDetail($order_id);
$paymentmethod = $this->_order_functions->getPaymentMethodInfo($orderpayment[0]->payment_method_class);
$paymentmethod = $paymentmethod[0];
// It is necessory to take billing info from order user info table
// Order mail output should reflect the checkout process"
$message = str_replace("{order_mail_intro_text_title}", JText::_('COM_REDSHOP_ORDER_MAIL_INTRO_TEXT_TITLE'), $message);
$message = str_replace("{order_mail_intro_text}", JText::_('COM_REDSHOP_ORDER_MAIL_INTRO_TEXT'), $message);
$message = $this->_carthelper->replaceOrderTemplate($row, $message);
$rowitem = $this->_order_functions->getOrderItemDetail($order_id);
$manufacturer_email = array();
$supplier_email = array();
$reddesign_attachment = array();
$cartArr = array();
$cart_mdata = '';
for ($i = 0; $i < count($rowitem); $i++) {
$product = $producthelper->getProductById($rowitem[$i]->product_id);
$manufacturerData = $producthelper->getSection("manufacturer", $product->manufacturer_id);
if (count($manufacturerData) > 0) {
if ($manufacturerData->manufacturer_email != '') {
$manufacturer_email[$i] = $manufacturerData->manufacturer_email;
}
}
$supplierData = $producthelper->getSection("supplier", $product->supplier_id);
if (count($supplierData) > 0) {
if ($supplierData->supplier_email != '') {
$supplier_email[$i] = $supplierData->supplier_email;
}
}
}
$arr_discount_type = array();
$arr_discount = explode('@', $row->discount_type);
$discount_type = '';
for ($d = 0; $d < count($arr_discount); $d++) {
if ($arr_discount[$d]) {
$arr_discount_type = explode(':', $arr_discount[$d]);
if ($arr_discount_type[0] == 'c') {
$discount_type .= JText::_('COM_REDSHOP_COUPON_CODE') . ' : ' . $arr_discount_type[1] . '<br>';
}
if ($arr_discount_type[0] == 'v') {
$discount_type .= JText::_('COM_REDSHOP_VOUCHER_CODE') . ' : ' . $arr_discount_type[1] . '<br>';
}
}
}
if (!$discount_type) {
$discount_type = JText::_('COM_REDSHOP_NO_DISCOUNT_AVAILABLE');
}
$search[] = "{discount_type}";
$replace[] = $discount_type;
$split_amount = 0;
$issplitdisplay = '';
$issplitdisplay2 = '';
if ($row->split_payment) {
$issplitdisplay = "<br/>" . JText::_('COM_REDSHOP_RECEIPT_PARTIALLY_PAID_AMOUNT') . ": " . $producthelper->getProductFormattedPrice($split_amount);
$issplitdisplay2 = "<br/>" . JText::_('COM_REDSHOP_REMAINING_PARTIALLY_AMOUNT') . ": " . $producthelper->getProductFormattedPrice($split_amount);
}
$orderdetailurl = JURI::root() . 'index.php?option=com_redshop&view=order_detail&oid=' . $order_id . '&encr=' . $row->encr_key;
$search[] = "{order_detail_link}";
$replace[] = "<a href='" . $orderdetailurl . "'>" . JText::_("COM_REDSHOP_ORDER_MAIL") . "</a>";
$billingaddresses = $this->_order_functions->getOrderBillingUserInfo($order_id);
$message = str_replace($search, $replace, $message);
$message = $this->imginmail($message);
$thirdpartyemail = $billingaddresses->thirdparty_email;
if ($session->get('isredcrmuser')) {
$email = $user->email;
} else {
$email = $billingaddresses->user_email;
}
$search[] = "{order_id}";
$replace[] = $row->order_id;
$search[] = "{order_number}";
//.........这里部分代码省略.........
示例5: count
$print_url = $url . "index.php?option=com_redshop&view=category&layout=detail&cid=" . $this->catid;
$print_url .= "&print=1&tmpl=component&Itemid=" . $this->itemid;
$print_url .= "&limit=" . $endlimit . "&texpricemin=" . $texpricemin . "&texpricemax=" . $texpricemax . "&order_by=" . $this->order_by_select;
$print_url .= "&manufacturer_id=" . $this->manufacturer_id . "&category_template=" . $this->category_template_id;
$onclick = "onclick='window.open(\"{$print_url}\",\"mywindow\",\"scrollbars=1\",\"location=1\")'";
}
$print_tag = "<a " . $onclick . " title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "'>";
$print_tag .= "<img src='" . JSYSTEM_IMAGES_PATH . "printButton.png' alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' />";
$print_tag .= "</a>";
$template_desc = str_replace("{print}", $print_tag, $template_desc);
$template_desc = str_replace("{total_product}", count($this->product), $template_desc);
$template_desc = str_replace("{total_product_lbl}", JText::_('COM_REDSHOP_TOTAL_PRODUCT'), $template_desc);
if (strstr($template_desc, '{returntocategory_link}') || strstr($template_desc, '{returntocategory_name}') || strstr($template_desc, '{returntocategory}')) {
$parentid = $producthelper->getParentCategory($this->catid);
if ($parentid != 0) {
$categorylist = $producthelper->getSection("category", $parentid);
$returncatlink = JRoute::_("index.php?option=" . $this->option . "&view=category&cid=" . $parentid . '&manufacturer_id=' . $this->manufacturer_id . "&Itemid=" . $this->itemid);
$returntocategory = '<a href="' . $returncatlink . '">' . DAFULT_RETURN_TO_CATEGORY_PREFIX . ' ' . $categorylist->category_name . '</a>';
} else {
$categorylist->category_name = DAFULT_RETURN_TO_CATEGORY_PREFIX;
$returncatlink = JRoute::_("index.php?option=" . $this->option . "&view=category&manufacturer_id=" . $this->manufacturer_id . "&Itemid=" . $this->itemid);
$returntocategory = '<a href="' . $returncatlink . '">' . DAFULT_RETURN_TO_CATEGORY_PREFIX . '</a>';
}
$template_desc = str_replace("{returntocategory_link}", $returncatlink, $template_desc);
$template_desc = str_replace('{returntocategory_name}', $categorylist->category_name, $template_desc);
$template_desc = str_replace("{returntocategory}", $returntocategory, $template_desc);
}
if (strstr($template_desc, '{category_main_description}')) {
$main_cat_desc = $Redconfiguration->maxchar($this->maincat->category_description, CATEGORY_SHORT_DESC_MAX_CHARS, CATEGORY_SHORT_DESC_END_SUFFIX);
$template_desc = str_replace("{category_main_description}", $main_cat_desc, $template_desc);
}