本文整理汇总了PHP中producthelper::getAdditionMediaImage方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getAdditionMediaImage方法的具体用法?PHP producthelper::getAdditionMediaImage怎么用?PHP producthelper::getAdditionMediaImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getAdditionMediaImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
for ($i = 0; $i < count($category); $i++) {
$cart_mdata .= $template_middle;
$catlink = JRoute::_('index.php?option=com_redshop&view=category&layout=detail&cid=' . $category[$i]->category_id . '&manufacturer_id=' . $row->manufacturer_id . '&Itemid=' . $Itemid);
$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";
示例2: onRSProductSearch
//.........这里部分代码省略.........
$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;
$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);
示例3: array
*/
$params = array();
$results = $this->dispatcher->trigger('onPrepareProduct', array(&$data_add, &$params, $product));
if (strstr($data_add, "{product_delivery_time}")) {
$product_delivery_time = $producthelper->getProductMinDeliveryTime($product->product_id);
if ($product_delivery_time != "") {
$data_add = str_replace("{delivery_time_lbl}", JText::_('COM_REDSHOP_DELIVERY_TIME'), $data_add);
$data_add = str_replace("{product_delivery_time}", $product_delivery_time, $data_add);
} else {
$data_add = str_replace("{delivery_time_lbl}", "", $data_add);
$data_add = str_replace("{product_delivery_time}", "", $data_add);
}
}
// More documents
if (strstr($data_add, "{more_documents}")) {
$media_documents = $producthelper->getAdditionMediaImage($product->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=' . $this->option . '&view=product&pid=' . $this->data->product_id . '&task=downloadDocument&fname=' . $media_documents[$m]->media_name . '&Itemid=' . $this->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" . $product->product_id . "'>" . $more_doc . "</span>", $data_add);
}
示例4: gbasefeed
public function gbasefeed($data)
{
$producthelper = new producthelper();
$stockroomhelper = new rsstockroomhelper();
$shippinghelper = new shipping();
$unpublished_data = $data['unpublished_data'];
$cid = $data['cid'];
$url = JURI::root();
$currency = new CurrencyHelper();
$product_img_url = $url . 'components/com_redshop/assets/images/product/';
$file_path = JPATH_COMPONENT_SITE . "/assets/document/gbase";
$file_name = $file_path . "/product.xml";
if (count($cid)) {
$cids = implode(',', $cid);
if ($unpublished_data == 1) {
$query = "SELECT p.*,m.manufacturer_name FROM " . $this->_table_prefix . "product AS p " . " LEFT JOIN " . $this->_table_prefix . "manufacturer AS m" . " ON p.manufacturer_id = m.manufacturer_id" . " WHERE p.product_id IN (" . $cids . ")";
} else {
$query = "SELECT p.*,m.manufacturer_name FROM " . $this->_table_prefix . "product AS p " . " LEFT JOIN " . $this->_table_prefix . "manufacturer AS m" . " ON p.manufacturer_id = m.manufacturer_id" . " WHERE p.product_id IN (" . $cids . ") and p.published =1";
}
$this->_db->setQuery($query);
$rs = $this->_db->loadObjectlist();
// For shipping information
$shippingArr = $shippinghelper->getShopperGroupDefaultShipping();
$default_shipping = 0.0;
$shipping_rate = $currency->convert(number_format($shippingArr['shipping_rate'], PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR), '', CURRENCY_CODE);
$default_shipping = count($shippingArr) > 0 ? $shipping_rate : number_format($default_shipping, PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR);
$default_shipping_country = DEFAULT_SHIPPING_COUNTRY;
$xml_code = '<?xml version="1.0" encoding="UTF-8" ';
$xml_code .= '<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0">';
$xml_code .= "<channel>";
for ($i = 0; $i < count($rs); $i++) {
// For additional images
$additional_images = $producthelper->getAdditionMediaImage($rs[$i]->product_id, $section = "product", $mediaType = "images");
$add_image = "";
for ($ad = 0; $ad < 10; $ad++) {
if (trim($additional_images[$ad]->product_full_image) != trim($additional_images[$ad]->media_name) && trim($additional_images[$ad]->media_name) != "") {
$add_image .= "<g:additional_image_link>" . $product_img_url . htmlspecialchars($additional_images[$ad]->media_name, ENT_NOQUOTES, "UTF-8") . "</g:additional_image_link>";
}
}
// For getting product Category
$category_name = $producthelper->getCategoryNameByProductId($rs[$i]->product_id);
if (USE_STOCKROOM == 1) {
// For cunt attributes
$attributes_set = array();
if ($rs[$i]->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $rs[$i]->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($rs[$i]->product_id);
$attributes = array_merge($attributes, $attributes_set);
$totalatt = count($attributes);
// Get stock details
$isStockExists = $stockroomhelper->isStockExists($rs[$i]->product_id);
if ($totalatt > 0 && !$isStockExists) {
$isStockExists = $stockroomhelper->isAttributeStockExists($product_id);
}
$isPreorderStockExists = $stockroomhelper->isPreorderStockExists($product_id);
if ($totalatt > 0 && !$isPreorderStockExists) {
$isPreorderStockExists = $stockroomhelper->isAttributePreorderStockExists($product_id);
}
if (!$isStockExists) {
$product_preorder = $rs[$i]->preorder;
if ($product_preorder == "global" && ALLOW_PRE_ORDER || $product_preorder == "yes" || $product_preorder == "" && ALLOW_PRE_ORDER) {
if (!$isPreorderStockExists) {
$product_status = JText::_('COM_REDSHOP_OUT_OF_STOCK');
} else {
$product_status = JText::_('COM_REDSHOP_PREORDER');
}
} else {
$product_status = JText::_('COM_REDSHOP_OUT_OF_STOCK');
}
} else {
$product_status = JText::_('COM_REDSHOP_AVAILABLE_FOR_ORDER');
}
} else {
$product_status = JText::_('COM_REDSHOP_AVAILABLE_FOR_ORDER');
}
$product_on_sale = 0;
if ($rs[$i]->product_on_sale == 1 && ($rs[$i]->discount_stratdate == 0 && $rs[$i]->discount_enddate == 0 || $rs[$i]->discount_stratdate <= time() && $rs[$i]->discount_enddate >= time())) {
$product_on_sale = 1;
}
// For price and vat settings
$product_price = $rs[$i]->product_price;
$discount_price = $rs[$i]->discount_price;
$sale_price = $product_on_sale == 1 ? $discount_price : $product_price;
$price_vat = $producthelper->getGoogleVatRates($rs[$i]->product_id, $product_price, USE_TAX_EXEMPT);
$sale_price_vat = $producthelper->getGoogleVatRates($rs[$i]->product_id, $sale_price, USE_TAX_EXEMPT);
if (DEFAULT_VAT_COUNTRY != "USA") {
$product_price = $rs[$i]->product_price + $price_vat;
$sale_price = $sale_price + $sale_price_vat;
}
$product_price = $currency->convert(number_format($product_price, PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR), '', CURRENCY_CODE);
$discount_price = $currency->convert(number_format($discount_price, PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR), '', CURRENCY_CODE);
$sale_price = $currency->convert(number_format($sale_price, PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR), '', CURRENCY_CODE);
$price_vat = $currency->convert(number_format($price_vat, PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR), '', CURRENCY_CODE);
$product_url = $url . "index.php?option=com_redshop&view=product&pid=" . $rs[$i]->product_id;
$xml_code .= "\n<item>";
$xml_code .= "\n<g:id>" . htmlspecialchars($rs[$i]->product_id, ENT_NOQUOTES, "UTF-8") . "</g:id>";
$xml_code .= "\n<title>" . htmlspecialchars($rs[$i]->product_name, ENT_NOQUOTES, "UTF-8") . "</title>";
$xml_code .= "\n<description>'" . htmlspecialchars($rs[$i]->product_s_desc, ENT_NOQUOTES, "UTF-8") . "'</description>";
$xml_code .= "\n<g:product_type>'" . htmlspecialchars($category_name, ENT_NOQUOTES, "UTF-8") . "'</g:product_type>";
//.........这里部分代码省略.........
示例5: foreach
}
if (strstr($template_desc, "{product_category_list}")) {
$pcats = "";
$prodCats = $producthelper->getProductCaterories($this->data->product_id);
foreach ($prodCats as $prodCat) {
$pcats .= '<a title="' . $prodCat->name . '" href="' . $prodCat->link . '">';
$pcats .= $prodCat->name;
$pcats .= "</a><br />";
}
$template_desc = str_replace("{product_category_list}", $pcats, $template_desc);
}
if (strstr($template_desc, "{manufacturer_image}")) {
$mh_thumb = MANUFACTURER_THUMB_HEIGHT;
$mw_thumb = MANUFACTURER_THUMB_WIDTH;
$thum_image = "";
$media_image = $producthelper->getAdditionMediaImage($this->data->manufacturer_id, "manufacturer");
$m = 0;
if ($media_image[$m]->media_name && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . "manufacturer/" . $media_image[$m]->media_name)) {
$wimg = $this->redHelper->watermark('manufacturer', $media_image[$m]->media_name, $mw_thumb, $mh_thumb, WATERMARK_MANUFACTURER_THUMB_IMAGE);
$linkimage = $this->redHelper->watermark('manufacturer', $media_image[$m]->media_name, '', '', WATERMARK_MANUFACTURER_IMAGE);
$altText = $producthelper->getAltText('manufacturer', $this->data->manufacturer_id);
if (!$altText) {
$altText = $this->data->manufacturer_name;
}
$thum_image = "<a title='" . $altText . "' class=\"modal\" href='" . $linkimage . "' rel=\"{handler: 'image', size: {}}\">\n\t\t\t\t<img alt='" . $altText . "' title='" . $altText . "' src='" . $wimg . "'></a>";
}
$template_desc = str_replace("{manufacturer_image}", $thum_image, $template_desc);
}
$product_weight_unit = '<span class="product_unit_variable">' . DEFAULT_WEIGHT_UNIT . '</span>';
if ($this->data->weight > 0) {
$insertStr = $producthelper->redunitDecimal($this->data->weight) . " " . $product_weight_unit;