本文整理汇总了PHP中producthelper::getProductImage方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductImage方法的具体用法?PHP producthelper::getProductImage怎么用?PHP producthelper::getProductImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getProductImage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_products
function display_products($rows)
{
$url = JURI::base();
$extra_data = new producthelper();
$producthelper = new producthelper();
for ($i = 0; $i < count($rows); $i++) {
$row = $rows[$i];
$Itemid = $this->redHelper->getItemid($row->product_id);
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
$product_price = $producthelper->getProductPrice($row->product_id);
$productArr = $producthelper->getProductNetPrice($row->product_id);
$product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
if ($row->product_full_image) {
echo $thum_image = "<div class='mod_wishlist_product_image' >" . ($thum_image = $producthelper->getProductImage($row->product_id, $link, "100", "100") . "\n\t\t\t</div>");
}
echo "<a href='" . $link . "'>" . $row->product_name . "</a><br>";
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) {
echo "<div id='mod_redoldprice' class='mod_redoldprice'><span style='text-decoration:line-through;'>" . $producthelper->getProductFormattedPrice($product_price) . "</span></div>";
$product_price = $product_price_discount;
echo "<div id='mod_redmainprice' class='mod_redmainprice'>" . $producthelper->getProductFormattedPrice($product_price_discount) . "</div>";
echo "<div id='mod_redsavedprice' class='mod_redsavedprice'>" . JText::_('COM_REDSHOP_PRODCUT_PRICE_YOU_SAVED') . ' ' . $producthelper->getProductFormattedPrice($s_price) . "</div>";
} else {
$product_price = $product_price_discount;
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
} else {
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
} else {
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
echo "<br><a href='" . $link . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a> ";
echo $addtocartdata = $producthelper->replaceCartTemplate($row->product_id);
echo "<div>" . $addtocartdata . "</div>";
}
}
示例2: onRSProductSearch
//.........这里部分代码省略.........
$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;
$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] != "") {
示例3: elseif
} elseif (strstr($prddata_add, "{product_thumb_image_2}")) {
$pimg_tag = '{product_thumb_image_2}';
$ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_2;
$pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_2;
} elseif (strstr($prddata_add, "{product_thumb_image_1}")) {
$pimg_tag = '{product_thumb_image_1}';
$ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
$pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
} else {
$pimg_tag = '{product_thumb_image}';
$ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
$pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
}
$hidden_thumb_image = "<input type='hidden' name='prd_main_imgwidth' id='prd_main_imgwidth' value='" . $pw_thumb . "'>";
$hidden_thumb_image .= "<input type='hidden' name='prd_main_imgheight' id='prd_main_imgheight' value='" . $ph_thumb . "'>";
$thum_image = $producthelper->getProductImage($product->product_id, $link, $pw_thumb, $ph_thumb, 2, 1);
// Product image flying addwishlist time start.
$thum_image = "<span class='productImageWrap' id='productImageWrapID_" . $product->product_id . "'>" . $producthelper->getProductImage($product->product_id, $link, $pw_thumb, $ph_thumb, 2, 1) . "</span>";
// Product image flying addwishlist time end.
$prddata_add = str_replace($pimg_tag, $thum_image . $hidden_thumb_image, $prddata_add);
$prddata_add = $producthelper->getJcommentEditor($product, $prddata_add);
/*
* 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);
}
/************************************
示例4: sendWishlist
public function sendWishlist($post)
{
$user = JFactory::getUser();
$redshopMail = new redshopMail();
$redhelper = new redhelper();
$wishlist_id = JRequest::getInt('wishlist_id');
$emailto = $post['emailto'];
$sender = $post['sender'];
$email = $post['email'];
$subject = $post['subject'];
$Itemid = $post['Itemid'];
$producthelper = new producthelper();
// Get data from database if not than fetch from session
if ($user->id && $wishlist_id) {
$query = "SELECT DISTINCT w.* ,p.* FROM " . $this->_table_prefix . "wishlist AS w " . "LEFT JOIN " . $this->_table_prefix . "wishlist_product AS pw ON w.wishlist_id=pw.wishlist_id " . "LEFT JOIN " . $this->_table_prefix . "product AS p ON p.product_id = pw.product_id " . "WHERE w.user_id = " . (int) $user->id . " " . "AND w.wishlist_id = " . (int) $wishlist_id . " ";
} else {
// Add this code to send wishlist while user is not loged in ...
$prod_id = "";
for ($add_i = 1; $add_i < $_SESSION["no_of_prod"]; $add_i++) {
$prod_id .= (int) $_SESSION['wish_' . $add_i]->product_id . ",";
}
$prod_id .= (int) $_SESSION['wish_' . $add_i]->product_id;
$query = "SELECT DISTINCT p.* FROM " . $this->_table_prefix . "product AS p " . "WHERE p.product_id IN (" . $prod_id . ")";
}
$MyWishlist = $this->_getList($query);
$i = 0;
$data = "";
$mailbcc = null;
$wishlist_body = $redshopMail->getMailtemplate(0, "mywishlist_mail");
if (count($wishlist_body) > 0) {
$wishlist_body = $wishlist_body[0];
$data = $wishlist_body->mail_body;
$subject = $wishlist_body->mail_subject;
if (trim($wishlist_body->mail_bcc) != "") {
$mailbcc = explode(",", $wishlist_body->mail_bcc);
}
}
if ($data) {
$template_d1 = explode("{product_loop_start}", $data);
$template_d2 = explode("{product_loop_end}", $template_d1[1]);
$wishlist_desc = $template_d2[0];
if (strstr($data, '{product_thumb_image_2}')) {
$tag = '{product_thumb_image_2}';
$h_thumb = THUMB_HEIGHT_2;
$w_thumb = THUMB_WIDTH_2;
} elseif (strstr($data, '{product_thumb_image_3}')) {
$tag = '{product_thumb_image_3}';
$h_thumb = THUMB_HEIGHT_3;
$w_thumb = THUMB_WIDTH_3;
} elseif (strstr($data, '{product_thumb_image_1}')) {
$tag = '{product_thumb_image_1}';
$h_thumb = THUMB_HEIGHT;
$w_thumb = THUMB_WIDTH;
} else {
$tag = '{product_thumb_image}';
$h_thumb = THUMB_HEIGHT;
$w_thumb = THUMB_WIDTH;
}
$temp_template = '';
if (count($MyWishlist)) {
foreach ($MyWishlist as $row) {
$Itemid = $redhelper->getItemid($row->product_id);
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . (int) $Itemid, true, -1);
$thum_image = $producthelper->getProductImage($row->product_id, $link, $w_thumb, $h_thumb);
$pname = $row->product_name;
$pname = $pname;
$wishlist_data = str_replace($tag, $thum_image, $wishlist_desc);
$wishlist_data = str_replace('{product_name}', $pname, $wishlist_data);
// Attribute ajax change
if (!$row->not_for_sale) {
$wishlist_data = $producthelper->GetProductShowPrice($row->product_id, $wishlist_data);
} else {
$wishlist_data = str_replace("{product_price}", "", $wishlist_data);
$wishlist_data = str_replace("{price_excluding_vat}", "", $wishlist_data);
$wishlist_data = str_replace("{product_price_table}", "", $wishlist_data);
$wishlist_data = str_replace("{product_old_price}", "", $wishlist_data);
$wishlist_data = str_replace("{product_price_saving}", "", $wishlist_data);
}
$temp_template .= $wishlist_data;
}
}
$data = $template_d1[0] . $temp_template . $template_d2[1];
$name = @explode('@', $emailto);
$data = str_replace('{from}', $sender, $data);
$data = str_replace('{name}', $name[0], $data);
$data = str_replace('{from_name}', $sender, $data);
$data_add = $data;
} else {
if (count($MyWishlist)) {
$link = JURI::root() . "index.php?tmpl=component&option=com_redshop&view=account&layout=mywishlist&mail=1";
foreach ($MyWishlist as $row) {
$data_add .= '<div class="redProductWishlist">';
$thum_image = "";
$pname = $row->product_name;
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
$thum_image = $producthelper->getProductImage($row->product_id, $link, THUMB_WIDTH, THUMB_HEIGHT);
$data_add .= $thum_image;
$pname = "<div><a href='" . $link . "' >" . $pname . "</a></div>";
$data_add .= $pname;
$formatted_price = $producthelper->GetProductShowPrice($row->product_id, $wishlist_data);
//.........这里部分代码省略.........
示例5: foreach
} else {
$tag = '{product_thumb_image}';
$h_thumb = THUMB_HEIGHT;
$w_thumb = THUMB_WIDTH;
}
$temp_template = '';
$extraFieldName = $extraField->getSectionFieldNameArray(1, 1, 1);
if (count($MyWishlist) > 0) {
$mainid = null;
$totattid = null;
$totcount_no_user_field = null;
foreach ($MyWishlist as $row) {
$wishlistuserfielddata = $producthelper->getwishlistuserfieldata($row->wishlist_id, $row->product_id);
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
$link_remove = JRoute::_('index.php?option=com_redshop&view=account&layout=mywishlist&wishlist_id=' . $wishlist_id . '&pid=' . $row->product_id . '&remove=1&Itemid=' . $Itemid);
$thum_image = $producthelper->getProductImage($row->product_id, $link, $w_thumb, $h_thumb);
$product_price = $producthelper->getProductPrice($row->product_id);
$product_price_discount = $producthelper->getProductNetPrice($row->product_id);
$pname = "<a href='" . $link . "' >" . $row->product_name . "</a>";
$wishlist_data = str_replace($tag, $thum_image, $wishlist_desc);
$wishlist_data = str_replace('{product_number}', $row->product_number, $wishlist_data);
$wishlist_data = str_replace('{product_name}', $pname, $wishlist_data);
/*if($product_price > $product_price_discount)
{
$wishlist_data = str_replace('{product_price}', $producthelper->getProductFormattedPrice($product_price_discount) , $wishlist_data);
}else{
$wishlist_data = str_replace('{product_price}', $producthelper->getProductFormattedPrice($product_price) , $wishlist_data);
}*/
$wishlist_data = str_replace('{product_s_desc}', $row->product_s_desc, $wishlist_data);
// Checking for child products start
if (strstr($wishlist_data, "{child_products}")) {
示例6:
<table border="0" cellpadding="2" cellspacing="2">
<?php
for ($i = 0; $i < count($this->prdlist); $i++) {
$row = $this->prdlist[$i];
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id);
$pricetext = '';
$product_price = $producthelper->getProductPrice($row->product_id);
$tmpprcie = $product_price;
if ($product_price >= $texpricemin && $product_price <= $texpricemax && $count > 0) {
$k++;
$count--;
?>
<tr>
<td>
<?php
$thum_image = $producthelper->getProductImage($row->product_id, $link, $thumbwidth, $thumbheight);
echo "<div class='mod_redshop_pricefilter'>";
if ($image) {
echo $thum_image . "<br>";
}
echo "<a href='" . $link . "'>" . $row->product_name . "</a><br>";
$productArr = $producthelper->getProductNetPrice($row->product_id);
$product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
$taxexempt_addtocart = $producthelper->taxexempt_addtocart();
if (!$row->not_for_sale && $show_price && $taxexempt_addtocart) {
if (SHOW_PRICE && (!DEFAULT_QUOTATION_MODE || DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE)) {
if (!$product_price) {
$product_price_dis = $producthelper->getPriceReplacement($product_price);
} else {
$product_price_dis = $producthelper->getProductFormattedPrice($product_price);
}