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


PHP producthelper::getProductUserfieldFromTemplate方法代码示例

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


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

示例1: displayQuotationUserfield

 public function displayQuotationUserfield($quotation_item_id = 0, $section_id = 12)
 {
     $redTemplate = new Redtemplate();
     $producthelper = new producthelper();
     $resultArr = array();
     $db = JFactory::getDbo();
     $sql = "SELECT fd.*,f.field_title,f.field_type,f.field_name " . "FROM " . $this->_table_prefix . "quotation_fields_data AS fd " . "LEFT JOIN " . $this->_table_prefix . "fields AS f ON f.field_id=fd.fieldid " . "WHERE fd.quotation_item_id= " . (int) $quotation_item_id . " AND fd.section = " . $db->quote($section_id);
     $db->setQuery($sql);
     $userfield = $db->loadObjectlist();
     if (count($userfield) > 0) {
         $quotationItem = $this->getQuotationProduct(0, $quotation_item_id);
         $product_id = $quotationItem[0]->product_id;
         $productdetail = $producthelper->getProductById($product_id);
         $productTemplate = $redTemplate->getTemplate("product", $productdetail->product_template);
         $returnArr = $producthelper->getProductUserfieldFromTemplate($productTemplate[0]->template_desc);
         $userFieldTag = $returnArr[1];
         for ($i = 0; $i < count($userFieldTag); $i++) {
             for ($j = 0; $j < count($userfield); $j++) {
                 if ($userfield[$j]->field_name == $userFieldTag[$i]) {
                     if ($userfield[$j]->field_type == 10) {
                         $files = explode(",", $userfield[$j]->data_txt);
                         $data_txt = "";
                         for ($f = 0; $f < count($files); $f++) {
                             $u_link = REDSHOP_FRONT_DOCUMENT_ABSPATH . "product/" . $files[$f];
                             $data_txt .= "<a href='" . $u_link . "'>" . $files[$f] . "</a> ";
                         }
                         $resultArr[] = $userfield[$j]->field_title . " : " . $data_txt;
                     } else {
                         $resultArr[] = $userfield[$j]->field_title . " : " . $userfield[$j]->data_txt;
                     }
                 }
             }
         }
     }
     $resultstr = "";
     if (count($resultArr) > 0) {
         $resultstr .= "<br/>" . implode("<br/>", $resultArr);
     }
     return $resultstr;
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:40,代码来源:quotation.php

示例2: onRSProductSearch


//.........这里部分代码省略.........
             } elseif (strstr($data_add, "{product_thumb_image_1}")) {
                 $cimg_tag = '{product_thumb_image_1}';
                 $ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
                 $cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
             } else {
                 $cimg_tag = '{product_thumb_image}';
                 $ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
                 $cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
             }
             $hidden_thumb_image = "<input type='hidden' name='prd_main_imgwidth' id='prd_main_imgwidth' value='" . $cw_thumb . "'><input type='hidden' name='prd_main_imgheight' id='prd_main_imgheight' value='" . $ch_thumb . "'>";
             $thum_image = $producthelper->getProductImage($this->search[$i]->product_id, $link, $cw_thumb, $ch_thumb);
             $data_add = str_replace($cimg_tag, $thum_image . $hidden_thumb_image, $data_add);
             // More documents
             if (strstr($data_add, "{more_documents}")) {
                 $media_documents = $producthelper->getAdditionMediaImage($this->search[$i]->product_id, "product", "document");
                 $more_doc = '';
                 for ($m = 0; $m < count($media_documents); $m++) {
                     $alttext = $producthelper->getAltText("product", $media_documents[$m]->section_id, "", $media_documents[$m]->media_id, "document");
                     if (!$alttext) {
                         $alttext = $media_documents[$m]->media_name;
                     }
                     if (is_file(REDSHOP_FRONT_DOCUMENT_RELPATH . "product/" . $media_documents[$m]->media_name)) {
                         $downlink = JUri::root() . 'index.php?tmpl=component&option=com_redshop&view=product&pid=' . $this->search[$i]->product_id . '&task=downloadDocument&fname=' . $media_documents[$m]->media_name . '&Itemid=' . $Itemid;
                         $more_doc .= "<div><a href='" . $downlink . "' title='" . $alttext . "'>";
                         $more_doc .= $alttext;
                         $more_doc .= "</a></div>";
                     }
                 }
                 $data_add = str_replace("{more_documents}", "<span id='additional_docs" . $this->search[$i]->product_id . "'>" . $more_doc . "</span>", $data_add);
             }
             // More documents end
             /************************************************ user fields*******************************************************/
             $hidden_userfield = "";
             $returnArr = $producthelper->getProductUserfieldFromTemplate($data_add);
             $template_userfield = $returnArr[0];
             $userfieldArr = $returnArr[1];
             $count_no_user_field = 0;
             if ($template_userfield != "") {
                 $ufield = "";
                 for ($ui = 0; $ui < count($userfieldArr); $ui++) {
                     $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $this->search[$i]->product_id);
                     $ufield .= $product_userfileds[1];
                     if ($product_userfileds[1] != "") {
                         $count_no_user_field++;
                     }
                     $data_add = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $data_add);
                     $data_add = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $data_add);
                 }
                 $product_userfileds_form = "<form method='post' action='' id='user_fields_form_" . $this->search[$i]->product_id . "' name='user_fields_form_" . $this->search[$i]->product_id . "'>";
                 if ($ufield != "") {
                     $data_add = str_replace("{if product_userfield}", $product_userfileds_form, $data_add);
                     $data_add = str_replace("{product_userfield end if}", "</form>", $data_add);
                 } else {
                     $data_add = str_replace("{if product_userfield}", "", $data_add);
                     $data_add = str_replace("{product_userfield end if}", "", $data_add);
                 }
             } elseif (AJAX_CART_BOX) {
                 $ajax_detail_template_desc = "";
                 $ajax_detail_template = $producthelper->getAjaxDetailboxTemplate($this->search[$i]);
                 if (count($ajax_detail_template) > 0) {
                     $ajax_detail_template_desc = $ajax_detail_template->template_desc;
                 }
                 $returnArr = $producthelper->getProductUserfieldFromTemplate($ajax_detail_template_desc);
                 $template_userfield = $returnArr[0];
                 $userfieldArr = $returnArr[1];
                 if ($template_userfield != "") {
开发者ID:,项目名称:,代码行数:67,代码来源:

示例3: replaceUserfield

 public function replaceUserfield($product_id = 0, $template_id = 0, $unique_id = "")
 {
     $producthelper = new producthelper();
     $redTemplate = new Redtemplate();
     $extraField = new extra_field();
     $template_desc = $redTemplate->getTemplate("product", $template_id);
     $returnArr = $producthelper->getProductUserfieldFromTemplate($template_desc[0]->template_desc);
     $commonid = $product_id . $unique_id;
     $product_userfileds = "<table>";
     for ($ui = 0; $ui < count($returnArr[1]); $ui++) {
         $result_arr = $extraField->list_all_user_fields($returnArr[1][$ui], 12, "", $commonid);
         $hidden_arr = $extraField->list_all_user_fields($returnArr[1][$ui], 12, "hidden", $commonid);
         if ($result_arr[0] != "") {
             $product_userfileds .= "<tr><td>" . $result_arr[0] . "</td><td>" . $result_arr[1] . $hidden_arr[1] . "</td></tr>";
         }
     }
     $product_userfileds .= "</table>";
     return $product_userfileds;
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:19,代码来源:product.php

示例4: count

 $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
     $hidden_userfield = "";
     $returnArr = $producthelper->getProductUserfieldFromTemplate($prddata_add);
     $template_userfield = $returnArr[0];
     $userfieldArr = $returnArr[1];
     if ($template_userfield != "") {
         $ufield = "";
         for ($ui = 0; $ui < count($userfieldArr); $ui++) {
             $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $product->product_id);
             $ufield .= $product_userfileds[1];
             if ($product_userfileds[1] != "") {
                 $count_no_user_field++;
             }
             $prddata_add = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $prddata_add);
             $prddata_add = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $prddata_add);
         }
         $product_userfileds_form = "<form method='post' action='' id='user_fields_form_" . $product->product_id . "' name='user_fields_form_" . $product->product_id . "'>";
         if ($ufield != "") {
开发者ID:,项目名称:,代码行数:31,代码来源:

示例5:

 if ($detail->customer_amount != 1) {
     $template = str_replace("{giftcard_reciver_email}", $reciver_email, $template);
     $template = str_replace("{giftcard_reciver_name}", $reciver_name, $template);
 } else {
     $template = str_replace("{giftcard_reciver_email}", '', $template);
     $template = str_replace("{giftcard_reciver_name}", '', $template);
 }
 if ($detail->customer_amount != 1) {
     $template = str_replace("{giftcard_validity}", $detail->giftcard_validity, $template);
 } else {
     $template = str_replace("{giftcard_validity}", '', $template);
 }
 $template = $producthelper->getValidityDate($detail->giftcard_validity, $template);
 // Product User Field Start
 $count_no_user_field = 0;
 $returnArr = $producthelper->getProductUserfieldFromTemplate($template, 1);
 $template_userfield = $returnArr[0];
 $userfieldArr = $returnArr[1];
 if (strstr($template, "{if giftcard_userfield}") && strstr($template, "{giftcard_userfield end if}") && $template_userfield != "") {
     $ufield = "";
     $cart = $session->get('cart');
     if (isset($cart['idx'])) {
         $idx = (int) $cart['idx'];
     }
     $idx = 0;
     $cart_id = '';
     for ($j = 0; $j < $idx; $j++) {
         if ($cart[$j]['giftcard_id'] == $gid) {
             $cart_id = $j;
         }
     }
开发者ID:,项目名称:,代码行数:31,代码来源:

示例6: array

         $data_add = str_replace('{product_image}', " ", $data_add);
     }
 }
 $count_no_user_field = 0;
 $extrafieldNames = $this->input->getString('extrafieldNames', '');
 $nextrafield = $this->input->getInt('nextrafield', 1);
 $data = array();
 $data['property_data'] = $this->input->getString('property_data', '');
 $data['subproperty_data'] = $this->input->getString('subproperty_data', '');
 $data['accessory_data'] = $this->input->getString('accessory_data', '');
 $data['acc_quantity_data'] = $this->input->getString('acc_quantity_data', '');
 $data['acc_property_data'] = $this->input->getString('acc_property_data', '');
 $data['acc_subproperty_data'] = $this->input->getString('acc_subproperty_data', '');
 $selectAcc = $producthelper->getSelectedAccessoryArray($data);
 $selectAtt = $producthelper->getSelectedAttributeArray($data);
 $returnArr = $producthelper->getProductUserfieldFromTemplate($data_add);
 $template_userfield = $returnArr[0];
 $userfieldArr = $returnArr[1];
 if ($template_userfield != "") {
     $ufield = "";
     $cart = $this->session->get('cart');
     if (isset($cart['idx'])) {
         $idx = (int) $cart['idx'];
     }
     $idx = 0;
     $cart_id = '';
     for ($j = 0; $j < $idx; $j++) {
         if ($cart[$j]['product_id'] == $this->data->product_id) {
             $cart_id = $j;
         }
     }
开发者ID:,项目名称:,代码行数:31,代码来源:

示例7: display_products


//.........这里部分代码省略.........
                $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];
            if (strstr($wishlist_data, "{if product_userfield}") && strstr($wishlist_data, "{product_userfield end if}") && $template_userfield != "") {
                $ufield = "";
                $cart = $session->get('cart');
                if (isset($cart['idx'])) {
                    $idx = (int) $cart['idx'];
                }
                $idx = 0;
                $cart_id = '';
                for ($j = 0; $j < $idx; $j++) {
                    if ($cart[$j]['product_id'] == $row->product_id) {
                        $cart_id = $j;
                    }
                }
                for ($ui = 0; $ui < count($userfieldArr); $ui++) {
                    if (!$idx) {
                        $cart_id = "";
                    }
                    $mysesspro = "productuserfield_" . $ui;
                    for ($check_i = 1; $check_i <= $_SESSION["no_of_prod"]; $check_i++) {
                        if ($_SESSION['wish_' . $check_i]->product_id == $row->product_id) {
                            $product_userfileds_final = $_SESSION['wish_' . $check_i]->{$mysesspro};
                        }
                    }
                    if ($product_userfileds_final != '') {
                        $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $row->product_id, $product_userfileds_final, 1);
                    } else {
                        $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', $cart_id, 0, $row->product_id);
                    }
                    $ufield .= $product_userfileds[1];
                    //
开发者ID:,项目名称:,代码行数:67,代码来源:


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