<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start" *ngIf="name!=0">
      <ion-back-button icon="arrow-round-back"></ion-back-button>
    </ion-buttons>
    <ion-menu-button slot="start" *ngIf="name==0">
      <ion-icon name="menu"></ion-icon>
    </ion-menu-button>
    <ion-title *ngIf="name==0">
      {{'Categories'|translate}}
    </ion-title>
    <ion-title *ngIf="name!=0">
      {{name}}
    </ion-title>
    <ion-buttons slot="end">
      <ion-button fill="clear" routerLink="/search" routerDirection="forward">
        <ion-icon slot="icon-only" name="search"></ion-icon>
      </ion-button>
      <ion-button fill="clear" routerLink="/cart" routerDirection="forward">
        <ion-icon name="basket"></ion-icon>
        <ion-badge color="secondary">{{shared.cartTotalItems()}}</ion-badge>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>
<ion-content>
  <ion-item lines="full" *ngFor="let c of shared.getCategoriesPageItems(parent)" (click)="openProducts(c.id,c.name)"
    class="animate-item">
    <ion-thumbnail slot="start" class="animate-item delay-500ms">
      <img *ngIf="c.image" src="{{c.image.src}}" />
    </ion-thumbnail>
    <ion-label class="ion-padding">
      <ion-text>
        <h2>{{c.name|translate}}</h2>
        <p>{{c.count}} {{'Products'| translate }}</p>
      </ion-text>
    </ion-label>
  </ion-item>
  <div class="ion-text-center">
    <ion-button *ngIf="parent!=0" icon-end clear color="secondary" (click)="openParentProducts()">
      {{ 'View All' | translate }}
      <ion-icon name="md-arrow-dropright"></ion-icon>
    </ion-button>
  </div>

</ion-content>