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


PHP producthelper::getAttributeTemplate方法代码示例

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


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

示例1: onRSProductSearch


//.........这里部分代码省略.........
         $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)) {
                     $pname = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pname);
开发者ID:,项目名称:,代码行数:67,代码来源:

示例2: array

if (count($childproduct) > 0) {
    $isChilds = true;
} else {
    $isChilds = false;
}
// Product attribute  Start
if ($isChilds) {
    $attributes = array();
    $selectAtt = array(array(), array());
} else {
    $attributes_set = array();
    if ($product->attribute_set_id > 0) {
        $attributes_set = $producthelper->getProductAttribute(0, $product->attribute_set_id, 0, 1);
    }
    $bool = INDIVIDUAL_ADD_TO_CART_ENABLE ? false : true;
    $attribute_template = $producthelper->getAttributeTemplate($template_desc, $bool);
    $attribute_template->template_desc = str_replace("{property_image_scroller}", "", $attribute_template->template_desc);
    $attribute_template->template_desc = str_replace("{subproperty_image_scroller}", "", $attribute_template->template_desc);
    $attributes = $producthelper->getProductAttribute($product_id);
    $attributes = array_merge($attributes, $attributes_set);
    $selectAtt = $carthelper->getSelectedCartAttributeArray($cart[$cart_index]['cart_attribute']);
}
$totalatt = count($attributes);
$template_desc = $producthelper->replaceAttributeData($product_id, 0, 0, $attributes, $template_desc, $attribute_template, $isChilds, $selectAtt, 0);
// Product attribute  End
$stockaddtocart = "stockaddtocartprd_" . $product_id;
$pdaddtocart = "pdaddtocartprd_" . $product_id;
$applybutton = "<input type='button' name='apply' value='" . JText::_('COM_REDSHOP_APPLY') . "' onclick='javascript:submitChangeAttribute();' />";
$applybutton .= "<input type='hidden' name='task' value='changeAttribute' />";
$applybutton .= "<input type='hidden' name='cart_index' value='" . $cart_index . "' />";
$applybutton .= "<input type='hidden' name='product_id' value='" . $product_id . "' />";
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: count

 }
 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 = '';
     $prddata_add = "";
     $this->product = $model->getCategorylistProduct($row->category_id);
     for ($j = 0; $j < count($this->product); $j++) {
         $product = $this->product[$j];
         if (!is_object($product)) {
             break;
         }
         $count_no_user_field = 0;
         // Counting accessory
         $accessorylist = $producthelper->getProductAccessory(0, $product->product_id);
         $totacc = count($accessorylist);
         $prddata_add .= $template_product;
         // Product User Field Start
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: producthelper

$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}")) {
            $rpimg_tag = '{relproduct_image_3}';
            $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT_3;
            $rpw_thumb = RELATED_PRODUCT_THUMB_WIDTH_3;
        } elseif (strstr($related_template_data, "{relproduct_image_2}")) {
            $rpimg_tag = '{relproduct_image_2}';
            $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT_2;
            $rpw_thumb = RELATED_PRODUCT_THUMB_WIDTH_2;
        } elseif (strstr($related_template_data, "{relproduct_image_1}")) {
            $rpimg_tag = '{relproduct_image_1}';
            $rph_thumb = RELATED_PRODUCT_THUMB_HEIGHT;
开发者ID:,项目名称:,代码行数:31,代码来源:

示例5: display_products


//.........这里部分代码省略.........
                        $frmChild .= JText::_('COM_REDSHOP_CHILD_PRODUCTS') . $lists['product_child_id'];
                        $frmChild .= "<input type='hidden' name='Itemid' value='" . $Itemid . "'>";
                        $frmChild .= "<input type='hidden' name='cid' value='" . $row->category_id . "'>";
                        $frmChild .= "<input type='hidden' name='view' value='product'>";
                        $frmChild .= "<input type='hidden' name='option' value='com_redshop'>";
                        $frmChild .= "</form>";
                    }
                }
                $wishlist_data = str_replace("{child_products}", $frmChild, $wishlist_data);
            }
            $childproduct = $producthelper->getChildProduct($row->product_id);
            if (count($childproduct) > 0) {
                if (PURCHASE_PARENT_WITH_CHILD == 1) {
                    $isChilds = false;
                    $attributes_set = array();
                    if ($row->attribute_set_id > 0) {
                        $attributes_set = $producthelper->getProductAttribute(0, $row->attribute_set_id, 0, 1);
                    }
                    $attributes = $producthelper->getProductAttribute($row->product_id);
                    $attributes = array_merge($attributes, $wishlist_data);
                } else {
                    $isChilds = true;
                    $attributes = array();
                }
            } else {
                $isChilds = false;
                $attributes_set = array();
                if ($row->attribute_set_id > 0) {
                    $attributes_set = $producthelper->getProductAttribute(0, $row->attribute_set_id, 0, 1);
                }
                $attributes = $producthelper->getProductAttribute($row->product_id);
                $attributes = array_merge($attributes, $attributes_set);
            }
            $attribute_template = $producthelper->getAttributeTemplate($wishlist_data);
            // Check product for not for sale
            $wishlist_data = $producthelper->getProductNotForSaleComment($row, $wishlist_data, $attributes);
            $wishlist_data = $producthelper->replaceProductInStock($row->product_id, $wishlist_data, $attributes, $attribute_template);
            /////////////////////////////////// Product attribute  Start /////////////////////////////////
            $totalatt = count($attributes);
            $wishlist_data = $producthelper->replaceAttributeData($row->product_id, 0, 0, $attributes, $wishlist_data, $attribute_template, $isChilds);
            /////////////////////////////////// Product attribute  End  	// Checking for child products end/////////////////////////////////
            if (!$row->not_for_sale) {
                if ($row->product_on_sale && $product_price_discount > 0) {
                    if ($product_price > $product_price_discount) {
                        $s_price = $product_price - $product_price_discount;
                        if ($this->show_discountpricelayout) {
                            $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                            $product_price = $product_price_discount;
                            $mainproduct_price = $producthelper->getProductFormattedPrice($product_price_discount);
                        } else {
                            $product_price = $product_price_discount;
                            $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                        }
                    } else {
                        $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                    }
                } else {
                    $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                }
                $wishlist_data = str_replace('{product_price}', $mainproduct_price, $wishlist_data);
            }
            // Product User Field Start
            $count_no_user_field = 0;
            $returnArr = $producthelper->getProductUserfieldFromTemplate($wishlist_data);
            $template_userfield = $returnArr[0];
            $userfieldArr = $returnArr[1];
开发者ID:,项目名称:,代码行数:67,代码来源:


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