本文整理汇总了PHP中producthelper::getChildProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getChildProduct方法的具体用法?PHP producthelper::getChildProduct怎么用?PHP producthelper::getChildProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getChildProduct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onRSProductSearch
//.........这里部分代码省略.........
}
}
}
$data_add = $data_add . $hidden_userfield;
/*************** end user fields ***************/
// ProductFinderDatepicker Extra Field Start
$fieldArray = $extraField->getSectionFieldList(17, 0, 0);
$data_add = $producthelper->getProductFinderDatepickerValue($data_add, $this->search[$i]->product_id, $fieldArray);
// ProductFinderDatepicker Extra Field End
/*
* manufacturer data
*/
$manufacturer_id = $this->search[$i]->manufacturer_id;
if ($manufacturer_id != 0) {
$manufacturer_data = $producthelper->getSection("manufacturer", $manufacturer_id);
$manufacturer_link_href = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $manufacturer_id . '&Itemid=' . $Itemid);
$manufacturer_name = "";
if (count($manufacturer_data) > 0) {
$manufacturer_name = $manufacturer_data->manufacturer_name;
}
$manufacturer_link = '<a href="' . $manufacturer_link_href . '" title="' . $manufacturer_name . '">' . $manufacturer_name . '</a>';
if (strstr($data_add, "{manufacturer_link}")) {
$data_add = str_replace("{manufacturer_name}", "", $data_add);
} else {
$data_add = str_replace("{manufacturer_name}", $manufacturer_name, $data_add);
}
$data_add = str_replace("{manufacturer_link}", $manufacturer_link, $data_add);
} else {
$data_add = str_replace("{manufacturer_link}", "", $data_add);
$data_add = str_replace("{manufacturer_name}", "", $data_add);
}
// End
// Replace wishlistbutton
$data_add = $producthelper->replaceWishlistButton($this->search[$i]->product_id, $data_add);
// Replace compare product button
$data_add = $producthelper->replaceCompareProductsButton($this->search[$i]->product_id, 0, $data_add);
// Checking for child products
$childproduct = $producthelper->getChildProduct($this->search[$i]->product_id);
if (count($childproduct) > 0) {
$isChilds = true;
$attributes = array();
} else {
$isChilds = false;
// Get attributes
$attributes_set = array();
if ($this->search[$i]->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $this->search[$i]->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($this->search[$i]->product_id);
$attributes = array_merge($attributes, $attributes_set);
}
// Product attribute Start
$totalatt = count($attributes);
// Check product for not for sale
$data_add = $producthelper->getProductNotForSaleComment($this->search[$i], $data_add, $attributes);
$data_add = $producthelper->replaceProductInStock($this->search[$i]->product_id, $data_add, $attributes, $attribute_template);
$data_add = $producthelper->replaceAttributeData($this->search[$i]->product_id, 0, 0, $attributes, $data_add, $attribute_template, $isChilds);
// Cart Template
$data_add = $producthelper->replaceCartTemplate($this->search[$i]->product_id, 0, 0, 0, $data_add, $isChilds, $userfieldArr, $totalatt, 0, $count_no_user_field, "");
$data .= $data_add;
}
$app = JFactory::getApplication();
$router = $app->getRouter();
$getorderby = JRequest::getVar('order_by', DEFAULT_PRODUCT_ORDERING_METHOD);
$vars = array('option' => 'com_redshop', 'view' => 'search', 'layout' => $layout, 'keyword' => $keyword, 'manufacture_id' => $manufacture_id, 'order_by' => $getorderby, 'category_id' => $cid, 'Itemid' => $Itemid, 'limit' => $limit);
$router->setVars($vars);
unset($vars);
if (strstr($template_org, "{pagination}")) {
$pagination = new redPagination($total_product, $start, $endlimit);
$slidertag = $pagination->getPagesLinks();
if (strstr($template_org, "{product_display_limit}")) {
$slidertag = "<form action='' method='post'><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}'> " . $pagination->getListFooter() . "</form>";
$template_org = str_replace("{product_display_limit}", $slidertag, $template_org);
$template_org = str_replace("{pagination}", '', $template_org);
}
$template_org = str_replace("{pagination}", $slidertag, $template_org);
}
$template_org = str_replace("{product_display_limit}", "", $template_org);
if (strstr($template_org, "perpagelimit:")) {
$perpage = explode('{perpagelimit:', $template_org);
$perpage = explode('}', $perpage[1]);
$template_org = str_replace("{perpagelimit:" . intval($perpage[0]) . "}", "", $template_org);
}
$template_org = str_replace("{order_by}", $orderby_form, $template_org);
$template_org = str_replace("{order_by_lbl}", JText::_('COM_REDSHOP_SELECT_ORDER_BY'), $template_org);
$template_org = str_replace("{filter_by_lbl}", JText::_('COM_REDSHOP_SELECT_FILTER_BY'), $template_org);
$template_org = str_replace("{attribute_price_with_vat}", "", $template_org);
$template_org = str_replace("{attribute_price_without_vat}", "", $template_org);
$template_org = str_replace("{product_loop_start}", "", $template_org);
$template_org = str_replace("{product_loop_end}", "", $template_org);
$template_org = str_replace($template_tmp_desc, $data, $template_org);
$template_org = str_replace("{with_vat}", "", $template_org);
$template_org = str_replace("{without_vat}", "", $template_org);
$template_org = $redTemplate->parseredSHOPplugin($template_org);
$template_org = $texts->replace_texts($template_org);
eval("?>" . $template_org . "<?php ");
} else {
echo "<br><h3>" . JText::_('COM_REDSHOP_MSG_SORRY_NO_RESULT_FOUND') . "</h3>";
}
}
示例2: array
/************************************
* 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
************************************/
$prddata_add = $producthelper->getProductOnSaleComment($product, $prddata_add);
// Replace wishlistbutton.
$prddata_add = $producthelper->replaceWishlistButton($product->product_id, $prddata_add);
// Replace compare product button.
$prddata_add = $producthelper->replaceCompareProductsButton($product->product_id, $this->catid, $prddata_add);
if (strstr($prddata_add, "{stockroom_detail}")) {
$prddata_add = $stockroomhelper->replaceStockroomAmountDetail($prddata_add, $product->product_id);
}
// Checking for child products.
$childproduct = $producthelper->getChildProduct($product->product_id);
if (count($childproduct) > 0) {
$isChilds = true;
$attributes = array();
} else {
$isChilds = false;
// Get attributes.
$attributes_set = array();
if ($product->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $product->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($product->product_id);
$attributes = array_merge($attributes, $attributes_set);
}
// Product attribute - Start.
$totalatt = count($attributes);
示例3: getAllChildProductArrayList
public function getAllChildProductArrayList($childid = 0, $parentid = 0)
{
$producthelper = new producthelper();
$info = $producthelper->getChildProduct($parentid);
for ($i = 0; $i < count($info); $i++) {
if ($childid != $info[$i]->product_id) {
$GLOBALS['childproductlist'][] = $info[$i];
$this->getAllChildProductArrayList($childid, $info[$i]->product_id);
}
}
return $GLOBALS['childproductlist'];
}
示例4: display_products
//.........这里部分代码省略.........
// Get child products
$childproducts = $model->getAllChildProductArrayList(0, $parentproductid);
if (count($childproducts) > 0) {
$childproducts = array_merge(array($productInfo), $childproducts);
$cld_name = array();
if (count($childproducts) > 0) {
$parentid = 0;
for ($c = 0; $c < count($childproducts); $c++) {
if ($childproducts[$c]->product_parent_id == 0) {
$level = "";
} else {
if ($parentid != $childproducts[$c]->product_parent_id) {
$level = $level;
}
}
$parentid = $childproducts[$c]->product_parent_id;
$childproducts[$c]->product_name = $level . $childproducts[$c]->product_name;
}
$cld_name = @array_merge($cld_name, $childproducts);
}
$selected = array($row->product_id);
$lists['product_child_id'] = JHTML::_('select.genericlist', $cld_name, 'pid', 'class="inputbox" size="1" onchange="document.frmChild.submit();"', 'product_id', 'product_name', $selected);
$frmChild .= "<form name='frmChild' method='get'>";
$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) {