pages/account/index.js
/**
   * Get the customer's shipping address
   */
Get the customer's shipping address
Get the customer ' s shipping address
renderShippingAddress() {
    const { orders } = this.state;
    const { t } = this.props;
    if (!orders || !orders.length) {
      return (
        <div>
          {t('account.noOrdersYet')}
        </div>
      );
    }
    const { shipping } = this.state.orders[0];
    if (!shipping) {
      return null;
    }
    return (
      <div>
        <div>{ shipping.name }</div>
        <div>{ shipping.street }</div>
        { shipping.street_2 && <div>{ shipping.street_2 }</div> }
        <div>{ shipping.town_city}{(shipping.town_city && shipping.county_state) ? ',':'' } { shipping.county_state }</div>
        <div>{ shipping.country}{(shipping.country && shipping.postal_zip_code) ? ',':'' } { shipping.postal_zip_code }</div>
      </div>
    );
  }
renderShippingAddress ( ) { const { orders } = this . state ; const { t } = this . props ; if ( ! orders || ! orders . length ) { return ( < div > { t ( 'account.noOrdersYet' ) } < / div > ) ; } const { shipping } = this . state . orders [ 0 ] ; if ( ! shipping ) { return null ; } return ( < div > < div > { shipping . name } < / div > < div > { shipping . street } < / div > { shipping . street_2 && < div > { shipping . street_2 } < / div > } < div > { shipping . town_city } { ( shipping . town_city && shipping . county_state ) ? ',' : '' } { shipping . county_state } < / div > < div > { shipping . country } { ( shipping . country && shipping . postal_zip_code ) ? ',' : '' } { shipping . postal_zip_code } < / div > < / div > ) ; }
Get the customer's shipping address
Get the customer ' s shipping address