本文整理汇总了PHP中producthelper::getAltText方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getAltText方法的具体用法?PHP producthelper::getAltText怎么用?PHP producthelper::getAltText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getAltText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$alink = "<a href='" . $catlink . "'>" . $category[$i]->category_name . "</a>";
$cart_mdata = str_replace("{category_name_with_link}", $alink, $cart_mdata);
$cart_mdata = str_replace("{category_desc}", $category[$i]->category_description, $cart_mdata);
$cart_mdata = str_replace("{category_name}", $category[$i]->category_name, $cart_mdata);
}
}
$template_desc = $template_start . $cart_mdata . $template_end;
}
if (strstr($template_desc, "{manufacturer_image}")) {
$mh_thumb = MANUFACTURER_THUMB_HEIGHT;
$mw_thumb = MANUFACTURER_THUMB_WIDTH;
$thum_image = "";
$media_image = $producthelper->getAdditionMediaImage($row->manufacturer_id, "manufacturer");
for ($m = 0; $m < count($media_image); $m++) {
if ($media_image[$m]->media_name && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . "manufacturer/" . $media_image[$m]->media_name)) {
$altText = $producthelper->getAltText('manufacturer', $row->manufacturer_id);
if (!$altText) {
$altText = $row->manufacturer_name;
}
if (WATERMARK_MANUFACTURER_IMAGE) {
$manufacturer_img = $redhelper->watermark('manufacturer', $media_image[$m]->media_name, "", "", WATERMARK_MANUFACTURER_IMAGE);
$maintype = "watermarked/main";
} else {
$maintype = "manufacturer/";
}
if (WATERMARK_MANUFACTURER_THUMB_IMAGE) {
$manufacturer_img = $redhelper->watermark('manufacturer', $media_image[$m]->media_name, "", "", WATERMARK_MANUFACTURER_THUMB_IMAGE);
$thumbtype = "watermarked/main";
} else {
$thumbtype = "manufacturer/";
}
示例2: onRSProductSearch
//.........这里部分代码省略.........
/************************************
* 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;
$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 != "") {