Exemplo n.º 1
0
				</tr>
			</table>
		</fieldset>
		<div class="col50">
			<fieldset class="adminform">
				<legend><?php 
echo JText::_('COM_REDSHOP_SHOPPER_GROUP_LOGO');
?>
</legend>
				<table class="admintable">
					<tr>
						<td><input type="file" name="shopper_group_logo" id="shopper_group_logo" size="77"/></td>
						<td><?php 
$ilink = JRoute::_('index.php?tmpl=component&option=com_redshop&view=product_detail&task=media_bank&e_name=text');
$image_path = REDSHOP_FRONT_IMAGES_ABSPATH . 'shopperlogo/' . $this->detail->shopper_group_logo;
$imagethumb_path = RedShopHelperImages::getImagePath($this->detail->shopper_group_logo, '', 'thumb', 'shopperlogo', THUMB_WIDTH, THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
?>
</td>
						<td>
							<div class="button2-left">
								<div class="image"><a class="modal" title="Image" href="<?php 
echo $ilink;
?>
"
								                      rel="{handler: 'iframe', size: {x: 570, y: 400}}">Image</a></div>
							</div>
							<input type="hidden" name="shopper_group_logo_tmp" id="shopper_group_logo_tmp"/>
							<input type="hidden" name="shopper_group_logo" id="shopper_group_logo"
							       value="<?php 
echo $this->detail->shopper_group_logo;
?>
Exemplo n.º 2
0
 public function newsletterEntry($data)
 {
     $db = JFactory::getDbo();
     $newsletter_id = $data['default_newsletter'];
     $mailfrom = $data['news_mail_from'];
     $mailfromname = $data['news_from_name'];
     $to = $data['newsletter_test_email'];
     $producthelper = new producthelper();
     $uri = JURI::getInstance();
     $url = $uri->root();
     // Getting newsletter content
     $newsbody = $this->getnewsletter_content($newsletter_id);
     $subject = "";
     $newsletter_body = "";
     $newsletter_template = "";
     if (count($newsbody) > 0) {
         $subject = $newsbody[0]->subject;
         $newsletter_body = $newsbody[0]->body;
         $newsletter_template = $newsbody[0]->template_desc;
     }
     $o = new stdClass();
     $o->text = $newsletter_body;
     JPluginHelper::importPlugin('content');
     $dispatcher = JDispatcher::getInstance();
     $x = array();
     $results = $dispatcher->trigger('onPrepareContent', array(&$o, &$x, 0));
     $newsletter_template2 = $o->text;
     $content = str_replace("{data}", $newsletter_template2, $newsletter_template);
     $product_id_list = $this->getProductIdList();
     for ($i = 0; $i < count($product_id_list); $i++) {
         $product_id = $product_id_list[$i]->product_id;
         if (strstr($content, '{redshop:' . $product_id . '}')) {
             $content = str_replace('{redshop:' . $product_id . '}', "", $content);
         }
         if (strstr($content, '{Newsletter Products:' . $product_id . '}')) {
             $product_id = $product_id_list[$i]->product_id;
             $newsproductbody = $this->getnewsletterproducts_content();
             $np_temp_desc = $newsproductbody[0]->template_desc;
             $thum_image = "";
             if ($product_id_list[$i]->product_full_image) {
                 $thumbUrl = RedShopHelperImages::getImagePath($product_id_list[$i]->product_full_image, '', 'thumb', 'product', PRODUCT_MAIN_IMAGE, PRODUCT_MAIN_IMAGE, USE_IMAGE_SIZE_SWAPPING);
                 $thum_image = "<a id='a_main_image' href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $product_id_list[$i]->product_full_image . "' title='' rel=\"lightbox[product7]\">";
                 $thum_image .= "<img id='main_image' src='" . $thumbUrl . "'>";
                 $thum_image .= "</a>";
             }
             $np_temp_desc = str_replace("{product_thumb_image}", $thum_image, $np_temp_desc);
             $np_temp_desc = str_replace("{product_price}", $producthelper->getProductFormattedPrice($product_id_list[$i]->product_price), $np_temp_desc);
             $np_temp_desc = str_replace("{product_name}", $product_id_list[$i]->product_name, $np_temp_desc);
             $np_temp_desc = str_replace("{product_desc}", $product_id_list[$i]->product_desc, $np_temp_desc);
             $np_temp_desc = str_replace("{product_s_desc}", $product_id_list[$i]->product_s_desc, $np_temp_desc);
             $content = str_replace("{Newsletter Products:" . $product_id . "}", $np_temp_desc, $content);
         }
     }
     // Replacing the Text library texts
     $texts = new text_library();
     $content = $texts->replace_texts($content);
     // If the template contains the images, then revising the path of the images,
     // So the full URL goes with the mail, so images are visible in the mails.
     $data1 = $data = $content;
     preg_match_all("/\\< *[img][^\\>]*[.]*\\>/i", $data, $matches);
     $imagescurarray = array();
     foreach ($matches[0] as $match) {
         preg_match_all("/(src|height|width)*= *[\"\\']{0,1}([^\"\\'\\ \\>]*)/i", $match, $m);
         $images[] = array_combine($m[1], $m[2]);
         $imagescur = array_combine($m[1], $m[2]);
         $imagescurarray[] = $imagescur['src'];
     }
     $imagescurarray = array_unique($imagescurarray);
     if ($imagescurarray) {
         foreach ($imagescurarray as $change) {
             if (strpos($change, 'http') === false) {
                 $data1 = str_replace($change, $url . $change, $data1);
             }
         }
     }
     $to = trim($to);
     $today = time();
     // Replacing the tags with the values
     $name = explode('@', $to);
     $query = "INSERT INTO `" . $this->_table_prefix . "newsletter_tracker` " . "(`tracker_id`, `newsletter_id`, `subscription_id`, `subscriber_name`, `user_id` , `read`, `date`)  " . "VALUES ('', '" . $newsletter_id . "', '0', '" . $name . "', '0',0, '" . $today . "')";
     $db->setQuery($query);
     $db->query();
     $content = '<img  src="' . $url . 'components/com_redshop/helpers/newsletteropener.php?tracker_id=' . $db->insertid() . '" />';
     $content .= str_replace("{username}", $name[0], $data1);
     $content = str_replace("{email}", $to, $content);
     if (JUtility::sendMail($mailfrom, $mailfromname, $to, $subject, $content, 1)) {
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
            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/";
            }
            $thumbUrl = RedShopHelperImages::getImagePath($media_image[$m]->media_name, '', 'thumb', $thumbtype, $mw_thumb, $mh_thumb, USE_IMAGE_SIZE_SWAPPING);
            $thum_image = "<a title='" . $altText . "' class=\"modal\" href='" . REDSHOP_FRONT_IMAGES_ABSPATH . $maintype . $media_image[$m]->media_name . "'   rel=\"{handler: 'image', size: {}}\">\n\t\t\t\t<img alt='" . $altText . "' title='" . $altText . "' src='" . $thumbUrl . "'></a>";
        }
    }
    $template_desc = str_replace("{manufacturer_image}", $thum_image, $template_desc);
}
$manlink = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $row->manufacturer_id . '&Itemid=' . $Itemid);
$manproducts = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=products&mid=' . $row->manufacturer_id . '&Itemid=' . $Itemid);
$template_desc = str_replace("{manufacturer_name}", $row->manufacturer_name, $template_desc);
// Replace Manufacturer URL
if (strstr($template_desc, "{manufacturer_url}")) {
    $manufacturer_url = "<a href='" . $row->manufacturer_url . "'>" . $row->manufacturer_url . "</a>";
    $template_desc = str_replace("{manufacturer_url}", $manufacturer_url, $template_desc);
}
// Extra field display
$extraFieldName = $extraField->getSectionFieldNameArray(10, 1, 1);
Exemplo n.º 4
0
}
?>
				>
				<table cellpadding="0" cellspacing="5" border="0" id="bulk_table">

					<tr>
						<th><?php 
echo JText::_('COM_REDSHOP_MEDIA_NAME');
?>
</th>
						<td>
							<?php 
if ($this->detail->media_name) {
    $filetype = strtolower(JFile::getExt($this->detail->media_name));
    if ($filetype == 'png' || $filetype == 'jpg' || $filetype == 'jpeg' || $filetype == 'gif') {
        $thumbUrl = RedShopHelperImages::getImagePath($this->detail->media_name, '', 'thumb', $this->detail->media_section, THUMB_WIDTH, THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
        ?>
									<a class="modal"
									   href="<?php 
        echo $url . 'components/' . $option . '/assets/' . $this->detail->media_type . '/' . $this->detail->media_section . '/' . $this->detail->media_name;
        ?>
"
									   title="<?php 
        echo JText::_('COM_REDSHOP_VIEW_IMAGE');
        ?>
"
									   rel="{handler: 'image', size: {}}">
										<img
											src="<?php 
        echo $thumbUrl;
        ?>
Exemplo n.º 5
0
        ?>
			<tr>
				<td>&nbsp;</td>
				<td>
					<?php 
        echo '<input type="checkbox" name="image_delete" ><label>';
        echo JText::_('COM_REDSHOP_DELETE_CURRENT_IMAGE');
        echo '</label>';
        ?>
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<?php 
        $thumbUrl = RedShopHelperImages::getImagePath($this->detail->category_full_image, '', 'thumb', 'category', THUMB_WIDTH, THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
        ?>
					<a class="modal"
					   href="<?php 
        echo REDSHOP_FRONT_IMAGES_ABSPATH;
        ?>
category/<?php 
        echo $this->detail->category_full_image;
        ?>
"
					   title="" rel="{handler: 'image', size: {}}">
					   <img src="<?php 
        echo $thumbUrl;
        ?>
"></a>
				</td>
Exemplo n.º 6
0
echo JText::_('COM_REDSHOP_ADD');
?>
"
							   onclick="addNewRowOfsub('admintable');"
							/>
					</td>
				</tr>

				<?php 
if (count($images) > 0) {
    ?>
					<?php 
    for ($i = 0; $i < count($images); $i++) {
        $image = $images[$i];
        $thumb = $image->subattribute_color_image;
        $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'subcolor', PRODUCT_ADDITIONAL_IMAGE, PRODUCT_ADDITIONAL_IMAGE, USE_IMAGE_SIZE_SWAPPING);
        ?>
						<tr>
							<td>
								<input type="text" name="subattribute_name[]" id="subattribute_name[]" value="<?php 
        echo $image->subattribute_color_name;
        ?>
" size="30"/>
							</td>
							<td>
								<?php 
        if (file_exists($thumbUrl)) {
            ?>
									<img src="<?php 
            echo $thumbUrl;
            ?>
Exemplo n.º 7
0
?>
	<script type="text/javascript" language="javascript">//var J=jQuery.noConflict();</script>
	<div style="clear:both"></div>
<?php 
if (count($ajaxdetal_template) > 0) {
    $ajaxdetal_templatedata = $ajaxdetal_template->template_desc;
    $data_add = $ajaxdetal_templatedata;
    $data_add = str_replace('{product_name}', $this->data->product_name, $data_add);
    if ($this->data->product_price != 0) {
        $data_add = str_replace('{product_price}', $this->data->product_price, $data_add);
    } else {
        $data_add = str_replace('{product_price}', " ", $data_add);
    }
    if (strstr($data_add, "{product_image}")) {
        if ($this->data->product_full_image && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $this->data->product_full_image)) {
            $thumbUrl = RedShopHelperImages::getImagePath($this->data->product_full_image, '', 'thumb', 'product', PRODUCT_MAIN_IMAGE, PRODUCT_MAIN_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
            $productsrcPath = "<a href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $this->data->product_full_image . "' title='" . $this->data->product_name . "' rel='lightbox[product7]'>";
            $productsrcPath .= "<img src='" . $thumbUrl . "'>";
            $productsrcPath .= "</a>";
            $data_add = str_replace('{product_image}', $productsrcPath, $data_add);
        } else {
            $data_add = str_replace('{product_image}', " ", $data_add);
        }
    }
    $count_no_user_field = 0;
    $extrafieldNames = $this->input->getString('extrafieldNames', '');
    $nextrafield = $this->input->getInt('nextrafield', 1);
    $data = array();
    $data['property_data'] = $this->input->getString('property_data', '');
    $data['subproperty_data'] = $this->input->getString('subproperty_data', '');
    $data['accessory_data'] = $this->input->getString('accessory_data', '');
Exemplo n.º 8
0
 }
 for ($i = 0; $i < $compare['idx']; $i++) {
     $product = $producthelper->getProductById($compare[$i]["product_id"]);
     if ($i == $compare['idx'] - 1) {
         $td_start = "";
         $td_end = "";
     } else {
         $td_start = "<td>";
         $td_end = "</td>";
     }
     $exp_div = "<div name='exp_" . $product->product_id . "'>";
     $div_end = "</div>";
     $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $product->product_id . '&Itemid=' . $this->itemId);
     $link_remove = JRoute::_('index.php?option=com_redshop&view=product&task=removecompare&layout=compare&pid=' . $product->product_id . '&Itemid=' . $this->itemId);
     $remove = "<a href='" . $link_remove . "'>" . JText::_('TPL_REDGADGETS_REMOVE_PRODUCT_FROM_COMPARE_LIST') . "</a>";
     $thumbUrl = RedShopHelperImages::getImagePath($product->product_full_image, '', 'thumb', 'product', COMPARE_PRODUCT_THUMB_WIDTH, COMPARE_PRODUCT_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
     $img = "<div style='width:" . COMPARE_PRODUCT_THUMB_WIDTH . "px;height:" . COMPARE_PRODUCT_THUMB_HEIGHT . "px;float: left;' ><a href='" . $link . "' title='" . $product->product_name . "'><img src='" . $thumbUrl . "'></a></div>";
     $expand = "<a href='javascript:void(0)' onClick='expand_collapse(this," . $product->product_id . ")' style='font-size:18px;text-decoration:none;' >-</a>";
     if ($i != $compare['idx'] - 1) {
         $template = str_replace('{expand_collapse}', $expand . $td_end . '<td align="center">' . "{expand_collapse}", $template);
     } else {
         $template = str_replace('{expand_collapse}', $expand . $td_end . $td_start . "{expand_collapse}", $template);
     }
     $template = str_replace('{product_name}', $exp_div . $product->product_name . $div_end . $td_end . $td_start . "{product_name}", $template);
     $template = str_replace('{product_image}', $exp_div . $img . $div_end . $td_end . $td_start . "{product_image}", $template);
     if (strstr($template, "{manufacturer_name}")) {
         $manufacturer = $producthelper->getSection('manufacturer', $product->manufacturer_id);
         $template = str_replace('{manufacturer_name}', $exp_div . $manufacturer->manufacturer_name . $div_end . $td_end . $td_start . "{manufacturer_name}", $template);
     }
     if (strstr($template, "{discount_start_date}")) {
         $disc_start_date = "";
Exemplo n.º 9
0
				</tr>
			</table>
			<div>&nbsp;</div>
			<table border="0" cellpadding="5" cellspacing="0" width="100%">
				<tr valign="top">
					<td width="40%">
						<?php 
            $i = 0;
            if (count($MyTags) > 0) {
                foreach ($MyTags as $row) {
                    $data_add = '<div style="float:left;width:' . (THUMB_WIDTH + 50) . 'px;height:' . (THUMB_HEIGHT + 70) . 'px;text-align:center;">';
                    $thum_image = "";
                    $pname = $row->product_name;
                    $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
                    if ($row->product_full_image) {
                        $thumbUrl = RedShopHelperImages::getImagePath($row->product_full_image, '', 'thumb', 'product', THUMB_WIDTH, THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                        $thum_image = "<div style='width:" . THUMB_WIDTH . "px;height:" . THUMB_HEIGHT . "px;margin-left:20px;' ><a href='" . $link . "' title=''><img src='" . $thumbUrl . "'></a></div>";
                        $data_add .= $thum_image;
                    }
                    $pname = "<div ><a href='" . $link . "' >" . $pname . "</a></div>";
                    $data_add .= $pname;
                    // For attribute price count
                    $price_add = '<span id="pr_price">' . $extra_data->getProductFormattedPrice($row->product_price) . '</span>';
                    $tax_amount = $extra_data->getProductTax($row->product_id);
                    if ($tax_amount == 0) {
                        $data_add .= '<div>' . $price_add . '</div>';
                    } else {
                        $data_add .= '<div>' . $extra_data->getProductFormattedPrice($tax_amount) . '</div>';
                    }
                    // Start cart
                    $tax_amount == 0 ? $product_price = $row->product_price : ($product_price = $tax_amount);
Exemplo n.º 10
0
     }
     $ahrefpath = REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $product->product_full_image;
     $ahrefbackpath = REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $product->product_back_full_image;
     $product_front_image_link = "<a href='#' onClick='javascript:changeproductImage(" . $product->product_id . ",\"" . $mainsrcPath . "\",\"" . $ahrefpath . "\");'>" . JText::_('COM_REDSHOP_FRONT_IMAGE') . "</a>";
     $product_back_image_link = "<a href='#' onClick='javascript:changeproductImage(" . $product->product_id . ",\"" . $backsrcPath . "\",\"" . $ahrefbackpath . "\");'>" . JText::_('COM_REDSHOP_BACK_IMAGE') . "</a>";
     $data_add = str_replace("{front_img_link}", $product_front_image_link, $data_add);
     $data_add = str_replace("{back_img_link}", $product_back_image_link, $data_add);
 } else {
     $data_add = str_replace("{front_img_link}", "", $data_add);
     $data_add = str_replace("{back_img_link}", "", $data_add);
 }
 // Front-back image tag end
 // Product preview image.
 if (strstr($data_add, '{product_preview_img}')) {
     if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . 'product/' . $product->product_preview_image)) {
         $previewsrcPath = RedShopHelperImages::getImagePath($product->product_preview_image, '', 'thumb', 'product', CATEGORY_PRODUCT_PREVIEW_IMAGE_WIDTH, CATEGORY_PRODUCT_PREVIEW_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
         $previewImg = "<img src='" . $previewsrcPath . "' class='rs_previewImg' />";
         $data_add = str_replace("{product_preview_img}", $previewImg, $data_add);
     } else {
         $data_add = str_replace("{product_preview_img}", "", $data_add);
     }
 }
 $data_add = $producthelper->getJcommentEditor($product, $data_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) {
     $data_add = $producthelper->getExtraSectionTag($extraFieldName, $product->product_id, "1", $data_add, 1);
Exemplo n.º 11
0
/**
 * @package     RedSHOP.Backend
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
$fid = JRequest::getVar('fid', '');
$fsec = JRequest::getVar('fsec', '');
$folder = JRequest::getVar('folder', '');
if ($folder == '') {
    $thumb_path = JURI::root() . "components/com_redshop/assets/images/" . $this->_tmp_img->path_relative;
} else {
    $thumb_path = RedShopHelperImages::getImagePath(basename($this->_tmp_img->path_relative), '', 'thumb', $folder, $this->_tmp_img->width_60, $this->_tmp_img->height_60, USE_IMAGE_SIZE_SWAPPING);
}
?>
<div class="imgOutline">
	<div class="imgTotal">
		<div align="center" class="imgBorder" style=''>
			<a class="img-preview"
			   href="javascript:window.parent.jimage_insert('<?php 
echo 'components/com_redshop/assets/images/' . $this->_tmp_img->path_relative;
?>
','<?php 
echo $fid;
?>
','<?php 
echo $fsec;
?>
Exemplo n.º 12
0
JHTML::_('behavior.tooltip');
$Itemid = JRequest::getInt('Itemid');
$loginlink = 'index.php?option=com_redshop&view=login&Itemid=' . $Itemid;
$newuser_link = 'index.php?option=com_redshop&view=registration&Itemid=' . $Itemid;
$forgotpwd_link = 'index.php?option=com_redshop&view=password&Itemid=' . $Itemid;
$shoppergroupid = JRequest::getInt('protalid', 0);
$returnitemid = $Itemid;
if (PORTAL_LOGIN_ITEMID) {
    $returnitemid = PORTAL_LOGIN_ITEMID;
}
$portallogofile = REDSHOP_FRONT_IMAGES_RELPATH . 'shopperlogo/' . DEFAULT_PORTAL_LOGO;
$portallogo = RedShopHelperImages::getImagePath(DEFAULT_PORTAL_LOGO, '', 'thumb', 'shopperlogo', THUMB_WIDTH, THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
$portalname = DEFAULT_PORTAL_NAME;
$portalintro = "";
if ($shoppergroupid != 0) {
    $portallogo = RedShopHelperImages::getImagePath($this->ShopperGroupDetail[0]->shopper_group_logo, '', 'thumb', 'shopperlogo', THUMB_WIDTH, THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
    $portalname = $this->ShopperGroupDetail[0]->shopper_group_name;
    $portalintro = $this->ShopperGroupDetail[0]->shopper_group_introtext;
}
?>
<form action="<?php 
echo JRoute::_($loginlink);
?>
" method="post">
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<tr>
			<td colspan="2" align="center">
				<?php 
if (is_file($portallogofile)) {
    ?>
					<img src="<?php 
Exemplo n.º 13
0
function display_products($rows)
{
    $url = JURI::base();
    $extraField = new extraField();
    $session = JFactory::getSession();
    $producthelper = new producthelper();
    $redhelper = new redhelper();
    $config = new Redconfiguration();
    $redTemplate = new Redtemplate();
    $template = $redTemplate->getTemplate("wishlist_template");
    if (count($template) <= 0) {
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $Itemid = $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);
            $product_price_discount = $producthelper->getProductNetPrice($row->product_id);
            echo "<div id='wishlist_box'>";
            if ($row->product_full_image) {
                echo $thum_image = "<div class='wishlist_left'><div class='mod_wishlist_product_image wishlist_image'>" . ($thum_image = $producthelper->getProductImage($row->product_id, $link, "85", "63") . "</div></div>");
            } else {
                $maindefaultpath = REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . PRODUCT_DEFAULT_IMAGE;
                echo $thum_image = "<div class='wishlist_left'><div class='mod_wishlist_product_image wishlist_image'><a href='" . $link . "'><img src='" . $maindefaultpath . "' height='85' width='63' /></a></div></div>";
            }
            echo "<div class='wishlist_center'><div class='wishlist_title'><a href='" . $link . "'>" . $row->product_name . "</a></div><br>";
            if (!$row->not_for_sale) {
                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 wishlist_price'>" . $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 wishlist_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
                        }
                    } else {
                        echo "<div class='mod_redproducts_price wishlist_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
                    }
                } else {
                    echo "<div class='mod_redproducts_price wishlist_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
                }
            }
            echo "<br><div class='wishlist_readmore'><a href='" . $link . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a></div>&nbsp;</div> ";
            $addtocartdata = $producthelper->replaceCartTemplate($row->product_id, 0, 0, $row->product_id);
            echo "<div class='wishlist_right'>" . $addtocartdata . "</div><br class='clear' /></div><br class='clear' />";
        }
    } else {
        $ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
        $pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
        $wishlist_data1 = $template[0]->template_desc;
        $mlink = JURI::root() . "index.php?option=com_redshop&view=account&layout=mywishlist&mail=1&tmpl=component&wishlist_id=" . $wishlist_id;
        $mail_link = '<a class="redcolorproductimg" href="' . $mlink . '"  ><img src="' . REDSHOP_ADMIN_IMAGES_ABSPATH . 'mailcenter16.png" ></a>';
        $wishlist_data1 = str_replace('{mail_link}', $mail_link, $wishlist_data1);
        $template_d1 = explode("{product_loop_start}", $wishlist_data1);
        $template_d2 = explode("{product_loop_end}", $template_d1[1]);
        $temp_template = '';
        $extraFieldName = $extraField->getSectionFieldNameArray(1, 1, 1);
        for ($i = 0; $i < count($rows); $i++) {
            $row = $rows[$i];
            $wishlist_data = $template_d2[0];
            $Itemid = $redhelper->getItemid($rows[$i]->product_id);
            $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $rows[$i]->product_id . '&Itemid=' . $Itemid);
            $product_price = $producthelper->getProductPrice($row->product_id);
            $product_price_discount = $producthelper->getProductNetPrice($row->product_id);
            if ($row->product_full_image) {
                $thum_image = $producthelper->getProductImage($row->product_id, $link, $pw_thumb, $ph_thumb);
                $wishlist_data = str_replace('{product_thumb_image}', $thum_image, $wishlist_data);
            } else {
                $maindefaultpath = RedShopHelperImages::getImagePath(PRODUCT_DEFAULT_IMAGE, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                $thum_image = "<a href='" . $link . "'><img src='" . $maindefaultpath . "'  /></a>";
                $wishlist_data = str_replace('{product_thumb_image}', $thum_image, $wishlist_data);
            }
            $pname = "<a href='" . $link . "'>" . $row->product_name . "</a>";
            $pnumber = $row->product_number;
            $pdesc = $row->product_s_desc;
            // Checking for child products start
            if (strstr($wishlist_data, "{child_products}")) {
                $parentproductid = $row->product_id;
                if ($this->data->product_parent_id != 0) {
                    $parentproductid = $producthelper->getMainParentProduct($row->product_id);
                }
                $frmChild = "";
                if ($parentproductid != 0) {
                    $productInfo = $producthelper->getProductById($parentproductid);
                    // 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) {
                    if ($product_price > $product_price_discount) {
                        $s_price = $product_price - $product_price_discount;
                        if ($this->show_discountpricelayout) {
                            $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                            $product_price = $product_price_discount;
                            $mainproduct_price = $producthelper->getProductFormattedPrice($product_price_discount);
                        } else {
                            $product_price = $product_price_discount;
                            $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                        }
                    } else {
                        $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                    }
                } else {
                    $mainproduct_price = $producthelper->getProductFormattedPrice($product_price);
                }
                $wishlist_data = str_replace('{product_price}', $mainproduct_price, $wishlist_data);
            }
            // Product User Field Start
            $count_no_user_field = 0;
            $returnArr = $producthelper->getProductUserfieldFromTemplate($wishlist_data);
            $template_userfield = $returnArr[0];
            $userfieldArr = $returnArr[1];
            if (strstr($wishlist_data, "{if product_userfield}") && strstr($wishlist_data, "{product_userfield end if}") && $template_userfield != "") {
                $ufield = "";
                $cart = $session->get('cart');
                if (isset($cart['idx'])) {
                    $idx = (int) $cart['idx'];
                }
                $idx = 0;
                $cart_id = '';
                for ($j = 0; $j < $idx; $j++) {
                    if ($cart[$j]['product_id'] == $row->product_id) {
                        $cart_id = $j;
                    }
                }
                for ($ui = 0; $ui < count($userfieldArr); $ui++) {
                    if (!$idx) {
                        $cart_id = "";
                    }
                    $mysesspro = "productuserfield_" . $ui;
                    for ($check_i = 1; $check_i <= $_SESSION["no_of_prod"]; $check_i++) {
                        if ($_SESSION['wish_' . $check_i]->product_id == $row->product_id) {
                            $product_userfileds_final = $_SESSION['wish_' . $check_i]->{$mysesspro};
                        }
                    }
                    if ($product_userfileds_final != '') {
                        $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $row->product_id, $product_userfileds_final, 1);
                    } else {
                        $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', $cart_id, 0, $row->product_id);
                    }
                    $ufield .= $product_userfileds[1];
                    //
                    if ($product_userfileds[1] != "") {
                        $count_no_user_field++;
                    }
                    if ($product_userfileds_final != '') {
                        $wishlist_data = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $wishlist_data);
                        $wishlist_data = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $wishlist_data);
                    } else {
                        $wishlist_data = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $wishlist_data);
                        $wishlist_data = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $wishlist_data);
                    }
                }
                $product_userfileds_form = "<form method='post' action='' id='user_fields_form' name='user_fields_form'>";
                if ($ufield != "") {
                    $wishlist_data = str_replace("{if product_userfield}", $product_userfileds_form, $wishlist_data);
                    $wishlist_data = str_replace("{product_userfield end if}", "</form>", $wishlist_data);
                } else {
                    $wishlist_data = str_replace("{if product_userfield}", "", $wishlist_data);
                    $wishlist_data = str_replace("{product_userfield end if}", "", $wishlist_data);
                }
            }
            // Product User Field End
            /////////////////////////////////// Product accessory Start /////////////////////////////////
            $accessory = $producthelper->getProductAccessory(0, $row->product_id);
            $totalAccessory = count($accessory);
            $wishlist_data = $producthelper->replaceAccessoryData($row->product_id, 0, $accessory, $wishlist_data, $isChilds);
            /////////////////////////////////// Product accessory End /////////////////////////////////
            $wishlist_data = str_replace('{product_name}', $pname, $wishlist_data);
            $wishlist_data = str_replace('{product_number}', $pnumber, $wishlist_data);
            $wishlist_data = str_replace('{product_s_desc}', $pdesc, $wishlist_data);
            $wishlist_data = $producthelper->getExtraSectionTag($extraFieldName, $row->product_id, "1", $wishlist_data, 1);
            $wishlist_data = $producthelper->replaceCartTemplate($row->product_id, $row->category_id, 0, 0, $wishlist_data, $isChilds, $userfieldArr, $totalatt, $totalAccessory, $count_no_user_field);
            $rmore = "<a href='" . $link . "' title='" . $row->product_name . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a>";
            $wishlist_data = str_replace("{read_more}", $rmore, $wishlist_data);
            $wishlist_data = str_replace("{read_more_link}", $link, $wishlist_data);
            $wishlist_data = str_replace("{product_loop_start}", '', $wishlist_data);
            $wishlist_data = str_replace("{product_loop_end}", '', $wishlist_data);
            $wishlist_data = str_replace("{back_link}", '', $wishlist_data);
            $wishlist_data = str_replace("{back_link}", '', $wishlist_data);
            $wishlist_data = str_replace("{mail_link}", '', $wishlist_data);
            $wishlist_data = str_replace("{if product_on_sale}", '', $wishlist_data);
            $wishlist_data = str_replace("{product_on_sale end if}", '', $wishlist_data);
            $wishlist_data = str_replace("<table></table>", '', $wishlist_data);
            $wishlist_data = str_replace("{all_cart}", '', $wishlist_data);
            $wishlist_data = str_replace("{if product_on_sale}", "", $wishlist_data);
            $wishlist_data = str_replace("{product_on_sale end if}", "", $wishlist_data);
            $regdellink = JRoute::_("index.php?mydel=1&view=wishlist&wishlist_id=" . $row->product_id . "&task=mysessdelwishlist");
            $mainregdellink = "<div><a href=\"" . $regdellink . "\">" . JText::_('COM_REDSHOP_REMOVE_PRODUCT_FROM_WISHLIST') . "</a></div>";
            $wishlist_data = str_replace('{remove_product_link}', $mainregdellink, $wishlist_data);
            $mainid .= $row->product_id . ",";
            $totattid .= $totalatt . ",";
            $totcount_no_user_field .= $count_no_user_field . ",";
            $temp_template .= $wishlist_data;
        }
        $my = "<form name='frm' method='POST' action=''>";
        $my .= "<input type='hidden' name='product_id' id='product_id' value='" . $mainid . "' >\n\n\t\t\t<input type='hidden' name='totacc_id' id='totacc_id' value='" . $totattid . "' >\n\t\t\t<input type='hidden' name='totcount_no_user_field' id='totcount_no_user_field' value='" . $totcount_no_user_field . "' >\n\t\t\t<input type='button' name='submit' onclick='return productalladdprice();' value='" . JText::_('COM_REDSHOP_ADD_TO_CART') . "'>\n\t\t\t</form>";
        $data = $template_d1[0] . $temp_template . $template_d2[1];
        $data = str_replace('{back_link}', '', $data);
        $data = str_replace('{all_cart}', $my, $data);
        $data = $redTemplate->parseredSHOPplugin($data);
        echo eval("?>" . $data . "<?php ");
    }
}
Exemplo n.º 14
0
 /**
  * Water mark image.
  *
  *  @param   string  $mtype             Comment.
  *  @param   string  $Imagename         Comment.
  *  @param   string  $thumb_width       Comment.
  *  @param   string  $thumb_height      Comment.
  *  @param   string  $enable_watermart  Comment.
  *  @param   int     $add_img           Comment.
  *
  * @return string
  */
 public function watermark($mtype, $Imagename = '', $thumb_width = '', $thumb_height = '', $enable_watermart = WATERMARK_PRODUCT_IMAGE, $add_img = 0)
 {
     require_once JPATH_ROOT . '/administrator/components/com_redshop/helpers/images.php';
     $url = JURI::root();
     /*
      * IF watermark is not enable
      * return thumb image
      */
     if ($enable_watermart <= 0) {
         if (($thumb_width != '' || $thumb_width != 0) && ($thumb_height != '' || $thumb_width != 0)) {
             $file_path = JPATH_SITE . '/components/com_redshop/assets/images/' . $mtype . '/' . $Imagename;
             $filename = RedShopHelperImages::generateImages($file_path, '', 'thumb', $mtype, $thumb_width, $thumb_height, USE_IMAGE_SIZE_SWAPPING);
             $filename_path_info = pathinfo($filename);
             $filename = REDSHOP_FRONT_IMAGES_ABSPATH . $mtype . '/thumb/' . $filename_path_info['basename'];
         } else {
             $filename = REDSHOP_FRONT_IMAGES_ABSPATH . $mtype . "/" . $Imagename;
         }
         return $filename;
     }
     if ($Imagename && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . $mtype . "/" . $Imagename) && (WATERMARK_IMAGE && file_exists(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . WATERMARK_IMAGE))) {
         if ($thumb_width != '' && $thumb_height != '') {
             $file_path = JPATH_SITE . '/components/com_redshop/assets/images/product/' . WATERMARK_IMAGE;
             $filename = RedShopHelperImages::generateImages($file_path, '', 'thumb', 'product', $thumb_width, $thumb_height, USE_IMAGE_SIZE_SWAPPING);
             $filename_path_info = pathinfo($filename);
             $watermark = REDSHOP_FRONT_IMAGES_ABSPATH . 'product/thumb/' . $filename_path_info['basename'];
             $file_path = JPATH_SITE . '/components/com_redshop/assets/images/' . $mtype . '/' . $Imagename;
             $filename = RedShopHelperImages::generateImages($file_path, '', 'thumb', $mtype, $thumb_width, $thumb_height, USE_IMAGE_SIZE_SWAPPING);
             $filename_path_info = pathinfo($filename);
             $filename = REDSHOP_FRONT_IMAGES_ABSPATH . $mtype . '/thumb/' . $filename_path_info['basename'];
             if ($add_img == 2) {
                 $gnImagename = 'hover' . $Imagename;
             } elseif ($add_img == 1) {
                 $gnImagename = 'add' . $Imagename;
             } else {
                 $gnImagename = $Imagename;
             }
         } else {
             $watermark = REDSHOP_FRONT_IMAGES_RELPATH . "product/" . WATERMARK_IMAGE;
             $filename = REDSHOP_FRONT_IMAGES_RELPATH . $mtype . "/" . $Imagename;
             $gnImagename = 'main' . $Imagename;
             if (file_exists(REDSHOP_FRONT_IMAGES_RELPATH . "watermarked/" . $gnImagename)) {
                 return $DestinationFile = REDSHOP_FRONT_IMAGES_ABSPATH . "watermarked/" . $gnImagename;
             }
         }
         $DestinationFile = REDSHOP_FRONT_IMAGES_RELPATH . "watermarked/" . $gnImagename;
         $filetype = JFile::getExt(WATERMARK_IMAGE);
         switch ($filetype) {
             case "gif":
                 $dest = @imagecreatefromjpeg($filename);
                 $src = @imagecreatefromgif($watermark);
                 list($width, $height, $type, $attr) = @getimagesize($filename);
                 list($markwidth, $markheight, $type1, $attr1) = @getimagesize($watermark);
                 @imagecopymerge($dest, $src, $width - $markwidth >> 1, $height - $markheight >> 1, 0, 0, $markwidth, $markheight, 50);
                 // Save the image to a file
                 @imagejpeg($dest, $DestinationFile);
                 $DestinationFile = REDSHOP_FRONT_IMAGES_ABSPATH . "watermarked/" . $gnImagename;
                 return $DestinationFile;
             case "png":
                 $im = imagecreatefrompng($watermark);
                 $exten = JFile::getExt($filename);
                 $extARRAY = @explode('&', $exten);
                 $ext = $extARRAY[0];
                 if (strtolower($ext) == "gif") {
                     if (!($im2 = imagecreatefromgif($filename))) {
                         echo "Error opening {$filename}!";
                     }
                 } elseif (strtolower($ext) == "jpg") {
                     if (!($im2 = imagecreatefromjpeg($filename))) {
                         echo "Error opening {$filename}!";
                         exit;
                     }
                 } elseif (strtolower($ext) == "png") {
                     if (!($im2 = imagecreatefrompng($filename))) {
                         echo "Error opening {$filename}!";
                         exit;
                     }
                 } else {
                     die;
                 }
                 imagecopy($im2, $im, imagesx($im2) / 2 - imagesx($im) / 2, imagesy($im2) / 2 - imagesy($im) / 2, 0, 0, imagesx($im), imagesy($im));
                 $waterless = imagesx($im2) - imagesx($im);
                 $rest = ceil($waterless / imagesx($im) / 2);
                 for ($n = 1; $n <= $rest; $n++) {
                     imagecopy($im2, $im, imagesx($im2) / 2 - imagesx($im) / 2 - imagesx($im) * $n, imagesy($im2) / 2 - imagesy($im) / 2, 0, 0, imagesx($im), imagesy($im));
                     imagecopy($im2, $im, imagesx($im2) / 2 - imagesx($im) / 2 + imagesx($im) * $n, imagesy($im2) / 2 - imagesy($im) / 2, 0, 0, imagesx($im), imagesy($im));
                 }
                 imagejpeg($im2, $DestinationFile);
                 $DestinationFile = REDSHOP_FRONT_IMAGES_ABSPATH . "watermarked/" . $gnImagename;
                 return $DestinationFile;
         }
     } else {
         if (($thumb_width != '' || $thumb_width != 0) && ($thumb_height != '' || $thumb_width != 0)) {
             $filename = RedShopHelperImages::getImagePath($Imagename, '', 'thumb', $mtype, $thumb_width, $thumb_height, USE_IMAGE_SIZE_SWAPPING);
         } else {
             $filename = REDSHOP_FRONT_IMAGES_ABSPATH . $mtype . "/" . $Imagename;
         }
         return $filename;
     }
 }
Exemplo n.º 15
0
 public function sendQuotationMail($quotation_id, $status = 0)
 {
     $uri = JURI::getInstance();
     $url = $uri->root();
     $redconfig = new Redconfiguration();
     $producthelper = new producthelper();
     $extra_field = new extra_field();
     $quotationHelper = new quotationHelper();
     $config = JFactory::getConfig();
     $mailinfo = $this->getMailtemplate(0, "quotation_mail");
     $mailbcc = array();
     if (count($mailinfo) > 0) {
         $message = $mailinfo[0]->mail_body;
         $subject = $mailinfo[0]->mail_subject;
         if (trim($mailinfo[0]->mail_bcc) != "") {
             $mailbcc = explode(",", $mailinfo[0]->mail_bcc);
         }
     } else {
         return false;
     }
     $template_start = "";
     $template_end = "";
     $template_middle = "";
     $cart = '';
     $template_sdata = explode('{product_loop_start}', $message);
     $extraField = new extraField();
     $fieldArray = $extraField->getSectionFieldList(17, 0, 0);
     if (count($template_sdata) > 0) {
         $template_start = $template_sdata[0];
         if (count($template_sdata) > 1) {
             $template_edata = explode('{product_loop_end}', $template_sdata[1]);
             if (count($template_edata) > 1) {
                 $template_end = $template_edata[1];
             }
             if (count($template_edata) > 0) {
                 $template_middle = $template_edata[0];
             }
         }
     }
     $row = $quotationHelper->getQuotationDetail($quotation_id);
     if (count($row) <= 0) {
         return false;
     }
     $rowitem = $quotationHelper->getQuotationProduct($quotation_id);
     for ($i = 0; $i < count($rowitem); $i++) {
         $product_id = $rowitem[$i]->product_id;
         $product = $producthelper->getProductById($product_id);
         $product_name = "<div class='product_name'>" . $rowitem[$i]->product_name . "</div>";
         $product_total_price = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_price * $rowitem[$i]->product_quantity) . "</div>";
         $product_price = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_price) . "</div>";
         $product_price_excl_vat = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_excl_price) . "</div>";
         $product_quantity = '<div class="update_cart">' . $rowitem[$i]->product_quantity . '</div>';
         $product_total_price_excl_vat = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($rowitem[$i]->product_excl_price * $rowitem[$i]->product_quantity) . "</div>";
         $cart_mdata = $template_middle;
         $wrapper_name = "";
         if ($rowitem[$i]->product_wrapperid) {
             $wrapper = $producthelper->getWrapper($product_id, $rowitem[$i]->product_wrapperid);
             if (count($wrapper) > 0) {
                 $wrapper_name = $wrapper[0]->wrapper_name;
             }
             $wrapper_name = JText::_('COM_REDSHOP_WRAPPER') . ": " . $wrapper_name;
         }
         $product_image_path = '';
         if ($product->product_full_image) {
             if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) {
                 $product_image_path = $product->product_full_image;
             } else {
                 if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                     $product_image_path = PRODUCT_DEFAULT_IMAGE;
                 }
             }
         } else {
             if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                 $product_image_path = PRODUCT_DEFAULT_IMAGE;
             }
         }
         if ($product_image_path) {
             $thumbUrl = RedShopHelperImages::getImagePath($product_image_path, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
             $product_image = "<div  class='product_image'><img src='" . $thumbUrl . "'></div>";
         } else {
             $product_image = "<div  class='product_image'></div>";
         }
         $cart_mdata = str_replace("{product_name}", $product_name, $cart_mdata);
         $cart_mdata = str_replace("{product_s_desc}", $product->product_s_desc, $cart_mdata);
         $cart_mdata = str_replace("{product_thumb_image}", $product_image, $cart_mdata);
         $product_note = "<div class='product_note'>" . $wrapper_name . "</div>";
         $cart_mdata = str_replace("{product_wrapper}", $product_note, $cart_mdata);
         $product_userfields = $quotationHelper->displayQuotationUserfield($rowitem[$i]->quotation_item_id, 12);
         $cart_mdata = str_replace("{product_userfields}", $product_userfields, $cart_mdata);
         $cart_mdata = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $cart_mdata);
         $cart_mdata = str_replace("{product_number}", $product->product_number, $cart_mdata);
         $cart_mdata = str_replace("{product_attribute}", $producthelper->makeAttributeQuotation($rowitem[$i]->quotation_item_id, 0, $rowitem[$i]->product_id, $row->quotation_status), $cart_mdata);
         $cart_mdata = str_replace("{product_accessory}", $producthelper->makeAccessoryQuotation($rowitem[$i]->quotation_item_id, $row->quotation_status), $cart_mdata);
         // ProductFinderDatepicker Extra Field Start
         $cart_mdata = $producthelper->getProductFinderDatepickerValue($cart_mdata, $product_id, $fieldArray);
         // ProductFinderDatepicker Extra Field End
         if ($row->quotation_status == 1 && !SHOW_QUOTATION_PRICE) {
             $cart_mdata = str_replace("{product_price_excl_vat}", "", $cart_mdata);
             $cart_mdata = str_replace("{product_price}", " ", $cart_mdata);
             $cart_mdata = str_replace("{product_total_price}", " ", $cart_mdata);
             $cart_mdata = str_replace("{product_subtotal_excl_vat}", " ", $cart_mdata);
         } else {
             $cart_mdata = str_replace("{product_price_excl_vat}", $product_price_excl_vat, $cart_mdata);
             $cart_mdata = str_replace("{product_price}", $product_price, $cart_mdata);
             $cart_mdata = str_replace("{product_total_price}", $product_total_price, $cart_mdata);
             $cart_mdata = str_replace("{product_subtotal_excl_vat}", $product_total_price_excl_vat, $cart_mdata);
         }
         $cart_mdata = str_replace("{product_quantity}", $product_quantity, $cart_mdata);
         $cart .= $cart_mdata;
     }
     $message = $template_start . $cart . $template_end;
     $search[] = "{quotation_note}";
     $replace[] = $row->quotation_note;
     $search[] = "{shopname}";
     $replace[] = SHOP_NAME;
     $search[] = "{quotation_id}";
     $replace[] = $row->quotation_id;
     $search[] = "{quotation_number}";
     $replace[] = $row->quotation_number;
     $search[] = "{quotation_date}";
     $replace[] = $redconfig->convertDateFormat($row->quotation_cdate);
     $search[] = "{quotation_status}";
     $replace[] = $quotationHelper->getQuotationStatusName($row->quotation_status);
     $billadd = '';
     if ($row->user_id != 0) {
         $message = $this->_carthelper->replaceBillingAddress($message, $row);
     } else {
         if ($row->quotation_email != "") {
             $billadd .= JText::_("COM_REDSHOP_EMAIL") . ' : ' . $row->quotation_email . '<br />';
         }
         $message = str_replace("{billing_address_information_lbl}", JText::_('COM_REDSHOP_BILLING_ADDRESS_INFORMATION_LBL'), $message);
         if (strstr($message, "{quotation_custom_field_list}")) {
             $billadd .= $extra_field->list_all_field_display(16, $row->user_info_id, 1, $row->quotation_email);
             $message = str_replace("{quotation_custom_field_list}", "", $message);
         } else {
             $message = $extra_field->list_all_field_display(16, $row->user_info_id, 1, $row->quotation_email, $message);
         }
     }
     $search[] = "{billing_address}";
     $replace[] = $billadd;
     $total_lbl = '';
     $subtotal_lbl = '';
     $vat_lbl = '';
     if ($row->quotation_status != 1 || $row->quotation_status == 1 && SHOW_QUOTATION_PRICE) {
         $total_lbl = JText::_('COM_REDSHOP_TOTAL_LBL');
         $subtotal_lbl = JText::_('COM_REDSHOP_QUOTATION_SUBTOTAL');
         $vat_lbl = JText::_('COM_REDSHOP_QUOTATION_VAT');
     }
     $message = str_replace('{total_lbl}', $total_lbl, $message);
     $message = str_replace('{quotation_subtotal_lbl}', $subtotal_lbl, $message);
     $message = str_replace('{quotation_vat_lbl}', $vat_lbl, $message);
     $message = $this->_carthelper->replaceLabel($message);
     $search[] = "{quotation_note}";
     $replace[] = $row->quotation_note;
     if ($row->quotation_status == 1 && !SHOW_QUOTATION_PRICE) {
         $quotation_subtotal = " ";
         $quotation_total = " ";
         $quotation_discount = " ";
         $quotation_vat = " ";
         $quotation_subtotal_excl_vat = "";
     } else {
         $tax = $row->quotation_tax;
         if (VAT_RATE_AFTER_DISCOUNT) {
             $Discountvat = VAT_RATE_AFTER_DISCOUNT * $row->quotation_discount / (1 + VAT_RATE_AFTER_DISCOUNT);
             $row->quotation_discount = $row->quotation_discount - $Discountvat;
             $tax = $tax - $Discountvat;
         }
         if (VAT_RATE_AFTER_DISCOUNT) {
             $sp_discount = $row->quotation_special_discount * ($row->quotation_subtotal + $row->quotation_tax) / 100;
             $Discountspvat = $sp_discount * VAT_RATE_AFTER_DISCOUNT / (1 + VAT_RATE_AFTER_DISCOUNT);
             $DiscountspWithotVat = $sp_discount - $Discountspvat;
             $row->quotation_discount = $row->quotation_discount + $DiscountspWithotVat;
             $tax = $tax - $Discountspvat;
         }
         $quotation_subtotal_excl_vat = $producthelper->getProductFormattedPrice($row->quotation_subtotal);
         $quotation_subtotal_minus_discount = $producthelper->getProductFormattedPrice($row->quotation_subtotal - $row->quotation_discount);
         $quotation_subtotal = $producthelper->getProductFormattedPrice($row->quotation_subtotal);
         $quotation_total = $producthelper->getProductFormattedPrice($row->quotation_total);
         $quotation_discount = $producthelper->getProductFormattedPrice($row->quotation_discount);
         $quotation_vat = $producthelper->getProductFormattedPrice($row->quotation_tax);
     }
     $search[] = "{quotation_subtotal}";
     $replace[] = $quotation_subtotal;
     $search[] = "{quotation_total}";
     $replace[] = $quotation_total;
     $search[] = "{quotation_subtotal_minus_discount}";
     $replace[] = $quotation_subtotal_minus_discount;
     $search[] = "{quotation_subtotal_excl_vat}";
     $replace[] = $quotation_subtotal_excl_vat;
     $search[] = "{quotation_discount}";
     $replace[] = $quotation_discount;
     $search[] = "{quotation_vat}";
     $replace[] = $quotation_vat;
     $quotationdetailurl = JURI::root() . 'index.php?option=com_redshop&view=quotation_detail&quoid=' . $quotation_id . '&encr=' . $row->quotation_encrkey;
     $search[] = "{quotation_detail_link}";
     $replace[] = "<a href='" . $quotationdetailurl . "'>" . JText::_("COM_REDSHOP_QUOTATION_DETAILS") . "</a>";
     $message = str_replace($search, $replace, $message);
     $message = $this->imginmail($message);
     $email = $row->quotation_email;
     // Set the e-mail parameters
     $from = $config->getValue('mailfrom');
     $fromname = $config->getValue('fromname');
     $body = $message;
     $subject = str_replace($search, $replace, $subject);
     // Send the e-mail
     if ($email != "") {
         $bcc = null;
         if (trim(ADMINISTRATOR_EMAIL) != '') {
             $bcc = explode(",", trim(ADMINISTRATOR_EMAIL));
         }
         $bcc = array_merge($bcc, $mailbcc);
         if (!JUtility::sendMail($from, $fromname, $email, $subject, $body, 1, null, $bcc)) {
             $this->setError('ERROR_SENDING_QUOTATION_MAIL');
         }
     }
     if ($status != 0) {
         $quotationHelper->updateQuotationStatus($quotation_id, $status);
     }
     return true;
 }
Exemplo n.º 16
0
 public function newsletterEntry($cid = array(), $userid = array(), $username = array())
 {
     $producthelper = new producthelper();
     $jconfig = new jconfig();
     $db = JFactory::getDbo();
     $newsletter_id = JRequest::getVar('newsletter_id');
     $uri = JURI::getInstance();
     $url = $uri->root();
     $mailfrom = $jconfig->mailfrom;
     $fromname = $jconfig->fromname;
     if (NEWS_MAIL_FROM != "") {
         $mailfrom = NEWS_MAIL_FROM;
     }
     if (NEWS_FROM_NAME != "") {
         $fromname = NEWS_FROM_NAME;
     }
     // Getting newsletter content
     $newsbody = $this->getnewsletter_content($newsletter_id);
     $subject = "";
     $newsletter_body = "";
     $newsletter_template = "";
     if (count($newsbody) > 0) {
         $subject = $newsbody[0]->subject;
         $newsletter_body = $newsbody[0]->body;
         $newsletter_template = $newsbody[0]->template_desc;
     }
     $o = new stdClass();
     $o->text = $newsletter_body;
     JPluginHelper::importPlugin('content');
     $dispatcher = JDispatcher::getInstance();
     $x = array();
     $results = $dispatcher->trigger('onPrepareContent', array(&$o, &$x, 1));
     $newsletter_template2 = $o->text;
     $content = str_replace("{data}", $newsletter_template2, $newsletter_template);
     $product_id_list = $this->getProductIdList();
     for ($i = 0; $i < count($product_id_list); $i++) {
         $product_id = $product_id_list[$i]->product_id;
         if (strstr($content, '{redshop:' . $product_id . '}')) {
             $content = str_replace('{redshop:' . $product_id . '}', "", $content);
         }
         if (strstr($content, '{Newsletter Products:' . $product_id . '}')) {
             $product_id = $product_id_list[$i]->product_id;
             $newsproductbody = $this->getnewsletterproducts_content();
             $np_temp_desc = $newsproductbody[0]->template_desc;
             $thum_image = "";
             if ($product_id_list[$i]->product_full_image) {
                 $thumbUrl = RedShopHelperImages::getImagePath($product_id_list[$i]->product_full_image, '', 'thumb', 'product', PRODUCT_MAIN_IMAGE, PRODUCT_MAIN_IMAGE, USE_IMAGE_SIZE_SWAPPING);
                 $thum_image = "<a id='a_main_image' href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $product_id_list[$i]->product_full_image . "' title='' rel=\"lightbox[product7]\">";
                 $thum_image .= "<img id='main_image' src='" . $thumbUrl . "'>";
                 $thum_image .= "</a>";
             }
             $np_temp_desc = str_replace("{product_thumb_image}", $thum_image, $np_temp_desc);
             $np_temp_desc = str_replace("{product_price}", $producthelper->getProductFormattedPrice($product_id_list[$i]->product_price), $np_temp_desc);
             $np_temp_desc = str_replace("{product_name}", $product_id_list[$i]->product_name, $np_temp_desc);
             $np_temp_desc = str_replace("{product_desc}", $product_id_list[$i]->product_desc, $np_temp_desc);
             $np_temp_desc = str_replace("{product_s_desc}", $product_id_list[$i]->product_s_desc, $np_temp_desc);
             $content = str_replace("{Newsletter Products:" . $product_id . "}", $np_temp_desc, $content);
         }
     }
     // Replacing the Text library texts
     $texts = new text_library();
     $content = $texts->replace_texts($content);
     // If the template contains the images, then revising the path of the images,
     // So the full URL goes with the mail, so images are visible in the mails.
     $data1 = $data = $content;
     preg_match_all("/\\< *[img][^\\>]*[.]*\\>/i", $data, $matches);
     $imagescurarray = array();
     foreach ($matches[0] as $match) {
         preg_match_all("/(src|height|width)*= *[\"\\']{0,1}([^\"\\'\\ \\>]*)/i", $match, $m);
         $images[] = array_combine($m[1], $m[2]);
         $imagescur = array_combine($m[1], $m[2]);
         $imagescurarray[] = $imagescur['src'];
     }
     $imagescurarray = array_unique($imagescurarray);
     if ($imagescurarray) {
         foreach ($imagescurarray as $change) {
             if (strpos($change, 'http') === false) {
                 $data1 = str_replace($change, $url . $change, $data1);
             }
         }
     }
     $retsubscriberid = array();
     for ($j = 0; $j < count($cid); $j++) {
         $subscriberinfo = $this->subscribersinfo($cid[$j]);
         if (count($subscriberinfo) > 0) {
             $today = time();
             $subscribe_email = trim($subscriberinfo[0]->email);
             $unsub_link = $url . 'index.php?option=com_redshop&view=newsletter&task=unsubscribe&email1=' . $subscribe_email;
             $query = "INSERT INTO `" . $this->_table_prefix . "newsletter_tracker` " . "(`tracker_id`, `newsletter_id`, `subscription_id`, `subscriber_name`, `user_id` , `read`, `date`)  " . "VALUES ('', '" . $newsletter_id . "', '" . $cid[$j] . "', '" . $username[$j] . "', '" . $userid[$j] . "',0, '" . $today . "')";
             $db->setQuery($query);
             $db->query();
             $content = '<img  src="' . $url . 'components/com_redshop/helpers/newsletteropener.php?tracker_id=' . $db->insertid() . '" style="display:none;" />';
             // Replacing the tags with the values
             $content .= str_replace("{username}", $subscriberinfo[0]->username, $data1);
             $content = str_replace("{email}", $subscribe_email, $content);
             $unsubscriberlink = "<a href='" . $unsub_link . "'>" . JText::_('COM_REDSHOP_UNSUBSCRIBE') . "</a>";
             $content = str_replace("{unsubscribe_link}", $unsubscriberlink, $content);
             $message = $content;
             if ($subscribe_email != "") {
                 if (JUtility::sendMail($mailfrom, $fromname, $subscribe_email, $subject, $message, 1)) {
                     $retsubscriberid[$j] = 1;
                 } else {
                     $retsubscriberid[$j] = 0;
                 }
             }
         }
     }
     return $retsubscriberid;
 }
Exemplo n.º 17
0
 }
 $link = JRoute::_('index.php?option=' . $option . '&view=product&pid=' . $row->product_id . '&cid=' . $category_id . '&Itemid=' . $Itemid);
 if ($vertical_product) {
     echo "<div class='mod_redshop_products'>";
 } else {
     echo "<div class='mod_redshop_products_horizontal'>";
 }
 echo "<div class='mod_redshop_products_outer'><div class='mod_redshop_products_inner'>";
 $productInfo = $producthelper->getProductById($row->product_id);
 if ($image) {
     $thumb = $productInfo->product_full_image;
     if (WATERMARK_PRODUCT_IMAGE) {
         $thum_image = $redhelper->watermark('product', $thumb, $thumbwidth, $thumbheight, WATERMARK_PRODUCT_THUMB_IMAGE, '0');
         echo "<div class='mod_redshop_products_image'><img src=" . $thum_image . "></div>";
     } else {
         $thum_image = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', $thumbwidth, $thumbheight, USE_IMAGE_SIZE_SWAPPING);
         echo "<div class='mod_redshop_products_image'><a href='" . $link . "' title='{$row->product_name}'><img src=" . $thum_image . "></a></div>";
     }
 }
 if (!empty($stock_status)) {
     echo $stock_status;
 }
 if (!$row->not_for_sale && $show_price) {
     $productArr = $producthelper->getProductNetPrice($row->product_id);
     if ($show_vat != '0') {
         $product_price = $productArr['product_old_price'];
         $product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
     } else {
         $product_price = $productArr['product_old_price_excl_vat'];
         $product_price_discount = $productArr['productPrice'];
     }
Exemplo n.º 18
0
 public function repalceOrderItems($data, $rowitem = array())
 {
     JPluginHelper::importPlugin('redshop_product');
     $dispatcher = JDispatcher::getInstance();
     $mainview = JRequest::getVar('view');
     $fieldArray = $this->_extraFieldFront->getSectionFieldList(17, 0, 0);
     $subtotal_excl_vat = 0;
     $cart = '';
     $url = JURI::root();
     $returnArr = array();
     $wrapper_name = "";
     $OrdersDetail = $this->_order_functions->getOrderDetails($rowitem[0]->order_id);
     for ($i = 0; $i < count($rowitem); $i++) {
         $product_id = $rowitem[$i]->product_id;
         $quantity = $rowitem[$i]->product_quantity;
         if ($rowitem[$i]->is_giftcard) {
             $giftcardData = $this->_producthelper->getGiftcardData($product_id);
             $product_name = $giftcardData->giftcard_name;
             $userfield_section = 13;
         } else {
             $product = $this->_producthelper->getProductById($product_id);
             $product_name = $product->product_name;
             $userfield_section = 12;
         }
         $dirname = JPATH_COMPONENT_SITE . "/assets/images/orderMergeImages/" . $rowitem[$i]->attribute_image;
         if (is_file($dirname)) {
             $attribute_image_path = RedShopHelperImages::getImagePath($rowitem[$i]->attribute_image, '', 'thumb', 'orderMergeImages', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
             $attrib_img = "<img src='" . $attribute_image_path . "'>";
         } else {
             if (is_file(JPATH_COMPONENT_SITE . "/assets/images/product_attributes/" . $rowitem[$i]->attribute_image)) {
                 $attribute_image_path = RedShopHelperImages::getImagePath($rowitem[$i]->attribute_image, '', 'thumb', 'product_attributes', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                 $attrib_img = "<img src='" . $attribute_image_path . "'>";
             } else {
                 if ($product->product_full_image) {
                     if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) {
                         $attribute_image_path = RedShopHelperImages::getImagePath($product->product_full_image, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                         $attrib_img = "<img src='" . $attribute_image_path . "'>";
                     } else {
                         if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                             $attribute_image_path = RedShopHelperImages::getImagePath(PRODUCT_DEFAULT_IMAGE, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                             $attrib_img = "<img src='" . $attribute_image_path . "'>";
                         }
                     }
                 } else {
                     if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                         $attribute_image_path = RedShopHelperImages::getImagePath(PRODUCT_DEFAULT_IMAGE, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                         $attrib_img = "<img src='" . $attribute_image_path . "'>";
                     }
                 }
             }
         }
         $dispatcher->trigger('changeCartOrderItemImage', array(&$data, &$attrib_img, $rowitem[$i], $i));
         $product_name = "<div class='product_name'>" . $product_name . "</div>";
         $product_total_price = "<div class='product_price'>";
         if (!$this->_producthelper->getApplyVatOrNot($data)) {
             $product_total_price .= $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_price_excl_vat * $quantity);
         } else {
             $product_total_price .= $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_price * $quantity);
         }
         $product_total_price .= "</div>";
         $product_price = "<div class='product_price'>";
         if (!$this->_producthelper->getApplyVatOrNot($data)) {
             $product_price .= $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_price_excl_vat);
         } else {
             $product_price .= $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_price);
         }
         $product_price .= "</div>";
         $product_old_price = $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_old_price);
         $product_quantity = '<div class="update_cart">' . $quantity . '</div>';
         if ($rowitem[$i]->wrapper_id) {
             $wrapper = $this->_producthelper->getWrapper($product_id, $rowitem[$i]->wrapper_id);
             if (count($wrapper) > 0) {
                 $wrapper_name = $wrapper[0]->wrapper_name;
             }
             $wrapper_price = $this->_producthelper->getProductFormattedPrice($rowitem[$i]->wrapper_price);
             $wrapper_name = JText::_('COM_REDSHOP_WRAPPER') . ": " . $wrapper_name . "(" . $wrapper_price . ")";
         }
         $cart_mdata = str_replace("{product_name}", $product_name, $data);
         $catId = $this->_producthelper->getCategoryProduct($product_id);
         $res = $this->_producthelper->getSection("category", $catId);
         if (count($res) > 0) {
             $cname = $res->category_name;
             $clink = JRoute::_($url . 'index.php?option=com_redshop&view=category&layout=detail&cid=' . $catId);
         }
         $category_path = "<a href='" . $clink . "'>" . $cname . "</a>";
         $cart_mdata = str_replace("{category_name}", $category_path, $cart_mdata);
         $cart_mdata = $this->_producthelper->replaceVatinfo($cart_mdata);
         $product_note = "<div class='product_note'>" . $wrapper_name . "</div>";
         $cart_mdata = str_replace("{product_wrapper}", $product_note, $cart_mdata);
         // Make attribute order template output
         $attribute_data = $this->_producthelper->makeAttributeOrder($rowitem[$i]->order_item_id, 0, $product_id, 0, 0, $data);
         // Assign template output into {product_attribute} tag
         $cart_mdata = str_replace("{product_attribute}", $attribute_data->product_attribute, $cart_mdata);
         // Assign template output into {attribute_middle_template} tag
         $cart_mdata = str_replace($attribute_data->attribute_middle_template_core, $attribute_data->attribute_middle_template, $cart_mdata);
         if (strstr($cart_mdata, '{remove_product_attribute_title}')) {
             $cart_mdata = str_replace("{remove_product_attribute_title}", "", $cart_mdata);
         }
         if (strstr($cart_mdata, '{remove_product_subattribute_title}')) {
             $cart_mdata = str_replace("{remove_product_subattribute_title}", "", $cart_mdata);
         }
         if (strstr($cart_mdata, '{product_attribute_number}')) {
             $cart_mdata = str_replace("{product_attribute_number}", "", $cart_mdata);
         }
         $cart_mdata = str_replace("{product_accessory}", $this->_producthelper->makeAccessoryOrder($rowitem[$i]->order_item_id), $cart_mdata);
         $product_userfields = $this->_producthelper->getuserfield($rowitem[$i]->order_item_id, $userfield_section);
         $cart_mdata = str_replace("{product_userfields}", $product_userfields, $cart_mdata);
         $user_custom_fields = $this->_producthelper->GetProdcutfield_order($rowitem[$i]->order_item_id);
         $cart_mdata = str_replace("{product_customfields}", $user_custom_fields, $cart_mdata);
         $cart_mdata = str_replace("{product_customfields_lbl}", JText::_("COM_REDSHOP_PRODUCT_CUSTOM_FIELD"), $cart_mdata);
         $cart_mdata = str_replace("{product_sku}", $product->product_number, $cart_mdata);
         $cart_mdata = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $cart_mdata);
         $cart_mdata = str_replace("{product_number}", $product->product_number, $cart_mdata);
         $product_vat = ($rowitem[$i]->product_item_price - $rowitem[$i]->product_item_price_excl_vat) * $rowitem[$i]->product_quantity;
         $cart_mdata = str_replace("{product_vat}", $product_vat, $cart_mdata);
         $cart_mdata = str_replace("{product_s_desc}", $product->product_s_desc, $cart_mdata);
         $cart_mdata = $this->_producthelper->getProductOnSaleComment($product, $cart_mdata);
         $cart_mdata = str_replace("{attribute_price_without_vat}", '', $cart_mdata);
         $cart_mdata = str_replace("{attribute_price_with_vat}", '', $cart_mdata);
         // ProductFinderDatepicker Extra Field Start
         $cart_mdata = $this->_producthelper->getProductFinderDatepickerValue($cart_mdata, $product_id, $fieldArray);
         $cart_mdata = str_replace("{product_thumb_image}", "<div  class='product_image'>" . $attrib_img . "</div>", $cart_mdata);
         $cart_mdata = str_replace("{product_price}", $product_price, $cart_mdata);
         $cart_mdata = str_replace("{product_old_price}", $product_old_price, $cart_mdata);
         $cart_mdata = str_replace("{product_quantity}", $quantity, $cart_mdata);
         $cart_mdata = str_replace("{product_total_price}", $product_total_price, $cart_mdata);
         $cart_mdata = str_replace("{product_price_excl_vat}", $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_price_excl_vat), $cart_mdata);
         $cart_mdata = str_replace("{product_total_price_excl_vat}", $this->_producthelper->getProductFormattedPrice($rowitem[$i]->product_item_price_excl_vat * $quantity), $cart_mdata);
         $subtotal_excl_vat += $rowitem[$i]->product_item_price_excl_vat * $quantity;
         if ($product->product_type == 'subscription') {
             $user_subscribe_detail = $this->_producthelper->getUserProductSubscriptionDetail($rowitem[$i]->order_item_id);
             $subscription_detail = $this->_producthelper->getProductSubscriptionDetail($product->product_id, $user_subscribe_detail->subscription_id);
             $selected_subscription = $subscription_detail->subscription_period . " " . $subscription_detail->period_type;
             $cart_mdata = str_replace("{product_subscription_lbl}", JText::_('COM_REDSHOP_SUBSCRIPTION'), $cart_mdata);
             $cart_mdata = str_replace("{product_subscription}", $selected_subscription, $cart_mdata);
         } else {
             $cart_mdata = str_replace("{product_subscription_lbl}", "", $cart_mdata);
             $cart_mdata = str_replace("{product_subscription}", "", $cart_mdata);
         }
         if ($mainview == "order_detail") {
             $Itemid = JRequest::getVar('Itemid');
             $Itemid = $this->_redhelper->getCartItemid();
             $copytocart = "<a href='" . JRoute::_('index.php?option=com_redshop&view=order_detail&task=copyorderitemtocart&order_item_id=' . $rowitem[$i]->order_item_id . '&Itemid=' . $Itemid, false) . "'>";
             $copytocart .= "<img src='" . REDSHOP_ADMIN_IMAGES_ABSPATH . "add.jpg' title='" . JText::_("COM_REDSHOP_COPY_TO_CART") . "' alt='" . JText::_("COM_REDSHOP_COPY_TO_CART") . "' /></a>";
             $cart_mdata = str_replace("{copy_orderitem}", $copytocart, $cart_mdata);
         } else {
             $cart_mdata = str_replace("{copy_orderitem}", "", $cart_mdata);
         }
         // Get Downloadable Products
         $downloadProducts = $this->_order_functions->getDownloadProduct($rowitem[$i]->order_id);
         $totalDownloadProduct = count($downloadProducts);
         $dproducts = array();
         for ($t = 0; $t < $totalDownloadProduct; $t++) {
             $downloadProduct = $downloadProducts[$t];
             $dproducts[$downloadProduct->product_id][$downloadProduct->download_id] = $downloadProduct;
         }
         // Get Downloadable Products Logs
         $downloadProductslog = $this->_order_functions->getDownloadProductLog($rowitem[$i]->order_id);
         $totalDownloadProductlog = count($downloadProductslog);
         $dproductslog = array();
         for ($t = 0; $t < $totalDownloadProductlog; $t++) {
             $downloadProductlogs = $downloadProductslog[$t];
             $dproductslog[$downloadProductlogs->product_id][] = $downloadProductlogs;
         }
         // Download Product Tag Replace
         if (isset($dproducts[$product_id]) && count($dproducts[$product_id]) > 0 && $OrdersDetail->order_status == "C" && $OrdersDetail->order_payment_status == "Paid") {
             $downloadarray = $dproducts[$product_id];
             $dpData = "<table class='download_token'>";
             $limit = $dpData;
             $enddate = $dpData;
             $g = 1;
             foreach ($downloadarray as $downloads) {
                 $file_name = substr(basename($downloads->file_name), 11);
                 $product_name = $downloadProduct->product_name;
                 $download_id = $downloads->download_id;
                 $download_max = $downloads->download_max;
                 $end_date = $downloads->end_date;
                 $mailtoken = "<a href='" . JUri::root() . "index.php?option=com_redshop&view=product&layout=downloadproduct&tid=" . $download_id . "'>" . $file_name . "</a>";
                 $dpData .= "</tr>";
                 $dpData .= "<td>(" . $g . ") " . $product_name . ": " . $mailtoken . "</td>";
                 $dpData .= "</tr>";
                 $limit .= "</tr>";
                 $limit .= "<td>(" . $g . ") " . $download_max . "</td>";
                 $limit .= "</tr>";
                 $enddate .= "</tr>";
                 $enddate .= "<td>(" . $g . ") " . date("d-m-Y H:i", $end_date) . "</td>";
                 $enddate .= "</tr>";
                 $g++;
             }
             $dpData .= "</table>";
             $limit .= "</table>";
             $enddate .= "</table>";
             $cart_mdata = str_replace("{download_token_lbl}", JText::_('COM_REDSHOP_DOWNLOAD_TOKEN'), $cart_mdata);
             $cart_mdata = str_replace("{download_token}", $dpData, $cart_mdata);
             $cart_mdata = str_replace("{download_counter_lbl}", JText::_('COM_REDSHOP_DOWNLOAD_LEFT'), $cart_mdata);
             $cart_mdata = str_replace("{download_counter}", $limit, $cart_mdata);
             $cart_mdata = str_replace("{download_date_lbl}", JText::_('COM_REDSHOP_DOWNLOAD_ENDDATE'), $cart_mdata);
             $cart_mdata = str_replace("{download_date}", $enddate, $cart_mdata);
         } else {
             $cart_mdata = str_replace("{download_token_lbl}", "", $cart_mdata);
             $cart_mdata = str_replace("{download_token}", "", $cart_mdata);
             $cart_mdata = str_replace("{download_counter_lbl}", "", $cart_mdata);
             $cart_mdata = str_replace("{download_counter}", "", $cart_mdata);
             $cart_mdata = str_replace("{download_date_lbl}", "", $cart_mdata);
             $cart_mdata = str_replace("{download_date}", "", $cart_mdata);
         }
         // Download Product log Tags Replace
         if (isset($dproductslog[$product_id]) && count($dproductslog[$product_id]) > 0 && $OrdersDetail->order_status == "C") {
             $downloadarraylog = $dproductslog[$product_id];
             $dpData = "<table class='download_token'>";
             $g = 1;
             foreach ($downloadarraylog as $downloads) {
                 $file_name = substr(basename($downloads->file_name), 11);
                 $download_id = $downloads->download_id;
                 $download_time = $downloads->download_time;
                 $download_date = date("d-m-Y H:i:s", $download_time);
                 $ip = $downloads->ip;
                 $mailtoken = "<a href='" . JUri::root() . "index.php?option=com_redshop&view=product&layout=downloadproduct&tid=" . $download_id . "'>" . $file_name . "</a>";
                 $dpData .= "</tr>";
                 $dpData .= "<td>(" . $g . ") " . $mailtoken . " " . JText::_('COM_REDSHOP_ON') . " " . $download_date . " " . JText::_('COM_REDSHOP_FROM') . " " . $ip . "</td>";
                 $dpData .= "</tr>";
                 $g++;
             }
             $dpData .= "</table>";
             $cart_mdata = str_replace("{download_date_list_lbl}", JText::_('COM_REDSHOP_DOWNLOAD_LOG'), $cart_mdata);
             $cart_mdata = str_replace("{download_date_list}", $dpData, $cart_mdata);
         } else {
             $cart_mdata = str_replace("{download_date_list_lbl}", "", $cart_mdata);
             $cart_mdata = str_replace("{download_date_list}", "", $cart_mdata);
         }
         // Process the product plugin for cart item
         $dispatcher->trigger('onOrderItemDisplay', array(&$cart_mdata, &$rowitem, $i));
         $cart .= $cart_mdata;
     }
     $returnArr[0] = $cart;
     $returnArr[1] = $subtotal_excl_vat;
     return $returnArr;
 }
Exemplo n.º 19
0
     $product_image_path = "";
     if ($product->product_full_image) {
         if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) {
             $product_image_path = $product->product_full_image;
         } else {
             if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                 $product_image_path = PRODUCT_DEFAULT_IMAGE;
             }
         }
     } else {
         if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
             $product_image_path = PRODUCT_DEFAULT_IMAGE;
         }
     }
     if ($product_image_path) {
         $thumbUrl = RedShopHelperImages::getImagePath($product_image_path, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
         $product_image = "<div class='product_image'><img src='" . $thumbUrl . "'></div>";
     } else {
         $product_image = "<div class='product_image'></div>";
     }
 }
 $product_name = "<div class='product_name'>" . $quotationProducts[$i]->product_name . "</div>";
 $product_note = "<div  class='product_note'>" . $wrapper_name . "</div>";
 $product_price = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($quotationProducts[$i]->product_price) . "</div>";
 $product_excl_price = "<div class='product_excl_price'>" . $producthelper->getProductFormattedPrice($quotationProducts[$i]->product_excl_price) . "</div>";
 $product_quantity = '<div class="product_quantity">' . $quotationProducts[$i]->product_quantity . '</div>';
 $product_total_price = $quotationProducts[$i]->product_quantity * $quotationProducts[$i]->product_price;
 $product_total_excl_price = $quotationProducts[$i]->product_quantity * $quotationProducts[$i]->product_excl_price;
 $cart_mdata = str_replace("{product_thumb_image}", $product_image, $cart_mdata);
 $cart_mdata = str_replace("{product_name}", $product_name, $cart_mdata);
 $cart_mdata = str_replace("{product_s_desc}", $product->product_s_desc, $cart_mdata);
Exemplo n.º 20
0
        /**
         * Display Product Data
         */
        function displayredManufacturer($limit = 0)
        {
            $uri = JUri::getInstance();
            $url = $uri->root();
            $database = JFactory::getDbo();
            $Itemid = JRequest::getInt('Itemid', 0);
            $extra_data = new producthelper();
            $document = JFactory::getDocument();
            JHTML::Script('jquery-1.js', 'modules/mod_redmanufacturer/js/', false);
            JHTML::Script('jquery.js', 'modules/mod_redmanufacturer/js/', false);
            JHTML::Stylesheet('jquery.css', 'modules/mod_redmanufacturer/css/');
            echo $this->params->get('pretext', "");
            $qlimit = "";
            if ($limit > 0) {
                $qlimit = "LIMIT {$limit}";
            }
            $query = "SELECT m.media_name,ma.manufacturer_name,ma.manufacturer_id FROM #__redshop_manufacturer as ma " . "LEFT JOIN #__redshop_media AS m ON m.`section_id`=ma.manufacturer_id " . "WHERE m.media_section='manufacturer' " . "AND m.published=1 " . "AND ma.published=1 " . $qlimit;
            $database->setQuery($query);
            $rows = $database->loadObjectList();
            ?>

	<script type="text/javascript">
		var dom1 = {};
		dom1.query = jQuery.noConflict(true);
		var mycarousel_itemList = [
			<?php 
            for ($i = 0; $i < count($rows); $i++) {
                $thumbUrl = RedShopHelperImages::getImagePath($rows[$i]->media_name, '', 'thumb', 'manufacturer', $this->ImageWidth, $this->ImageHeight, USE_IMAGE_SIZE_SWAPPING);
                ?>
			{url: "<?php 
                echo $thumbUrl;
                ?>
", title: '<?php 
                echo $rows[$i]->manufacturer_name;
                ?>
', ahref: '<a href="<?php 
                echo JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=' . $this->PageLink . '&mid=' . $rows[$i]->manufacturer_id . '&Itemid=' . $Itemid);
                ?>
"  title="<?php 
                echo $rows[$i]->manufacturer_name;
                ?>
">'}
			<?php 
                if ($i < count($rows) - 1) {
                    ?>
			,
			<?php 
                }
            }
            ?>
		];

		function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt) {
			// The index() method calculates the index from a
			// given index who is out of the actual item range.

			var idx = carousel.index(i, mycarousel_itemList.length);
			carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
		}
		;

		function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt) {
			carousel.remove(i);
		}
		;

		/**
		 * Item html creation helper.
		 */
		function mycarousel_getItemHTML(item) {
			var displayItem = '';
			<?php 
            if ($this->show_image == 1) {
                ?>
			displayItem = displayItem + item.ahref + '<img src="' + item.url + '" width="<?php 
                echo $this->ImageWidth;
                ?>
" height="<?php 
                echo $this->ImageHeight;
                ?>
" alt="' + item.title + '" /></a><br/>';
			<?php 
            }
            if ($this->show_link_on_product_name == 1) {
                ?>
			displayItem = displayItem + item.ahref;

			<?php 
            }
            if ($this->show_product_name == 1) {
                ?>
			displayItem = displayItem + '<div align="center">' + item.title + '</div>';
			<?php 
            }
            if ($this->show_link_on_product_name == 1) {
                ?>
			displayItem = displayItem + '</a>';

			<?php 
            }
            ?>

			return displayItem;
		}
		;

		function mycarousel_initCallback(carousel, item, i, state, evt) {
			var idx = carousel.index(i, mycarousel_itemList.length);
			carousel.startAuto(idx);
		}
		;

		dom1.query(function () {
			dom1.query('#mycarousel').jcarousel({
				wrap: '<?php 
            echo $this->ScrollWrap;
            ?>
',
				scroll:<?php 
            echo $this->ScrollBehavior;
            ?>
,
				auto:<?php 
            echo $this->ScrollAuto;
            ?>
,
				animation: '<?php 
            echo $this->ScrollDelay;
            ?>
',
				vertical:<?php 
            echo $this->ScrollDirection;
            ?>
,
				itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
				itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},
				itemLastOutCallback: mycarousel_initCallback
			});
		});
	</script>
	<style type="text/css">
		.jcarousel-skin-tango .jcarousel-container {

		}

		.jcarousel-skin-tango .jcarousel-container-horizontal {
			width: <?php 
            echo $this->ScrollWidth + 10;
            ?>
px; /* Default 140 Aspect 1 image */
			height: <?php 
            echo $this->ScrollHeight + 10;
            ?>
px; /* Default 140 Aspect 1 image */
			padding-top: 10px;
			padding-bottom: 10px;
			padding-left: 0px;
			padding-right: 0px;
		}

			/* For vertical scrolling */
		.jcarousel-skin-tango .jcarousel-container-vertical {
			width: <?php 
            echo $this->ScrollWidth + 10;
            ?>
px;
			height: <?php 
            echo $this->ScrollHeight + 10;
            ?>
px;
			padding: 10px 10px;

		}

		.jcarousel-skin-tango .jcarousel-clip-horizontal {
			width: <?php 
            echo $this->ScrollWidth;
            ?>
px; /* Default 130 Aspect 1 image change acording to params */
			height: <?php 
            echo $this->ScrollHeight;
            ?>
px; /* Default 120 Aspect 1 image change acording to params */

		}

			/* For vertical scrolling */
		.jcarousel-skin-tango .jcarousel-clip-vertical {
			width: <?php 
            echo $this->ScrollWidth;
            ?>
px;
			height: <?php 
            echo $this->ScrollHeight;
            ?>
px;
		}

		.jcarousel-skin-tango .jcarousel-item {

			padding: 5px;
			width: <?php 
            echo $this->ImageWidth;
            ?>
px; /* Default image width */
			height: <?php 
            echo $this->ImageHeight + 25;
            ?>
px; /* Default image height */
		<?php 
            if ($this->ImageBorder == 'yes') {
                ?>
 border: 1px solid;
		<?php 
            }
            ?>
		}

		.jcarousel-skin-tango .jcarousel-item:hover {
			background-position: 0px -90px;
			cursor: pointer;
		}

		.jcarousel-skin-tango .jcarousel-item-horizontal {
			margin-right: 20px;
		}

			/* For vertical scrolling */
		.jcarousel-skin-tango .jcarousel-item-vertical {
			margin-bottom: 20px;
		}

		.jcarousel-skin-tango .jcarousel-item-placeholder {
			color: #000;
		}

	</style>
	<div class="jcarousel-skin-tango">
		<div style="display: block;" class="jcarousel-container jcarousel-container-horizontal">
			<div>
				<ul id="mycarousel" class="jcarousel-list jcarousel-list-horizontal">
					<?php 
            for ($i = 0; $i < count($rows); $i++) {
                $thumbUrl = RedShopHelperImages::getImagePath($rows[$i]->media_name, '', 'thumb', 'manufacturer', 100, 100, USE_IMAGE_SIZE_SWAPPING);
                ?>
						<li jcarouselindex="<?php 
                echo $i + 31;
                ?>
"
						    class="jcarousel-item jcarousel-item-horizontal jcarousel-item-<?php 
                echo $i + 31;
                ?>
 jcarousel-item-<?php 
                echo $i + 31;
                ?>
-horizontal">
							<a href='<?php 
                echo $url;
                ?>
index.php?option=com_redshop&view=manufacturers&layout=<?php 
                echo $this->PageLink;
                ?>
&mid=<?php 
                echo $rows[$i]->manufacturer_id;
                ?>
&Itemid=<?php 
                echo $Itemid;
                ?>
'
							   title='<?php 
                echo $rows[$i]->manufacturer_name;
                ?>
'>
							   <img src='<?php 
                echo $thumbUrl;
                ?>
' alt='<?php 
                echo $rows[$i]->media_name;
                ?>
' width='100' height='100'>
							</a>
						</li>

					<?php 
            }
            ?>
				</ul>

			</div>
		</div>
	</div>
<?php 
        }
Exemplo n.º 21
0
                    echo $g;
                    ?>
_subproperty_<?php 
                    echo $sp;
                    ?>
_image"
														       value="<?php 
                    echo $subvalue->subattribute_color_image;
                    ?>
">

													</td>
													<td class="td3" align="left">
														<?php 
                    if ($subvalue->subattribute_color_image != "" && is_file($impathphy)) {
                        $thumbUrl = RedShopHelperImages::getImagePath($subvalue->subattribute_color_image, '', 'thumb', 'subcolor', 50, 0, 1);
                        ?>
														<span
															id="subproperty_image_<?php 
                        echo $subvalue->subattribute_color_id;
                        ?>
">
																<a class="modal"
																   rel="{handler: 'image', size: {}}"
																   title="<?php 
                        echo $subvalue->subattribute_color_image;
                        ?>
"
																   href="<?php 
                        echo REDSHOP_FRONT_IMAGES_ABSPATH . 'subcolor/' . $subvalue->subattribute_color_image;
                        ?>
Exemplo n.º 22
0
																															<span id="subproperty_image_<?php 
                        echo $subvalue->subattribute_color_id;
                        ?>
">
																																<a class="modal"
																																   rel="{handler: 'image', size: {}}"
																																   title="<?php 
                        echo $subvalue->subattribute_color_image;
                        ?>
"
																																   href="<?php 
                        echo REDSHOP_FRONT_IMAGES_ABSPATH . 'subcolor/' . $subvalue->subattribute_color_image;
                        ?>
">
																																   <?php 
                        $thumbUrl = RedShopHelperImages::getImagePath($subvalue->subattribute_color_image, '', 'thumb', 'subcolor', 50, 0, USE_IMAGE_SIZE_SWAPPING);
                        ?>
																																	<img id="subpropertyImage<?php 
                        echo $k . $z;
                        ?>
"
																																		 src='<?php 
                        echo $thumbUrl;
                        ?>
'
																																		 alt=''
																																		 title=''
																																		/>
																																</a>
																															</span>
																													</td>
Exemplo n.º 23
0
 $middledata = str_replace("{manufacturer_name}", $manu_name, $middledata);
 // Extra field display
 $middledata = $producthelper->getExtraSectionTag($extraFieldName, $row->manufacturer_id, "10", $middledata);
 if (strstr($middledata, $mimg_tag)) {
     $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 = $media_image[$m]->media_name;
             }
             if (WATERMARK_MANUFACTURER_IMAGE || WATERMARK_MANUFACTURER_THUMB_IMAGE) {
                 $manufacturer_img = $redhelper->watermark('manufacturer', $media_image[$m]->media_name, $mw_thumb, $mh_thumb, WATERMARK_MANUFACTURER_IMAGE);
             } else {
                 $manufacturer_img = RedShopHelperImages::getImagePath($media_image[$m]->media_name, '', 'thumb', 'manufacturer', $mw_thumb, $mh_thumb, USE_IMAGE_SIZE_SWAPPING);
             }
             if (PRODUCT_IS_LIGHTBOX == 1) {
                 $thum_image = "<a title='" . $altText . "' class=\"modal\" href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "manufacturer/" . $media_image[$m]->media_name . "'   rel=\"{handler: 'image', size: {}}\">\n\t\t\t\t\t\t\t<img alt='" . $altText . "' title='" . $altText . "' src='" . $manufacturer_img . "'></a>";
             } else {
                 $thum_image = "<a title='" . $altText . "' href='" . $manproducts . "'>\n\t\t\t\t\t\t\t<img alt='" . $altText . "' title='" . $altText . "' src='" . $manufacturer_img . "'></a>";
             }
         }
     }
     $middledata = str_replace($mimg_tag, $thum_image, $middledata);
 }
 $middledata = str_replace("{manufacturer_description}", $row->manufacturer_desc, $middledata);
 $middledata = str_replace("{manufacturer_link}", $link, $middledata);
 $middledata = str_replace("{manufacturer_allproductslink}", $manproducts, $middledata);
 $middledata = str_replace("{manufacturer_allproductslink_lbl}", JText::_('COM_REDSHOP_MANUFACTURER_ALLPRODUCTSLINK_LBL'), $middledata);
 $middledata = str_replace("{manufacturer_link_lbl}", JText::_('COM_REDSHOP_MANUFACTURER_LINK_LBL'), $middledata);
Exemplo n.º 24
0
 public function displayAdditionalImage($product_id = 0, $accessory_id = 0, $relatedprd_id = 0, $property_id = 0, $subproperty_id = 0, $main_imgwidth = 0, $main_imgheight = 0, $redview = "", $redlayout = "")
 {
     $redshopconfig = new Redconfiguration();
     $redTemplate = new Redtemplate();
     $stockroomhelper = new rsstockroomhelper();
     $url = JURI::base();
     $option = JRequest::getVar('option');
     $redhelper = new redhelper();
     if ($accessory_id != 0) {
         $accessory = $this->getProductAccessory($accessory_id);
         $product_id = $accessory[0]->child_product_id;
     }
     $product = $this->getProductById($product_id);
     $producttemplate = $redTemplate->getTemplate("product", $product->product_template);
     // Get template for stockroom status
     if ($accessory_id != 0) {
         $template_desc = $redTemplate->getTemplate("accessory_product");
         $template_desc = $template_desc[0]->template_desc;
     } elseif ($relatedprd_id != 0) {
         $template_desc = $redTemplate->getTemplate("related_product");
         $template_desc = $template_desc[0]->template_desc;
     } else {
         $template_desc = $producttemplate[0]->template_desc;
     }
     $producttemplate = $producttemplate[0]->template_desc;
     if ($redlayout == 'categoryproduct' || $redlayout == 'detail') {
         if (strstr($producttemplate, "{product_thumb_image_3}")) {
             $pimg_tag = '{product_thumb_image_3}';
             $ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_3;
             $pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_3;
         } elseif (strstr($producttemplate, "{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($producttemplate, "{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;
         }
     } else {
         if (strstr($producttemplate, "{product_thumb_image_3}")) {
             $pimg_tag = '{product_thumb_image_3}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT_3;
             $pw_thumb = PRODUCT_MAIN_IMAGE_3;
         } elseif (strstr($producttemplate, "{product_thumb_image_2}")) {
             $pimg_tag = '{product_thumb_image_2}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT_2;
             $pw_thumb = PRODUCT_MAIN_IMAGE_2;
         } elseif (strstr($producttemplate, "{product_thumb_image_1}")) {
             $pimg_tag = '{product_thumb_image_1}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT;
             $pw_thumb = PRODUCT_MAIN_IMAGE;
         } else {
             $pimg_tag = '{product_thumb_image}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT;
             $pw_thumb = PRODUCT_MAIN_IMAGE;
         }
     }
     if (strstr($producttemplate, "{more_images_3}")) {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT_3;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE_3;
     } elseif (strstr($producttemplate, "{more_images_2}")) {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT_2;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE_2;
     } elseif (strstr($producttemplate, "{more_images_1}")) {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE;
     } else {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE;
     }
     if ($main_imgwidth != 0 || $main_imgheight != 0) {
         $pw_thumb = $main_imgwidth;
         $ph_thumb = $main_imgheight;
     }
     $ImageAttributes = $this->getdisplaymainImage($product_id, $property_id, $subproperty_id, $pw_thumb, $ph_thumb, $redview);
     $aHrefImageResponse = $ImageAttributes['aHrefImageResponse'];
     $mainImageResponse = $ImageAttributes['mainImageResponse'];
     $productmainimg = $ImageAttributes['productmainimg'];
     $aTitleImageResponse = $ImageAttributes['aTitleImageResponse'];
     $imagename = $ImageAttributes['imagename'];
     //		$ImageAttributes['type']		= $type;
     $attrbimg = $ImageAttributes['attrbimg'];
     $pr_number = $ImageAttributes['pr_number'];
     //$view				= $ImageAttributes['view'];
     $prodadditionImg = "";
     $propadditionImg = "";
     $subpropadditionImg = "";
     $product_availability_date_lbl = '';
     $product_availability_date = '';
     $media_image = $this->getAdditionMediaImage($product_id, "product");
     $tmp_prodimg = "";
     $val_prodadd = count($media_image);
     for ($m = 0; $m < count($media_image); $m++) {
         $thumb = $media_image[$m]->media_name;
         $alttext = $this->getAltText('product', $media_image[$m]->section_id, '', $media_image[$m]->media_id);
         if (!$alttext) {
             $alttext = $media_image[$m]->media_name;
         }
         if ($thumb && $thumb != $media_image[$m]->product_full_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $thumb)) {
             if (WATERMARK_PRODUCT_ADDITIONAL_IMAGE) {
                 $pimg = $redhelper->watermark('product', $thumb, $mpw_thumb, $mph_thumb, WATERMARK_PRODUCT_ADDITIONAL_IMAGE, "1");
                 $linkimage = $redhelper->watermark('product', $thumb, '', '', WATERMARK_PRODUCT_ADDITIONAL_IMAGE, "0");
                 $hoverimg_path = $redhelper->watermark('product', $thumb, ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, WATERMARK_PRODUCT_ADDITIONAL_IMAGE, '2');
             } else {
                 $pimg = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                 $linkimage = REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $thumb;
                 $hoverimg_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
             }
             if (PRODUCT_ADDIMG_IS_LIGHTBOX) {
                 $prodadditionImg_div_start = "<div class='additional_image'><a href='" . $linkimage . "' title='" . $alttext . "'  rel=\"myallimg\">";
                 $prodadditionImg_div_end = "</a></div>";
                 $prodadditionImg .= $prodadditionImg_div_start;
                 $prodadditionImg .= "<img src='" . $pimg . "' alt='" . $alttext . "' title='" . $alttext . "'>";
                 $producthrefend = "";
             } else {
                 if (WATERMARK_PRODUCT_ADDITIONAL_IMAGE) {
                     $img_path = $redhelper->watermark('product', $thumb, $pw_thumb, $ph_thumb, WATERMARK_PRODUCT_ADDITIONAL_IMAGE, '0');
                 } else {
                     $img_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                 }
                 $filename_thumb = REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_thumb_image;
                 $filename_org = REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $media_image[$m]->product_full_image;
                 if (is_file($filename_thumb)) {
                     $thumb_original = $product->product_thumb_image;
                 } elseif (is_file($filename_org)) {
                     $thumb_original = $media_image[$m]->product_full_image;
                 } else {
                     $thumb_original = PRODUCT_DEFAULT_IMAGE;
                 }
                 if (WATERMARK_PRODUCT_THUMB_IMAGE) {
                     $img_path_org = $redhelper->watermark('product', $thumb_original, $pw_thumb, $ph_thumb, WATERMARK_PRODUCT_THUMB_IMAGE, '0');
                 } else {
                     $img_path_org = RedShopHelperImages::getImagePath($thumb_original, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                 }
                 $prodadditionImg_div_start = "<div class='additional_image' onmouseover='display_image_add(\"" . $img_path . "\"," . $product_id . ");' onmouseout='display_image_add_out(\"" . $img_path_org . "\"," . $product_id . ");'>";
                 $prodadditionImg_div_end = "</div>";
                 $prodadditionImg .= $prodadditionImg_div_start;
                 $prodadditionImg .= '<a href="javascript:void(0)" >' . "<img src='" . $pimg . "' alt='" . $alttext . "' title='" . $alttext . "' style='cursor: auto;'>";
                 $producthrefend = "</a>";
             }
             if (ADDITIONAL_HOVER_IMAGE_ENABLE) {
                 $prodadditionImg .= "<img src='" . $hoverimg_path . "' alt='" . $alttext . "' title='" . $alttext . "' class='redImagepreview'>";
             }
             $prodadditionImg .= $producthrefend;
             $prodadditionImg .= $prodadditionImg_div_end;
             $tmp_prodimg = $prodadditionImg;
         }
     }
     if ($val_prodadd == 0) {
         $prodadditionImg = " ";
         $propadditionImg = " ";
     }
     if ($property_id > 0) {
         $media_image = $this->getAdditionMediaImage($property_id, "property");
         if (count($media_image) == 0) {
             $propadditionImg = $tmp_prodimg;
         } else {
             for ($m = 0; $m < count($media_image); $m++) {
                 $thumb = $media_image[$m]->media_name;
                 $alttext = $this->getAltText('property', $media_image[$m]->section_id, '', $media_image[$m]->media_id);
                 if (!$alttext) {
                     $alttext = $thumb;
                 }
                 if ($thumb && $thumb != $media_image[$m]->property_main_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . "property/" . $thumb)) {
                     if (PRODUCT_ADDIMG_IS_LIGHTBOX) {
                         $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         $propadditionImg_div_start = "<div class='additional_image'><a href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "property/" . $thumb . "' title='" . $alttext . "' rel=\"myallimg\">";
                         $propadditionImg_div_end = "</a></div>";
                         $propadditionImg .= $propadditionImg_div_start;
                         $propadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "'>";
                         $prophrefend = "";
                     } else {
                         $imgs_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         $property_filename_org = REDSHOP_FRONT_IMAGES_RELPATH . "property/" . $imagename;
                         if (is_file($property_filename_org)) {
                             $property_thumb_original = $imagename;
                             $property_img_path_org = RedShopHelperImages::getImagePath($property_thumb_original, '', 'thumb', 'property', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         } else {
                             $property_thumb_original = $thumb_original;
                             $property_img_path_org = RedShopHelperImages::getImagePath($property_thumb_original, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         }
                         $propadditionImg_div_start = "<div class='additional_image' onmouseover='display_image_add(\"" . $imgs_path . "\"," . $product_id . ");' onmouseout='display_image_add_out(\"" . $property_img_path_org . "\"," . $product_id . ");'>";
                         $propadditionImg_div_end = "</div>";
                         $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         $propadditionImg .= $propadditionImg_div_start;
                         $propadditionImg .= "<a href='javascript:void(0)'>" . "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' style='cursor: auto;'>";
                         $prophrefend = "</a>";
                     }
                     if (ADDITIONAL_HOVER_IMAGE_ENABLE) {
                         $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                         $propadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' class='redImagepreview'>";
                     }
                     $propadditionImg .= $prophrefend;
                     $propadditionImg .= $propadditionImg_div_end;
                 }
             }
         }
     }
     if ($subproperty_id > 0) {
         //Display Sub-Property Number
         $media_image = $this->getAdditionMediaImage($subproperty_id, "subproperty");
         for ($m = 0; $m < count($media_image); $m++) {
             $thumb = $media_image[$m]->media_name;
             $alttext = $this->getAltText('subproperty', $media_image[$m]->section_id, '', $media_image[$m]->media_id);
             if (!$alttext) {
                 $alttext = $thumb;
             }
             $filedir = is_file(REDSHOP_FRONT_IMAGES_RELPATH . "subproperty/" . $thumb) ? 'subproperty' : 'property';
             if ($thumb && $thumb != $media_image[$m]->subattribute_color_main_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . $filedir . "/" . $thumb)) {
                 if (PRODUCT_ADDIMG_IS_LIGHTBOX) {
                     $subpropadditionImg_div_start = "<div class='additional_image'><a href='" . REDSHOP_FRONT_IMAGES_ABSPATH . $filedir . "/" . $thumb . "' title='" . $alttext . "' rel=\"myallimg\">";
                     $subpropadditionImg_div_end = "</a></div>";
                     $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     $subpropadditionImg .= $subpropadditionImg_div_start;
                     $subpropadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "'>";
                     $subprophrefend = "";
                 } else {
                     $imgs_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     $subproperty_filename_org = REDSHOP_FRONT_IMAGES_RELPATH . "subproperty/" . $imagename;
                     if (is_file($subproperty_filename_org)) {
                         $subproperty_thumb_original = $media_image[$m]->subattribute_color_image;
                         $subproperty_img_path_org = RedShopHelperImages::getImagePath($subproperty_thumb_original, '', 'thumb', 'subproperty', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     } else {
                         $subproperty_img_path_org = $property_img_path_org;
                     }
                     $subpropadditionImg_div_start = "<div class='additional_image' onmouseover='display_image_add(\"" . $imgs_path . "\"," . $product_id . ");' onmouseout='display_image_add_out(\"" . $subproperty_img_path_org . "\"," . $product_id . ");' >";
                     $subpropadditionImg_div_end = "</div>";
                     $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     $subpropadditionImg .= $subpropadditionImg_div_start;
                     $subpropadditionImg .= "<a href='javascript:void(0)'>" . "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' style='cursor: auto;'>";
                     $subprophrefend = "</a>";
                 }
                 if (ADDITIONAL_HOVER_IMAGE_ENABLE) {
                     $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                     $subpropadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' class='redImagepreview'>";
                 }
                 $subpropadditionImg .= $subprophrefend;
                 $subpropadditionImg .= $subpropadditionImg_div_end;
             }
         }
     }
     $response = "";
     if ($subpropadditionImg != "") {
         $response = "<div>" . $subpropadditionImg . "</div>";
     } elseif ($propadditionImg != "") {
         $response = "<div>" . $propadditionImg . "</div>";
     } elseif ($prodadditionImg != "") {
         $response = "<div>" . $prodadditionImg . "</div>";
     }
     $ProductAttributeDelivery = "";
     $attributeFlag = false;
     if ($accessory_id == 0) {
         if ($subproperty_id) {
             $ProductAttributeDelivery = $this->getProductMinDeliveryTime($product_id, $subproperty_id, "subproperty", 0);
             if ($ProductAttributeDelivery) {
                 $attributeFlag = true;
             }
         }
         if ($property_id && $attributeFlag == false) {
             $ProductAttributeDelivery = $this->getProductMinDeliveryTime($product_id, $property_id, "property", 0);
             if ($ProductAttributeDelivery) {
                 $attributeFlag = true;
             }
         }
         if ($product_id && $attributeFlag == false) {
             $ProductAttributeDelivery = $this->getProductMinDeliveryTime($product_id);
         }
     }
     $stock_status = '';
     $stockamountTooltip = "";
     $productinstock = 0;
     $stockamountSrc = "";
     $stockImgFlag = false;
     $notify_stock = '';
     if (USE_STOCKROOM == 1 && $accessory_id == 0) {
         if ($subproperty_id) {
             $productinstock = $stockroomhelper->getStockAmountwithReserve($subproperty_id, "subproperty");
             $stockamountList = $stockroomhelper->getStockAmountImage($subproperty_id, "subproperty", $productinstock);
             //				if(count($stockamountList)>0)
             //				{
             $stockImgFlag = true;
             //				}
         }
         if ($property_id && $stockImgFlag == false) {
             $productinstock = $stockroomhelper->getStockAmountwithReserve($property_id, "property");
             $stockamountList = $stockroomhelper->getStockAmountImage($property_id, "property", $productinstock);
             //				if(count($stockamountList)>0)
             //				{
             $stockImgFlag = true;
             //				}
         }
         if ($product_id && $stockImgFlag == false) {
             $productinstock = $stockroomhelper->getStockAmountwithReserve($product_id);
             $stockamountList = $stockroomhelper->getStockAmountImage($product_id, "product", $productinstock);
         }
         if (count($stockamountList) > 0) {
             $stockamountTooltip = $stockamountList[0]->stock_amount_image_tooltip;
             $stockamountSrc = REDSHOP_FRONT_IMAGES_ABSPATH . 'stockroom/' . $stockamountList[0]->stock_amount_image;
         }
     }
     // Stockroom status code->Ushma
     if (strstr($template_desc, "{stock_status") || strstr($template_desc, "{stock_notify_flag}") || strstr($template_desc, "{product_availability_date}")) {
         // for c**t attributes
         $attributes_set = array();
         if ($product->attribute_set_id > 0) {
             $attributes_set = $this->getProductAttribute(0, $product->attribute_set_id, 0, 1);
         }
         $attributes = $this->getProductAttribute($product->product_id);
         $attributes = array_merge($attributes, $attributes_set);
         $totalatt = count($attributes);
         $productStockStatus = $this->getproductStockStatus($product->product_id, $totalatt, $property_id, $subproperty_id);
         if (strstr($template_desc, "{stock_status")) {
             $stocktag = strstr($template_desc, "{stock_status");
             $newstocktag = explode("}", $stocktag);
             $realstocktag = $newstocktag[0] . "}";
             $stock_tag = substr($newstocktag[0], 1);
             $sts_array = explode(":", $stock_tag);
             $avail_class = "available_stock_cls";
             if (isset($sts_array[1]) && $sts_array[1] != "") {
                 $avail_class = $sts_array[1];
             }
             $out_stock_class = "out_stock_cls";
             if (isset($sts_array[2]) && $sts_array[2] != "") {
                 $out_stock_class = $sts_array[2];
             }
             $pre_order_class = "pre_order_cls";
             if (isset($sts_array[3]) && $sts_array[3] != "") {
                 $pre_order_class = $sts_array[3];
             }
             if (!$productStockStatus['regular_stock']) {
                 if ($productStockStatus['preorder'] && !$productStockStatus['preorder_stock'] || !$productStockStatus['preorder']) {
                     $stock_status = "<span id='stock_status_div" . $product_id . "'><div id='" . $out_stock_class . "' class='" . $out_stock_class . "'>" . JText::_('COM_REDSHOP_OUT_OF_STOCK') . "</div></span>";
                 } else {
                     $stock_status = "<span id='stock_status_div" . $product_id . "'><div id='" . $pre_order_class . "' class='" . $pre_order_class . "'>" . JText::_('COM_REDSHOP_PRE_ORDER') . "</div></span>";
                 }
             } else {
                 $stock_status = "<span id='stock_status_div" . $product_id . "'><div id='" . $avail_class . "' class='" . $avail_class . "'>" . JText::_('COM_REDSHOP_AVAILABLE_STOCK') . "</div></span>";
             }
         }
         if (strstr($template_desc, "{stock_notify_flag}")) {
             $userArr = $this->_session->get('rs_user');
             $is_login = $userArr['rs_is_user_login'];
             $users_info_id = $userArr['rs_user_info_id'];
             $user_id = $userArr['rs_userid'];
             $is_notified = $this->isAlreadyNotifiedUser($user_id, $product->product_id, $property_id, $subproperty_id);
             if (!$productStockStatus['regular_stock'] && $is_login && $users_info_id) {
                 if ($productStockStatus['preorder'] && !$productStockStatus['preorder_stock'] || !$productStockStatus['preorder']) {
                     if ($is_notified) {
                         $notify_stock = "<span>" . JText::_('COM_REDSHOP_ALREADY_REQUESTED_FOR_NOTIFICATION') . "</span>";
                     } else {
                         $notify_stock = '<span >' . JText::_('COM_REDSHOP_NOTIFY_STOCK_LBL') . '</span><input type="button" name="" value="' . JText::_('COM_REDSHOP_NOTIFY_STOCK') . '" class="notifystockbtn" title="' . JText::_('COM_REDSHOP_NOTIFY_STOCK_LBL') . '" onclick="getStocknotify(\'' . $product->product_id . '\',\'' . $property_id . '\', \'' . $subproperty_id . '\');">';
                     }
                 } else {
                     $notify_stock = "";
                 }
             } else {
                 $notify_stock = '';
             }
         }
         if (strstr($template_desc, "{product_availability_date}")) {
             if (!$productStockStatus['regular_stock'] && $productStockStatus['preorder']) {
                 if ($product->product_availability_date != "") {
                     $product_availability_date_lbl = JText::_('COM_REDSHOP_PRODUCT_AVAILABILITY_DATE_LBL') . ": ";
                     $product_availability_date = $redshopconfig->convertDateFormat($product->product_availability_date);
                 } else {
                     $product_availability_date_lbl = "";
                     $product_availability_date = "";
                 }
             } else {
                 $product_availability_date_lbl = "";
                 $product_availability_date = "";
             }
         }
     }
     $ret = array();
     $ret['response'] = $response;
     $ret['aHrefImageResponse'] = $aHrefImageResponse;
     $ret['aTitleImageResponse'] = $aTitleImageResponse;
     $ret['mainImageResponse'] = $mainImageResponse;
     $ret['stockamountSrc'] = $stockamountSrc;
     $ret['stockamountTooltip'] = $stockamountTooltip;
     $ret['ProductAttributeDelivery'] = $ProductAttributeDelivery;
     $ret['attrbimg'] = $attrbimg;
     $ret['pr_number'] = $pr_number;
     $ret['productinstock'] = $productinstock;
     $ret['stock_status'] = $stock_status;
     $ret['product_mainimg'] = $productmainimg;
     $ret['ImageName'] = $imagename;
     $ret['notifyStock'] = $notify_stock;
     $ret['product_availability_date_lbl'] = $product_availability_date_lbl;
     $ret['product_availability_date'] = $product_availability_date;
     //$ret['view']			=$view;
     return $ret;
 }
Exemplo n.º 25
0
			<td><?php 
    echo JText::_('COM_REDSHOP_PRODUCT_IMAGE');
    ?>
 :</td>
			<td><?php 
    $model = $this->getModel('manufacturer_detail');
    $media_id = $model->getMediaId($this->detail->manufacturer_id);
    if ($media_id) {
        $mediaId = $media_id->media_id;
        $mediaName = $media_id->media_name;
    } else {
        $mediaId = 0;
        $mediaName = '';
    }
    $ilink = JRoute::_('index.php?tmpl=component&option=com_redshop&view=media_detail&cid[]=' . $mediaId . '&section_id=' . $this->detail->manufacturer_id . '&showbuttons=1&media_section=manufacturer&section_name=' . $this->detail->manufacturer_name);
    $image_path = RedShopHelperImages::getImagePath($mediaName, '', 'thumb', 'manufacturer', MANUFACTURER_THUMB_WIDTH, MANUFACTURER_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
    ?>
				<div class="button2-left">
					<div class="image"><a class="modal" title="Image" href="<?php 
    echo $ilink;
    ?>
"
					                      rel="{handler: 'iframe', size: {x: 950, y: 500}}"><?php 
    echo JText::_('COM_REDSHOP_ADD_ADDITIONAL_IMAGES');
    ?>
</a>
					</div>
				</div>

			</td>
		</tr>