| Current Path : /proc/self/root/proc/732462/root/tmp/ |
| Current File : //proc/self/root/proc/732462/root/tmp/phpo8fqt8 |
<?php
/**
* Marketplace - Component Marketplace
* ******************************************************************
*
* PHP version 7.0
*
* @category Component
* @package Joomla
* @author WebKul software private limited <support@webkul.com>
* @copyright 2010 WebKul software private limited
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @version GIT:5.2
* @filesource http://store.webkul.com
* @link Technical Support: webkul.uvdesk.com
* ******************************************************************
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JHTML::_('jquery.framework');
/******************Add to cart *******************************/
if (!class_exists('VmConfig')) {
include JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php';
}
if (!class_exists('CurrencyDisplay')) {
include JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/currencydisplay.php';
}
if (!class_exists('MarketplaceHelper')) {
include JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.
DIRECTORY_SEPARATOR.'com_marketplace'.DIRECTORY_SEPARATOR.'helpers'.
DIRECTORY_SEPARATOR.'marketplace.php';
}
$vmconfig=VmConfig::loadConfig();
$add_pro_menu = MarketplaceHelper::getMpMenuItem('addproduct');
$productModel = VmModel::getModel('Product');
$products = $productModel->getProductListing('random', '1', '1', true, false, '', '');
$currencyInstance = CurrencyDisplay::getInstance();
$changeCurrency=$currencyInstance->getCurrencyForDisplay();
/*********Calculated Modules******************/
$obj=new JDocumentHTML();
$mod="";
if (!$obj->countModules('wk_marketplace-left')&& !$obj->countModules('wk_marketplace-right')) {
$both=0;
} elseif ((!$obj->countModules('wk_marketplace-left') && $obj->countModules('wk_marketplace-right'))||($obj->countModules('wk_marketplace-left') && !$obj->countModules('wk_marketplace-right'))) {
$both=1;
if (!$obj->countModules('wk_marketplace-left') && $obj->countModules('wk_marketplace-right')) {
$mod="r";
} else {
$mod="l";
}
} else {
$both=2;
}
if ($both==0) {
$maxwidth="900";
} elseif ($both==1) {
$maxwidth="700";
} else {
$maxwidth="550";
}
/*********Calculated Modules End******************/
$param = JComponentHelper::getParams('com_marketplace');
$bgcolor=trim($param->get('head_bg_color'));
$textcolor=trim($param->get('head_txt_color'));
?>
<style type="text/css">
.seller_profile_view_main,
.marketplace_position1,
.marketplace_position2 {
margin: 5px;
display: inline-block;
vertical-align: top;
}
.order_history {
background-color: <?php echo $bgcolor;
?>;
width: 99.5%;
}
.detail_text {
color: <?php echo $textcolor;
?>;
}
.txt_search {
margin-bottom: 0 !important;
height: 27px !important;
border-radius: 0 !important;
margin-top: 1px;
}
.wk_main_loader {
position: relative;
}
.wk_main_loader_overlay {
position: absolute;
background-color: #FFF ! important;
z-index: 999;
width: 101%;
height: 100%;
border: 1px solid #CCCCCC;
border-radius: 10px;
}
.rev_created {
text-align: right;
font-style: italic;
color: blue;
}
</style>
<!--****************Custom Position********************************* -->
<div style="width:100%;" class="wk_main_loader">
<div class="wk_main_loader_overlay">
<img style="display:block;margin:0 auto;" src="<?php echo JURI::root()."components/com_marketplace/"
?>images/ajaxspinner1.gif"/>
</div>
<div class="Wk_outer">
<div class="marketplace_position-top" style="clear:both;">
<?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-top}'); ?>
</div>
<div class="marketplace_position1">
<?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-left}'); ?>
</div>
<!-- ****************Custom Position end********************************* -->
<script type="text/javascript">
jQuery(window).load(function () {
jQuery('.wk_main_loader_overlay').css('display', 'none');
});
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
}
var both = <?php echo $both;?>;
var mod = "<?php echo $mod;?>";
jQuery(function () {
jQuery(window).on('load resize', function () {
if (both == 2) {
if (jQuery('.Wk_outer').width() >= 900) {
jQuery('.marketplace_position1').css("width", "19%");
jQuery('.marketplace_position2').css("width", "19%");
jQuery('.seller_profile_view_main').css("width", "57%");
} else if (jQuery('.Wk_outer').width() < 766 && jQuery('.Wk_outer').width() > 640) {
jQuery('.marketplace_position1').css("width", "23%");
jQuery('.marketplace_position2').css("width", "99%");
jQuery('.seller_profile_view_main').css("width", "73%");
} else if (jQuery('.Wk_outer').width() <= 640) {
jQuery('.marketplace_position1').css("width", "99.5%");
jQuery('.marketplace_position2').css("width", "99.5%");
jQuery('.seller_profile_view_main').css("width", "99.5%");
}
} else if (both == 1) {
if (jQuery('.Wk_outer').width() >= 724) {
if (mod == "l")
jQuery('.marketplace_position1').css("width", "23.5%");
else
jQuery('.marketplace_position2').css("width", "23.5%");
jQuery('.seller_profile_view_main').css("width", "70.5%");
} else if (jQuery('.Wk_outer').width() < 724) {
if (mod == "l")
jQuery('.marketplace_position1').css("width", "99.5%");
else
jQuery('.marketplace_position2').css("width", "99.5%");
jQuery('.seller_profile_view_main').css("width", "99.5%");
}
} else {
jQuery('.seller_profile_view_main').css("width", "99.5%");
}
combind();
});
});
</script>
<?php
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root().'components/com_marketplace/css/newdesign/seller_profile.css');
$document->addStyleSheet(JURI::root().'components/com_marketplace/css/easy-responsive-tabs.css');
$document->addScript(JURI::root().'components/com_marketplace/js/easy-responsive-tabs.js');
$document->addScript(JURI::root().'components/com_marketplace/js/sellerprofile.js');
$document->addStyleSheet(JURI::root().'components/com_marketplace/css/newdesign/product_list.css');
$document->addStyleSheet(JURI::root().'components/com_marketplace/css/newdesign/addproduct.css');
$document->addStyleSheet('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
$document->addStyleSheet('//fonts.googleapis.com/css?family=Roboto');
$document->addStyleSheet('//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css');
$document->addScript('//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert-dev.min.js');
$lang_tag=VmConfig::$vmlang;
$param = JComponentHelper::getParams('com_marketplace');
$obj=CurrencyDisplay::getInstance();
$wk_currency = $obj->getSymbol();
$wk_feedback_option = $param->get('wk_feedback_option');
$wk_connnect_us = $param->get('wk_connnect_us');
$wk_conct_email = $param->get('wk_conct_email');
$wk_conct_fb = $param->get('wk_conct_fb');
$wk_conct_twtr = $param->get('wk_conct_twtr');
$bx_slider_height = $param->get('bx_slider_height');
$wk_seller_desc = 100;
$lazy_limit = $param->get('wk_lazy_load_limit');
$user=JFactory::getUser();
$u_id=$user->id;
$jinput=JFactory::getApplication()->input;
$method=$jinput->getMethod();
$seller_id=$jinput->get('seller_id', 0, 'INT');
$u_email=$user->email;
$root = JURI::root();
if (isset($seller_id)) {
$seller_name_data = MarketplaceHelper::getSeller(
$seller_id, array('u.name', 's.screenname')
);
if (strlen($seller_name_data->screenname)) {
$seller_name=ucwords($seller_name_data->screenname).JText::_('THE_S');
} else {
$seller_name=ucwords($seller_name_data->name).JText::_('THE_S');
}
$model=$this->getModel();
$full_pro = $model->getRecords($lazy_limit, 0, $lang_tag, $seller_id, 1);
$pro_records=$model->getRecords($lazy_limit, 0, $lang_tag, $seller_id);
$feedback_rec = $model->getFeedback($seller_id, 0, $lazy_limit, 1);
$feedback_rec_lazy = $model->getFeedback($seller_id, 0, $lazy_limit);
$total_record_final=count($feedback_rec);
$total_feedback=count($feedback_rec);
$productlistmenu=plgSystemMarketplace::getMenuId("index.php?option=com_marketplace&view=productlist");
?>
<div class="seller_profile_view_main">
<div class="seller_profile_view">
<div class="order_history">
<span class="detail_design"></span>
<span class="detail_text"><?php echo $seller_name." ".JText::_('PRODUCT_LIST')?></span>
</div>
<div class="gridlist hidden-phone">
<?php
$_input = JFactory::getApplication()->input;
$mode=$_input->getString('mode', 'list');
if (count($pro_records) && $mode=='grid') {
?><span class="grid"><i class="grd fa fa-th" style="color:#000"></i></span>
<span class="list"><a href="<?php echo JRoute::_('index.php?option=com_marketplace&view=productlist&seller_id='.$seller_id.'&mode=list&Itemid='.$productlistmenu, false);?>" title="<?php echo JText::_('SELLER_LIST_VIEW');?>"><i class="lst fa fa-list" style="color:#2196F3"></i></a></span>
<?php
} elseif (count($pro_records)) {
?>
<span class="grid"><a href="<?php echo JRoute::_('index.php?option=com_marketplace&view=productlist&seller_id='.$seller_id.'&mode=grid&Itemid='.$productlistmenu, false);?>" title="<?php echo JText::_('SELLER_GRID_VIEW');?>"><i class="grd fa fa-th" style="color:#2196F3"></i></a></span>
<span class="list"><i class="lst fa fa-list" style="color:#000000"></i></span>
<?php
}
?>
</div>
<div class="pro_action">
<?php
if (count($pro_records)) {
?>
<div class="shop_search">
<input class="txt_search" type="text" name="search" value="" placeholder="Enter Search Keyword">
<div class="search_btn_container">
<div id="wk_search" class="btn btn_search"><?php echo JText::_('SEARCH_CLICK');?></div>
<div id="clear" style="margin-left:2px;" class="btn btn_search"><?php echo JText::_('SEARCH_CLEAR');?></div>
</div>
</div>
<div class="grid_list">
<?php echo JText::_('SORT_BY');?>
<select name="sort" class="sortby">
<option value="none">Select any</option>
<option value="p_date">Product Date Created</option>
<option value="p_name">Product Name</option>
<option value="p_h_to_l">Price high to low</option>
<option value="p_l_to_h">Price low to high</option>
</select>
</div>
<?php } ?>
</div>
<div class="resp-vtabs" id="horizontalTab" >
<ul class="resp-tabs-list" >
<li class="resp-tab-item resp-tab-active" aria-controls="tab_item-0" role="tab"><?php echo JText::_('RECENT_PRODUCTS'); ?></li>
</ul>
<div class="resp-tabs-container">
<div class="panel-body contentbar resp-tab-content-active resp-tab-content" id="recent-product">
<?php
if (count($pro_records)) {
foreach ($pro_records as $item) {
if (isset($item->virtuemart_product_id)) {
$dot="";
$product_edit_link = JRoute::_(
'index.php?option=com_marketplace&view=addproduct&'.
'virtuemart_product_id='.$item->virtuemart_product_id.
'&Itemid='.$add_pro_menu->id,
false
);
if ($model->getFevorite($item->virtuemart_product_id)) {
$style="color:#F55525!important;";
} else {
$style="color:#D9DDDE!important;";
}
$products = $productModel->getProductSingle($item->virtuemart_product_id);
$productModel->addImages($products);
$proMod = $productModel->getProduct($item->virtuemart_product_id);
$dis_price_indx = 0;
foreach ($proMod->allPrices as $key => $value) {
if (isset($value["salesPrice"])) {
$dis_price_indx = $key;
break;
}
}
if ($mode=='grid') {
?>
<div class='recent_pro visible-desktop' id="<?php echo $item->virtuemart_product_id; ?>">
<div class="pro_img"><a href="<?php echo JRoute::_("index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=".$item->virtuemart_product_id, false)?> "target="">
<?php
if (!strlen($item->file_url)) {
?>
<img class="image_pro" src="<?php echo JURI::root().$vmconfig->get("assets_general_path")."images/vmgeneral/".$vmconfig->get("no_image_set"); ?>" width="100%"/>
<?php
} else {
?>
<img class="image_pro" width="100%" src="<?php echo $item->file_url; ?>"/>
<?php
} ?></a>
</div>
<div class="pro_name"><?php
if (strlen($item->product_name) > 30) {
echo substr($item->product_name, 0, 30).'…';
} else {
echo $item->product_name;
}
?>
</div>
<div class="pro_price"><?php
if ($proMod->allPrices[$dis_price_indx]["basePriceWithTax"]>$proMod->allPrices[$dis_price_indx]["salesPrice"]) {
?>
<span style="text-decoration:line-through"><?php echo $currencyInstance->getFormattedCurrency(
$currencyInstance->roundForDisplay(
$currencyInstance->convertCurrencyTo($changeCurrency, $proMod->allPrices[$dis_price_indx]["basePriceWithTax"], false)
)
); ?></span><?php
}
?>
<span class="current"><?php echo $currencyInstance->getFormattedCurrency(
$currencyInstance->roundForDisplay(
$currencyInstance->convertCurrencyTo($changeCurrency, $proMod->allPrices[$dis_price_indx]["salesPrice"], false)
)
); ?></span>
</div>
<div class="hover_product">
<div class="wk_heart_fevorite" >
<a class="wk_fevorite_pro" id="<?php echo $item->virtuemart_product_id?>" href="javascript:void(0)" title="<?php echo JText::_('CLICK_HERE_TO_FEVORITE'); ?>"><span class="icon-heart" style="font-size:25px!important;<?php echo $style; ?>" ></span></a>
</div>
<div class="rating">
<?php
if ($item->rating!=null) {
$rt=round($item->rating);
} else {
$rt=0;
} ?>
<span class="yellow">
<?php
$xv= 5-$rt;
for ($i=0; $i < $rt ; $i++) {
?>
<i class="pad_none fa fa-star"></i>
<?php
}
if ($xv>0) {
for ($i=0; $i <$xv ; $i++) {
?>
<i class="pad_none fa fa-star-o"></i>
<?php
}
} ?>
</span>
</div>
<div class="pro_buy_grid">
<div style="text-align:center;">
<a class="btn btn-lg btn-primary btn-block" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$item->virtuemart_product_id, false); ?>">
<?php
echo JText::_('BUY_NOW');
?>
</a>
</div>
</div>
<?php
if ((int)$seller_id === (int)$u_id) {
?>
<div class="edit_pro">
<a class="btn btn-success btn-block" href="<?php echo $product_edit_link ?>">
<?php echo JText::_('MARKETPLACE_EDIT'); ?>
</a>
</div>
<?php
}
?>
</div>
</div>
<div class='recent_pro_md hidden-desktop' id="<?php echo $item->virtuemart_product_id; ?>">
<div class="pro_img"><a href="<?php echo JRoute::_("index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=".$item->virtuemart_product_id, false)?> "target="">
<?php
if (!strlen($item->file_url)) {
?>
<img class="image_pro" src="<?php echo JURI::root().$vmconfig->get("assets_general_path")."images/vmgeneral/".$vmconfig->get("no_image_set"); ?>" width="100%"/>
<?php
} else {
?>
<img class="image_pro" width="100%" src="<?php echo $item->file_url; ?>"/>
<?php
} ?></a>
</div>
<div class="pro_name"><?php
if (strlen($item->product_name) > 30) {
echo substr($item->product_name, 0, 30).'…';
} else {
echo $item->product_name;
}
?>
<div class="rating">
<?php
if ($item->rating!=null) {
$rt=round($item->rating);
} else {
$rt=0;
} ?>
<span class="yellow">
<?php
$xv= 5-$rt;
for ($i=0; $i < $rt ; $i++) {
?>
<i class="pad_none fa fa-star"></i>
<?php
}
if ($xv>0) {
for ($i=0; $i <$xv ; $i++) {
?>
<i class="pad_none fa fa-star-o"></i>
<?php
}
} ?>
</span>
</div>
<div class="pro_price"> <?php
if ($proMod->allPrices[$dis_price_indx]["basePriceWithTax"]>$proMod->allPrices[$dis_price_indx]["salesPrice"]) {
?>
<span style="text-decoration:line-through"><?php echo $currencyInstance->getFormattedCurrency(
$currencyInstance->roundForDisplay(
$currencyInstance->convertCurrencyTo($changeCurrency, $proMod->allPrices[$dis_price_indx]["basePriceWithTax"], false)
)
); ?></span><?php
} ?>
<span class="current"><?php echo $currencyInstance->getFormattedCurrency(
$currencyInstance->roundForDisplay(
$currencyInstance->convertCurrencyTo($changeCurrency, $proMod->allPrices[$dis_price_indx]["salesPrice"], false)
)
); ?></span>
</div>
<div class="wk_heart_fevorite" >
<a class="wk_fevorite_pro" id="<?php echo $item->virtuemart_product_id?>" href="javascript:void(0)" title="<?php echo JText::_('CLICK_HERE_TO_FEVORITE'); ?>">
<span class="icon-heart" style="<?php echo $style; ?> width:100%" >
<span class="add_fav"><?php echo JText::_('ADD_TO_FAVORITE'); ?></span>
</span>
</a>
</div>
<div class="pro_buy_grid">
<div style="text-align:center;">
<a class="btn btn-lg btn-primary btn-block" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$item->virtuemart_product_id, false); ?>"><?php echo JText::_('BUY_NOW'); ?></a>
</div>
</div>
<?php
if ((int)$seller_id === (int)$u_id) {
?>
<div class="edit_pro">
<a class="btn btn-success btn-block" href="<?php echo $product_edit_link ?>">
<?php echo JText::_('MARKETPLACE_EDIT'); ?>
</a>
</div>
<?php
}
?>
</div>
</div>
<?php
} else {
?>
<div class='recent_pro_md' id="<?php echo $item->virtuemart_product_id; ?>">
<div class="pro_img"><a href="<?php echo JRoute::_("index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=".$item->virtuemart_product_id, false)?> "target="">
<?php
if (!strlen($item->file_url)) {
?>
<img class="image_pro" src="<?php echo JURI::root().$vmconfig->get("assets_general_path")."images/vmgeneral/".$vmconfig->get("no_image_set"); ?>" width="100%"/>
<?php
} else {
?>
<img class="image_pro" width="100%" src="<?php echo $item->file_url; ?>"/>
<?php
} ?></a>
</div>
<div class="pro_name"><?php
if (strlen($item->product_name) > 30) {
echo substr($item->product_name, 0, 30).'…';
} else {
echo $item->product_name;
} ?>
<div class="rating">
<?php
if ($item->rating!=null) {
$rt=round($item->rating);
} else {
$rt=0;
} ?>
<span class="yellow">
<?php $xv= 5-$rt;
for ($i=0; $i < $rt ; $i++) {
?>
<i class="pad_none fa fa-star"></i>
<?php
}
if ($xv>0) {
for ($i=0; $i <$xv ; $i++) {
?>
<i class="pad_none fa fa-star-o"></i>
<?php
}
} ?>
</span>
</div>
<div class="pro_price"><?php
if ($proMod->allPrices[$dis_price_indx]["basePriceWithTax"]>$proMod->allPrices[$dis_price_indx]["salesPrice"]) {
?>
<span style="text-decoration:line-through"><?php echo $currencyInstance->getFormattedCurrency(
$currencyInstance->roundForDisplay(
$currencyInstance->convertCurrencyTo($changeCurrency, $proMod->allPrices[$dis_price_indx]["basePriceWithTax"], false)
)
); ?></span><?php
} ?>
<span class="current"><?php echo $currencyInstance->getFormattedCurrency(
$currencyInstance->roundForDisplay(
$currencyInstance->convertCurrencyTo($changeCurrency, $proMod->allPrices[$dis_price_indx]["salesPrice"], false)
)
); ?></span>
</div>
<div class="wk_heart_fevorite" >
<a class="wk_fevorite_pro" id="<?php echo $item->virtuemart_product_id?>" href="javascript:void(0)" title="<?php echo JText::_('CLICK_HERE_TO_FEVORITE'); ?>">
<span class="icon-heart" style="<?php echo $style; ?>; width:100%" >
<span class="add_fav"><?php echo JText::_('ADD_TO_FAVORITE'); ?></span>
</span>
</a>
</div>
<div class="pro_buy_grid">
<div style="text-align:center;">
<a class="btn btn-lg btn-primary btn-block" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$item->virtuemart_product_id, false); ?>"><?php echo JText::_('BUY_NOW'); ?></a>
</div>
<?php
if ((int)$seller_id === (int)$u_id) {
?>
<div class="edit_pro">
<a class="btn btn-success btn-block" href="<?php echo $product_edit_link ?>">
<?php echo JText::_('MARKETPLACE_EDIT'); ?>
</a>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
}
}
}
} else {
echo '<div class="alert alert-info">'.JText::_('NO_PRODUCT_ADDED_YET').'</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
<?php
} else {
$link = juri::root().'index.php?option=com_virtuemart&view=category';
$msg = JText::_('SELLER_DOES_NOT_EXIST_ADMIN_PRODUCT');
JFactory::getApplication()->redirect($link, $msg, 'notice');
}
?>
<div class="marketplace_position2" ><?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-right}'); ?></div>
<div class="marketplace_position-bottom" style="clear:both;"><?php echo JHTML::_('content.prepare', '{loadposition wk_marketplace-bottom}'); ?></div>
<script type="text/javascript">
var r_strt = <?php echo $lazy_limit;?>;
var r_lmt = <?php echo $lazy_limit;?>;
jQuery('.sortby').on('change', function () {
sortSearch();
});
jQuery('.btn_search').on('click', function () {
sortSearch();
});
jQuery(function () {
jQuery("#horizontalTab ul li:nth-child(2)").on('click', function () {
jQuery('.seller_profile_view .pro_action').css('display', 'none');
jQuery('.seller_profile_view .gridlist').css('display', 'none');
});
jQuery("#horizontalTab ul li:nth-child(1)").on('click', function () {
jQuery('.seller_profile_view .pro_action').css('display', 'inline-block');
jQuery('.seller_profile_view .gridlist').css('display', 'block');
});
});
function sortSearch() {
var s = 0;
var l = <?php echo $lazy_limit;?>;
var sel = <?php echo $seller_id?>;
var sort = jQuery('.sortby').val();
var srch = jQuery('.txt_search').val();
jQuery.ajax({
url: '<?php echo JRoute::_("index.php?option=com_marketplace&view=productlist&task=productlist.searchRecords&id=".$seller_id."", false);?>',
type: 'POST',
data: {
start: s,
limit: l,
seller: sel,
sort_by: sort,
search: srch,
lang_tag: "<?php echo $lang_tag;?>",
mode: "<?php echo $mode?>"
},
success: function (data) {
jQuery('#recent-product').html(data);
var maxHeight = Math.max.apply(null, jQuery(".seller_profile_view #recent_product .recent_pro").map(function () {
return jQuery(this).height();
}).get());
var tot_width = jQuery('.seller_profile_view_main .recent_pro').parent().width();
var tot_container = parseInt(tot_width / 175);
var tot_container = parseInt((tot_width - (tot_container * 10)) / 175);
var container_remain = (tot_width - (tot_container * 10)) % 175;
var margin_calc = 10 + (container_remain - (tot_container * 2) - 1) / (tot_container + 1);
if (tot_container == 0) {
jQuery('.recent_pro').css('width', "150px");
jQuery('.recent_pro').css('margin-left', '0px!important');
} else if (tot_container == 1) {
jQuery('.recent_pro').css('margin-left', '0px');
jQuery('.recent_pro').css('width', tot_width - 30 + "px");
} else {
jQuery('.recent_pro').css('width', "165px");
jQuery('.recent_pro').css('margin-left', margin_calc);
}
jQuery(".seller_profile_view_main .recent_pro").css('height', maxHeight);
jQuery('.seller_profile_view_main .recent_pro').each(function () {
var pro = jQuery(this).attr('id');
count = 0;
jQuery('.seller_profile_view_main .recent_pro').each(function () {
if (pro == jQuery(this).attr('id')) {
count++;
}
});
if (count > 1) {
jQuery(this).remove();
}
});
}
});
}
//}
jQuery('#clear').on('click', function () {
jQuery('.sortby').val('none');
jQuery('.txt_search').val('');
sortSearch();
});
jQuery('body').on('click', '.wk_fevorite_pro', function () {
var f_id = jQuery(this).attr('id');
var login_check = <?php echo $u_id;?>;
if (login_check > 0) {
jQuery.ajax({
url: '<?php echo JRoute::_("index.php?option=com_marketplace&view=sellerprofile&task=sellerprofile.addFevorite", false);?>',
type: 'POST',
data: {
buyer_id: <?php echo $u_id;?>,
pro_id: f_id,
seller: '<?php echo $seller_id;?>'
},
success: function (data) {
if (data == '1') {
swal({
title: "Thankyou",
text: 'Product added as favourite successfully',
type: "success",
timer: 3000
},
function(){
location.reload(true);
});
} else if (data == 'x') {
swal({
title: "",
text: '<?php echo JText::_('CANNOT_ADD_AS_FAVOURITE');?>',
type: "error",
timer: 3000
});
} else {
swal({
title: "",
text: '<?php echo JText::_('PRODUCT_ALREADY_FAVOURITE');?>',
type: "error",
timer: 3000
});
}
}
});
} else {
swal({
title: "",
text: '<?php echo JText::_('LOGIN_TO_FAVOURITE');?>',
type: "error",
timer: 3000
});
}
});
jQuery('.recent_pro, .recent_pro_md').on('click', '.wk_fevorite_rm_pro', function () {
var f_id = jQuery(this).attr('id');
var login_check = <?php echo $u_id;?>;
if (login_check > 0) {
jQuery.ajax({
url: '<?php echo JRoute::_("index.php?option=com_marketplace&view=sellerprofile&task=sellerprofile.removeFavorite", false);?>',
type: 'POST',
data: {
buyer_id: <?php echo $u_id;?>,
pro_id: f_id,
seller: '<?php echo $seller_id;?>'
},
success: function (data) {
if (data == '1') {
swal({
title: "",
text: "<?php echo JText::_('PRODUCT_REMOVED_SUCCESSFULLY_FROM_FAVOURITE');?>",
type: "success",
timer: 3000
},
function(){
location.reload(true);
});
} else {
swal({
title: "",
text: "<?php echo JText::_('ERROR_IN_REMOVE_FROM_FAVOURITE');?>",
type: "error",
timer: 3000
});
}
}
});
} else {
swal({
title: "",
text: "<?php echo JText::_('LOGIN_TO_REMOVE_FAVOURITE');?>",
type: "error",
timer: 3000
});
}
});
</script>
</div>
</div>