diff --git a/src/app/home/content/content-header/content-header.component.html b/src/app/home/content/content-header/content-header.component.html
index 599e43f6..dfdc8083 100644
--- a/src/app/home/content/content-header/content-header.component.html
+++ b/src/app/home/content/content-header/content-header.component.html
@@ -21,5 +21,14 @@
Showing {{productsCount}} of {{productsT
High
-->
+
+
diff --git a/src/app/home/content/content-header/content-header.component.ts b/src/app/home/content/content-header/content-header.component.ts
index 0c29a451..79a794ca 100644
--- a/src/app/home/content/content-header/content-header.component.ts
+++ b/src/app/home/content/content-header/content-header.component.ts
@@ -1,3 +1,4 @@
+import { Router } from '@angular/router';
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
@Component({
@@ -11,9 +12,23 @@ export class ContentHeaderComponent implements OnInit {
@Input() productsCount;
@Input() productsTotal_count;
+ options = [
+ { name: 'Newest', value: 1 },
+ { name: 'A To Z', value: 2 },
+ { name: 'Z To A', value: 3 }
+ ]
+ queryMap = {
+ Newest: 'updated_at+asc',
+ Relevance: '',
+ 'A To Z': 'ascend_by_master_price',
+ 'Z To A': 'name+desc',
+ }
+
+ selectedOption: 'Relevance';
+
selectedSize = 'COZY';
searchKeyword = ''
- constructor() { }
+ constructor(private routernomal: Router) { }
ngOnInit() {
@@ -32,4 +47,12 @@ export class ContentHeaderComponent implements OnInit {
return this.selectedSize === 'COMPACT';
}
+ sortFilter() {
+ const urlTree = this.routernomal.createUrlTree([], {
+ queryParams: { 'q[s]': this.queryMap[this.selectedOption] },
+ queryParamsHandling: 'merge',
+ preserveFragment: true
+ });
+ this.routernomal.navigateByUrl(urlTree);
+ }
}
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index 6f194626..c642e4d8 100644
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -48,7 +48,6 @@ export class HomeComponent implements OnInit {
products: any;
isProducts = false;
isFilterOn = false;
- gopal = false;
constructor(
private store: Store,
diff --git a/src/app/home/sidebar/categories/categories.component.html b/src/app/home/sidebar/categories/categories.component.html
index 5fc8e56c..a9d587f7 100644
--- a/src/app/home/sidebar/categories/categories.component.html
+++ b/src/app/home/sidebar/categories/categories.component.html
@@ -12,6 +12,7 @@ Catgeories