本文整理汇总了PHP中producthelper::getProductOnSaleComment方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductOnSaleComment方法的具体用法?PHP producthelper::getProductOnSaleComment怎么用?PHP producthelper::getProductOnSaleComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getProductOnSaleComment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onRSProductSearch
//.........这里部分代码省略.........
$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}';
$ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_2;
$cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_2;
} 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;
示例2: explode
$cart_mdata2 = explode("{category_heading_end}", $cart_mdata1[1]);
if ($cname != $manufacturer_products[$i]->category_name) {
$cart_mdata = str_replace("{category_name}", $manufacturer_products[$i]->category_name, $cart_mdata);
$cart_mdata = str_replace("{category_heading_start}", "", $cart_mdata);
$cart_mdata = str_replace("{category_heading_end}", "", $cart_mdata);
} else {
$cart_mdata = $cart_mdata1[0] . $cart_mdata2[1];
}
$cname = $manufacturer_products[$i]->category_name;
$cart_mdata = str_replace("{category_heading_start}", "", $cart_mdata);
$cart_mdata = str_replace("{category_heading_end}", "", $cart_mdata);
}
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $manufacturer_products[$i]->product_id);
$product_name = "<a href='" . $link . "'>" . $manufacturer_products[$i]->product_name . "</a>";
$cart_mdata = str_replace("{product_name}", $product_name, $cart_mdata);
$cart_mdata = $producthelper->getProductOnSaleComment($manufacturer_products[$i], $cart_mdata);
$cart_mdata = $producthelper->getProductNotForSaleComment($manufacturer_products[$i], $cart_mdata);
$cart_mdata = $producthelper->getSpecialProductComment($manufacturer_products[$i], $cart_mdata);
$product_id = $manufacturer_products[$i]->product_id;
$childproduct = $producthelper->getChildProduct($product_id);
if (count($childproduct) > 0) {
$isChilds = true;
$attributes = array();
} else {
$isChilds = false;
// Get attributes
$attributes_set = array();
if ($manufacturer_products[$i]->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $manufacturer_products[$i]->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($product_id);
示例3: array
/*
* Product loop template extra field
* lat arg set to "1" for indetify parsing data for product tag loop in category
* last arg will parse {producttag:NAMEOFPRODUCTTAG} nameing tags.
* "1" is for section as product.
*/
if (count($loadCategorytemplate) > 0) {
$prddata_add = $producthelper->getExtraSectionTag($extraFieldName, $product->product_id, "1", $prddata_add, 1);
}
/************************************
* 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.
示例4:
$template_desc = str_replace("{product_weight_lbl}", "", $template_desc);
}
$template_desc = $stockroomhelper->replaceStockroomAmountDetail($template_desc, $this->data->product_id);
$template_desc = str_replace("{update_date}", $redshopconfig->convertDateFormat(strtotime($this->data->update_date)), $template_desc);
if ($this->data->publish_date != '0000-00-00 00:00:00') {
$template_desc = str_replace("{publish_date}", $redshopconfig->convertDateFormat(strtotime($this->data->publish_date)), $template_desc);
} else {
$template_desc = str_replace("{publish_date}", "", $template_desc);
}
/*
* 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
*/
$template_desc = $producthelper->getProductOnSaleComment($this->data, $template_desc);
/*
* Conditional tag
* if product on discount : Yes
* {if product_special} This is a special product {product_special end if} // OUTPUT : This is a special product
* NO : // OUTPUT : Display blank
*/
$template_desc = $producthelper->getSpecialProductComment($this->data, $template_desc);
$manuUrl = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $this->data->manufacturer_id . '&Itemid=' . $this->itemId);
$manufacturerLink = "<a href='" . $manuUrl . "'>" . JText::_("COM_REDSHOP_VIEW_MANUFACTURER") . "</a>";
$manuUrl = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=products&mid=' . $this->data->manufacturer_id . '&Itemid=' . $this->itemId);
$manufacturerPLink = "<a href='" . $manuUrl . "'>" . JText::_("COM_REDSHOP_VIEW_ALL_MANUFACTURER_PRODUCTS") . " " . $this->data->manufacturer_name . "</a>";
$template_desc = str_replace("{manufacturer_link}", $manufacturerLink, $template_desc);
$template_desc = str_replace("{manufacturer_product_link}", $manufacturerPLink, $template_desc);
$template_desc = str_replace("{manufacturer_name}", $this->data->manufacturer_name, $template_desc);
$template_desc = str_replace("{supplier_name}", "", $template_desc);