Subversion Repositories SmartDukaan

Rev

Rev 19636 | Rev 19639 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19636 Rev 19638
Line 67... Line 67...
67
		}
67
		}
68
		
68
		
69
			
69
			
70
		if(brandarr.length != 0 && subcatarr.length == 0)
70
		if(brandarr.length != 0 && subcatarr.length == 0)
71
		{
71
		{
72
			if(whatfirst == "subCategory"){
-
 
73
				whatfirst = "brand";
72
			whatfirst = "brand";
74
			}
-
 
75
			url = url + "brands="+brandarr.join('^');
73
			url = url + "brands="+brandarr.join('^');
76
		}
74
		}
77
		
75
		
78
		else if(brandarr.length == 0 && subcatarr.length != 0)
76
		else if(brandarr.length == 0 && subcatarr.length != 0)
79
		{
77
		{
80
			if(whatfirst == "brand"){
-
 
81
				whatfirst = "subCategory";
78
			whatfirst = "subCategory";
82
			}
-
 
83
			url = url + "subcategories="+subcatarr.join('^');
79
			url = url + "subcategories="+subcatarr.join('^');
84
		}
80
		}
85
		else if(brandarr.length != 0 && subcatarr.length != 0)
81
		else if(brandarr.length != 0 && subcatarr.length != 0)
86
		{
82
		{
87
			url = url + "brands="+brandarr.join('^')+"&subcategories="+subcatarr.join('^');
83
			url = url + "brands="+brandarr.join('^')+"&subcategories="+subcatarr.join('^');
Line 102... Line 98...
102
 
98
 
103
	$('.downselect').click(function(){
99
	$('.downselect').click(function(){
104
		
100
		
105
		var urldet = getJsonFromUrl();
101
		var urldet = getJsonFromUrl();
106
		var whatfirst = "";
102
		var whatfirst = "";
107
	    if(urldet['whatfirst'] !=undefined){
-
 
108
	    	whatfirst = urldet['whatfirst'];
-
 
109
	    }
-
 
110
		var that = $(this);
103
		var that = $(this);
111
		var brandid = that.attr('data-brandid');
104
		var brandid = that.attr('data-brandid');
112
		var subcatid = that.attr('data-subCategoryid');
105
		var subcatid = that.attr('data-subCategoryid');
113
		var subcatarr =[];
106
		var subcatarr =[];
114
		var brandarr = [];
107
		var brandarr = [];
Line 119... Line 112...
119
		}
112
		}
120
		
113
		
121
		if(urldet['subcategories'] != undefined){
114
		if(urldet['subcategories'] != undefined){
122
			subcatarr = urldet['subcategories'].split("^");
115
			subcatarr = urldet['subcategories'].split("^");
123
		}
116
		}
-
 
117
 
-
 
118
		if(urldet['whatfirst'] !=undefined){
-
 
119
	    	whatfirst = urldet['whatfirst'];
-
 
120
	    }else if(urldet['whatfirst'] == undefined){
-
 
121
	    	if(brandarr.length != 0 && subcatarr.length == 0){
-
 
122
				whatfirst = "brand";
-
 
123
		    }else if(brandarr.length == 0 && subcatarr.length != 0){
-
 
124
				whatfirst = "subCategory";	
-
 
125
			}
-
 
126
		 }
124
		
127
		
125
		if(that.attr('data-type') == "brand"){			
128
		if(that.attr('data-type') == "brand"){			
126
			if(jQuery.inArray(brandid, brandarr) !== -1){
129
			if(jQuery.inArray(brandid, brandarr) !== -1){
127
					var y = jQuery.grep(brandarr, function(value) {
130
					var y = jQuery.grep(brandarr, function(value) {
128
						  return value != brandid;
131
						  return value != brandid;
Line 260... Line 263...
260
<?php $catstr = explode("^",$subcategories);?>
263
<?php $catstr = explode("^",$subcategories);?>
261
 
264
 
262
 <ul class="nav nav-tabs catselect">
265
 <ul class="nav nav-tabs catselect">
263
<?php foreach($categories AS $catId => $name):?>
266
<?php foreach($categories AS $catId => $name):?>
264
	
267
	
265
  	<li class=" tab_layout <?php if((isset($id)) && $catId == $id):?>active<?php endif;?> col-xs-<?php echo (12/(count($categories)+1));?>">
268
  	<li class=" tab_layout <?php if((isset($id)) && $catId == $id):?>active<?php endif;?> col-xs-<?php echo (12/(count($categories)));?>">
266
	    <a href="/category/<?php echo $catId;?>"<?php if($id!=6 && $catId==6):?> id="popovertrigger4" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Accessories at wholesale rates"<?php endif;?>>
269
	    <a href="/category/<?php echo $catId;?>"<?php if($id!=6 && $catId==6):?> id="popovertrigger4" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Accessories at wholesale rates"<?php endif;?>>
-
 
270
	    	<?php if($catId==6):?>
-
 
271
	    		Accessories
-
 
272
	    	<?php else:?>
267
	    	<?php echo $name;?>
273
	    		<?php echo $name;?>
-
 
274
	    	<?php endif;?>
268
	    </a>
275
	    </a>
269
    </li>
276
    </li>
270
<?php endforeach;?>		
277
<?php endforeach;?>		
271
</ul>
278
</ul>
272
<div class="filters row" >	
279
<div class="filters row" >