Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry Payment & Sortfilters #225

Merged
merged 2 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/app/checkout/order-failed/order-failed.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div class="col-12 thankyou thankyou1 shadow-sm mt-5 mb-3">
<div class="row">
<div class="col-12 col-sm-9">

<h1>Payment Failed</h1>
<h5 *ngIf=errorReason>Reason: {{errorReason}}</h5>
<div class="float-left close-btn">
Expand All @@ -14,9 +13,9 @@ <h5 *ngIf=errorReason>Reason: {{errorReason}}</h5>
</div>
</div>
<div class="col-12 col-sm-3 text-right">
<button class="btn themebtnprimary" (click)="retryPayment(orderDetails)">
Retry Payment
</button>
<button class="btn themebtnprimary" (click)="retryPayment(orderDetails)">
Retry Payment
</button>
</div>
</div>

Expand Down Expand Up @@ -99,4 +98,4 @@ <h3>Item(s)</h3>
</div>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/app/core/services/product.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ProductService {
getProducts(pageNumber: number): Observable<Array<Product>> {
return this.http
.get<{ data: CJsonApi[] }>(
`api/v1/products?page=${pageNumber}&per_page=20&data_set=small`
`api/v1/products?q[s]=avg_rating+desc&page=${pageNumber}&per_page=20&data_set=small`
)
.pipe(
map(
Expand Down Expand Up @@ -143,7 +143,7 @@ export class ProductService {
getproductsByKeyword(keyword: string): Observable<any> {
return this.http
.get<{ data: CJsonApi[]; pagination: Object }>(
`api/v1/products?${keyword}&per_page=20&data_set=small`
`api/v1/products?${keyword}&per_page=20&data_set=small&${+new Date()}`
)
.pipe(
map(resp => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h4 title="men casual shirts">Showing {{paginationInfo.count}} of {{paginationIn
</span>
</button>
</li>
<li *ngFor="let entry of optionsMobile; let idx = index">
<li *ngFor="let entry of options; let idx = index">
<input type="radio" name="radiogroup" id="test{{idx}}" [checked]="idx === entry.name" [value]="entry.id" (change)="onSelectionChange(entry)">
<label for="test{{idx}}">{{ entry.name }}</label>
</li>
Expand Down Expand Up @@ -76,14 +76,13 @@ <h4 title="men casual shirts">Showing {{paginationInfo.count}} of {{paginationIn
</button>
</li>
</ul>
<app-filter-mobile-menu (fltermodelstate)="fltermodelstate($event)" (selectedItemEmit)="selectedInput($event)"
(childselectedItememit)="childselectedInput($event)"
<app-filter-mobile-menu (fltermodelstate)="fltermodelstate($event)" (selectedItemEmit)="selectedInput($event)" (childselectedItememit)="childselectedInput($event)"
[fillterList]="fillterList" [subselectedItem]="subselectedItem" [childselectedItem]="childselectedItem"></app-filter-mobile-menu>
</div>


</div>
</div>
</div>
</div>
</div>
</div>
</div>
27 changes: 9 additions & 18 deletions src/app/home/content/content-header/content-header.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Router } from '@angular/router';
import { Component, OnInit, Output, EventEmitter, Input, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { ModalDirective } from 'ngx-bootstrap/modal';
import { Component, OnInit, Output, EventEmitter, Input, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-content-header',
templateUrl: './content-header.component.html',
Expand All @@ -17,18 +16,17 @@ export class ContentHeaderComponent implements OnInit {

options = [
{ name: 'Newest', value: 1 },
{ name: 'A To Z', value: 2 },
{ name: 'Z To A', value: 3 },
{ name: 'Relevence', value: 4 }
]
optionsMobile = [
{ name: 'Newest', value: 1 },
{ name: 'A To Z', value: 2 },
{ name: 'Z To A', value: 3 },
{ name: 'Relevence', value: 4 }
{ name: 'Avg.Customer Review', value: 2 },
{ name: 'Most Reviews', value: 3 },
{ name: 'A To Z', value: 4 },
{ name: 'Z To A', value: 5 },
{ name: 'Relevence', value: 6 }
]

queryMap = {
Newest: 'updated_at+asc',
'Avg.Customer Review': 'avg_rating+desc',
'Most Reviews': 'reviews_count+desc',
'A To Z': 'name+asc',
'Z To A': 'name+desc',
Relevance: '',
Expand All @@ -44,9 +42,6 @@ export class ContentHeaderComponent implements OnInit {
defaultselectedEntry = 'Relevance';
constructor(private routernomal: Router) { }

// tslint:disable-next-line:member-ordering


sortModalShow() { this.issortModalShown = true; }
sortModalhide() { this.issortModalShown = false; }

Expand All @@ -57,7 +52,6 @@ export class ContentHeaderComponent implements OnInit {
this.isfilterModalShown = false;
}


onSelectionChange(entry) {
this.selectedEntry = entry;
this.sortFilter(this.selectedEntry.name);
Expand Down Expand Up @@ -95,8 +89,6 @@ export class ContentHeaderComponent implements OnInit {

}



sortFilter(i) {
const urlTree = this.routernomal.createUrlTree([], {
queryParams: { 'q[s]': this.queryMap[i] },
Expand All @@ -106,5 +98,4 @@ export class ContentHeaderComponent implements OnInit {
this.routernomal.navigateByUrl(urlTree);
this.selectedOption = i;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Store } from '@ngrx/store';
import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { environment } from '../../../../environments/environment';

@Component({
selector: 'app-product-list',
templateUrl: './product-list.component.html',
Expand Down
7 changes: 4 additions & 3 deletions src/app/landing/landing.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<app-lp-banner></app-lp-banner>
<button type="button" class="btn shippingbtn d-block d-sm-none"> FREE 1-2 DAY SHIPPING OVER &#8377;699!
<button type="button" class="btn shippingbtn d-block d-sm-none"> FREE 1-2 DAY SHIPPING OVER {{currency}}{{freeShippingAmount}}
<i class="fa ml-2 fa-truck" aria-hidden="true"></i>
</button>
<div class="container my-5">
<app-lp-product-list [products]="products_by_taxons$ | async" [dealsType]="dealsType" [dealsId]="taxons_id"> </app-lp-product-list>
<app-lp-product-list [products]="favoriteProducts$ | async" dealsType="Customer Favourites" [dealsId]="taxons_id"> </app-lp-product-list>
<app-lp-product-list [products]="products$ | async" dealsType="Top Rated Brands" [dealsId]="taxons_id"> </app-lp-product-list>
<app-lp-product-list [products]="products$ | async" dealsType="Top Rated Products" [showRating]="true" [dealsId]="taxons_id">
</app-lp-product-list>
<app-lp-promo> </app-lp-promo>
<app-lp-brands [brands]="brands$ | async"></app-lp-brands>
</div>
</div>
13 changes: 6 additions & 7 deletions src/app/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import { Product } from '../core/models/product';
})
export class LandingComponent implements OnInit {
products$: Observable<any>;
products_by_taxons$: Observable<any>;
products_by_taxons$: Observable<any>;
taxon_by_name: any;
taxons_id: string;
favoriteProducts$: any;
dealsType = environment.config.Deals.type;
brands$: Observable<any>;


freeShippingAmount = environment.config.freeShippingAmount;
currency = environment.config.currency_symbol;

// dealsType is taxonomi whose value is set in app-data.ts;

Expand All @@ -49,8 +49,7 @@ export class LandingComponent implements OnInit {
return []
}
}))
// .subscribe(response => this.products_by_taxons = response);
this.favoriteProducts$ = this.productService.getFavoriteProducts();
this.favoriteProducts$ = this.productService.getFavoriteProducts();
}

ngOnInit() {
Expand All @@ -63,8 +62,8 @@ export class LandingComponent implements OnInit {
this.meta.updateTag({ name: 'title', content: environment.config.landing_page.title });
this.meta.updateTag({ name: 'apple-mobile-web-app-title', content: environment.appName });
this.meta.updateTag({ property: 'og:description', content: environment.config.landing_page.description })
this.meta.updateTag({ property: "og:url", content: environment.config.frontEndUrl }),
this.meta.updateTag({ property: 'twitter:title', content: environment.config.landing_page.description })
this.meta.updateTag({ property: 'og:url', content: environment.config.frontEndUrl }),
this.meta.updateTag({ property: 'twitter:title', content: environment.config.landing_page.description })
this.metaTitle.setTitle(environment.config.landing_page.title);
}
}
4 changes: 3 additions & 1 deletion src/app/landing/landing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { BrandsPageComponent } from './brands-page/brands-page.component';
import { AboutUsComponent } from './about-us/about-us.component';
import { FaqPageComponent } from './faq-page/faq-page.component';
import { ReturnPolicyComponent } from './return-policy/return-policy.component';
import { NgxInputStarRatingModule } from '@ngx-lite/input-star-rating';

const COMPONENTS = [
LandingComponent,
Expand All @@ -33,7 +34,8 @@ const COMPONENTS = [
CommonModule,
LandingRoutingModule,
CarouselModule,
SharedModule
SharedModule,
NgxInputStarRatingModule
],
declarations: [...COMPONENTS]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<a class="section-title h3" (click)="getDeals()">{{dealsType}}</a>
</div>
</div>
<app-product-slider [productsList]="products"></app-product-slider>
<app-product-slider [productsList]="products" [showRating]="showRating"></app-product-slider>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class LpProductListComponent implements OnInit {
@Input() products;
@Input() dealsType;
@Input() dealsId;
@Input() showRating: boolean;

constructor(
private searchActions: SearchActions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div *ngIf="!isMobile">

<div *ngIf="!isAuthenticated">
<div class="btn helpbtn" [ngClass]="[isOpen ? 'openhelp':'']" (mouseenter)="dropdown.show()" (mouseleave)="dropdown.hide()">
<strong>Login & SignUp</strong>
Expand Down Expand Up @@ -46,10 +45,6 @@
<a class="dropdown-item" routerLink="/user/addresses">Saved Addresses</a>
</li>
<li class="divider dropdown-divider"></li>
<li role="menuitem">
<a class="dropdown-item" href="#">Edit Profile</a>
</li>
<li class="divider dropdown-divider"></li>
<li role="menuitem">
<a class="dropdown-item" (click)="logout()">Logout</a>
</li>
Expand All @@ -58,11 +53,6 @@
</div>
</div>






</div>
<div *ngIf="isMobile" class="mobileusericon">
<i class="fa fa-user mr-2" (click)="login()" aria-hidden="true" *ngIf="!isAuthenticated"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<app-product-price-info [brand]="brand" [product]="product" (onAddToCart)="addToCart($event)" (onMarkAsFavorites)="markAsFavorite()"
(selectedVariant)="selectVariant($event)" class="row">
</app-product-price-info>

</div>
</div>
</div>
Expand Down Expand Up @@ -92,7 +91,6 @@ <h1 itemprop="name" class="title">{{product.name}}</h1>
<app-product-price-info [product]="product" [isMobile]='isMobile' (onAddToCart)="addToCart($event)" (onMarkAsFavorites)="markAsFavorite()"
(selectedVariant)="selectVariant($event)" class="row">
</app-product-price-info>

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h4 class="check-head">Check COD Availability</h4>
<form [formGroup]="checkPincodeForm" (ngSubmit)="checkCodAvilability()" class="d-block">
<div class="form-inline">
<div class="form-group mr-sm-3 mr-3 mt-3 mt-sm-0">
<input type="text" onkeypress="return event.charCode >= 48 && event.charCode <= 57" class="form-control" name="pincode" placeholder="Postal/Pin code"
<input type="text" class="form-control" name="pincode" placeholder="Postal/Pin code"
formControlName="pincode">
</div>
<button type="submit" class="btn themebtnprimarybasic" [disabled]=!checkPincodeForm.valid>Check</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="product-tile">
<a [routerLink]="['/', product.slug]">
<img width="150" height="200" [src]="product.product_url">
<ngx-input-star-rating *ngIf="showRating" value="{{product.avg_rating}}" disabled="true"></ngx-input-star-rating>
<p> {{ product.name }} </p>
</a>
<ngx-input-star-rating *ngIf="product.avg_rating === 0" value="{{product.avg_rating}}" disabled="true"></ngx-input-star-rating>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Component, OnInit, Input, ChangeDetectionStrategy, OnChanges } from '@a
})
export class InnerIproductComponent implements OnInit {
@Input() product: Product;
@Input() showRating: boolean;

constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<section class="mt-3" *ngIf="productsList?.length">
<ngu-carousel [inputs]="carouselOne">
<ngu-item class="col-6 col-sm-4 col-md-3 col-lg-2 product-box m-1 card" *ngFor="let product of productsList" NguCarouselItem>
<app-inner-product
[product]="product">
<ngu-item class="col-6 col-sm-4 col-md-3 col-lg-2 product-box m-1 card" *ngFor="let product of productsList" NguCarouselItem>
<app-inner-product [product]="product" [showRating]="showRating">
</app-inner-product>
</ngu-item>
<button NguCarouselPrev class='leftRs d-none d-sm-block'></button>
<button NguCarouselNext class='rightRs d-none d-sm-block'></button>
</ngu-carousel>
<hr>
</section>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core
export class ProductSliderComponent implements OnInit {
@Input() productsList = new Array(10);
public carouselOne: NguCarousel;

@Input() showRating: boolean;
constructor() {
this.carouselOne = {
grid: {xs: 1, sm: 1, md: 2, lg: 5, all: 0},
grid: { xs: 1, sm: 1, md: 2, lg: 5, all: 0 },
slide: 2,
speed: 400,
animation: 'lazy',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ <h3>Order Details</h3>
<b class="text-uppercase">{{order.payment_state | humanize | uppercase}}</b>
</td>
</tr>
<tr>
<td> Payment Source:</td>
<td>{{order.payments[0]?.payment_method?.name}}</td>
</tr>
<tr *ngIf="order.payment_state!= 'paid' && order.payments[0]?.payment_method?.name === payubiz">
<td>
<button class="btn themebtnprimary" (click)="retryPayment(order)">Retry Payment</button>
</td>
</tr>
</table>
</div>
<div class="col-12 col-sm-6">
Expand Down Expand Up @@ -73,10 +82,10 @@ <h4 class="ptitle">
</a>
</h4>
<h6 class="ptitle">
<a [routerLink]="['/', line_item.variant.slug]">
{{line_item.variant.options_text}}
</a>
</h6>
<a [routerLink]="['/', line_item.variant.slug]">
{{line_item.variant.options_text}}
</a>
</h6>
</div>

<div class="col-md-3">
Expand Down
Loading