louieseno / ionic-v3-ecommerce-app

Apparel ecommerce applications (School Project)
6 stars 8 forks source link

how can i get order details and shipping in order list #1

Open Ashekboy opened 6 years ago

Ashekboy commented 6 years ago

i really appreciate your effort, i dont know how to write the code to get the details and shipping in order list from this code below, i can only get items list, but i need details lists and shipping list PLEASE IN THE NAME OF GOD, I NEED IT SO MUCH FOR MY PROJECT src\pages\my-order.ts

orderHistory(theUserId){ this.item.length = 0; this.transact.viewUserTransact(theUserId).then(snapshot=>{ let userid = snapshot.val(); console.log(userid); var keys = Object.keys(userid); for(var i = 0 ; i<keys.length; i++) { var k = keys[i]; let myobj ={}; myobj = userid[k].items; myobj['datetime'] = userid[k].dateTime; myobj['keys'] = k; this.item.push(myobj); } } ) }

src\pages\my-order.html

this is the firebase issue issue

louieseno commented 6 years ago

hey man, i cant access my firebase account and try it in my machine right now. The account I used on that was administered by someone and sad to say I don't have any connection with them anymore. But did you try looping in the details or shipment attributes

On Wed, Apr 25, 2018 at 6:54 PM, Ashekboy notifications@github.com wrote:

i really appreciate your effort, i dont know how to write the code to get the details and shipping in order list from this code below, i can only get items list, but i need details lists and shipping list PLEASE IN THE NAME OF GOD, I NEED IT SO MUCH FOR MY PROJECT src\pages\my-order.ts

orderHistory(theUserId){ this.item.length = 0; this.transact.viewUserTransact(theUserId).then(snapshot=>{ let userid = snapshot.val(); console.log(userid); var keys = Object.keys(userid); for(var i = 0 ; i<keys.length; i++) { var k = keys[i]; let myobj ={}; myobj = userid[k].items; myobj['datetime'] = userid[k].dateTime; myobj['keys'] = k; this.item.push(myobj); } } ) }

src\pages\my-order.html

this is the firebase [image: issue] https://user-images.githubusercontent.com/23641200/39241577-528b7f00-487f-11e8-8373-034ff906387c.png [image: issue] https://user-images.githubusercontent.com/23641200/39241586-597f74f6-487f-11e8-9906-ccb2248b287f.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/louieseno/ionic-v3-ecommerce-app/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/Af49gtL2YvEpLG4viNTDVnLQqTXRRZIcks5tsFXcgaJpZM4TjM5c .

louieseno commented 6 years ago

you can try doing the same thing with the item

On Wed, Apr 25, 2018 at 8:07 PM, Louie John Seno senolouiejohn@gmail.com wrote:

hey man, i cant access my firebase account and try it in my machine right now. The account I used on that was administered by someone and sad to say I don't have any connection with them anymore. But did you try looping in the details or shipment attributes

On Wed, Apr 25, 2018 at 6:54 PM, Ashekboy notifications@github.com wrote:

i really appreciate your effort, i dont know how to write the code to get the details and shipping in order list from this code below, i can only get items list, but i need details lists and shipping list PLEASE IN THE NAME OF GOD, I NEED IT SO MUCH FOR MY PROJECT src\pages\my-order.ts

orderHistory(theUserId){ this.item.length = 0; this.transact.viewUserTransact(theUserId).then(snapshot=>{ let userid = snapshot.val(); console.log(userid); var keys = Object.keys(userid); for(var i = 0 ; i<keys.length; i++) { var k = keys[i]; let myobj ={}; myobj = userid[k].items; myobj['datetime'] = userid[k].dateTime; myobj['keys'] = k; this.item.push(myobj); } } ) }

src\pages\my-order.html

this is the firebase [image: issue] https://user-images.githubusercontent.com/23641200/39241577-528b7f00-487f-11e8-8373-034ff906387c.png [image: issue] https://user-images.githubusercontent.com/23641200/39241586-597f74f6-487f-11e8-9906-ccb2248b287f.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/louieseno/ionic-v3-ecommerce-app/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/Af49gtL2YvEpLG4viNTDVnLQqTXRRZIcks5tsFXcgaJpZM4TjM5c .

Ashekboy commented 6 years ago

i have done the same thing for details order.html

{{post.name}}

${{post.price}}

Qty: {{post.qty}}

{{post.datetime}}

Order ID: {{post.orderNumber}}
Payment: {{post.payment}}

oder.ts

orderHistory(theUserId){ this.item.length = 0; this.detail.length = 0; this.transact.viewUserTransact(theUserId).then(snapshot=>{ let userid = snapshot.val(); console.log(userid); var keys = Object.keys(userid); for(var i = 0 ; i<keys.length; i++) { var k = keys[i]; let myobj ={}; let myobjs ={}; myobj = userid[k].items; myobjs = userid[k].details; myobj['datetime'] = userid[k].dateTime; myobj['keys'] = k; this.item.push(myobj); this.detail.push(myobjs); } } ) }

Result issue2 it should be one Order ID and Payment per Order but every Order ID appear twice, i dont want that..Please help me out