c-topherl / brewCom

0 stars 0 forks source link

get_order_detail #33

Closed c-topherl closed 8 years ago

c-topherl commented 8 years ago

Implement this.

joelmeister commented 8 years ago

does this not work?

joelmeister commented 8 years ago

I just tested it and it does work

c-topherl commented 8 years ago

Can you show me a sample request that works? I'm getting a blank response. It looks like your $order_id variable is never initialized in get_order_detail.

{ "function":"get_order_detail", "order_id":"14" }

{"response":{"order_details":[]},"status":"success","message":"Order details successfully read"}

joelmeister commented 8 years ago

fixed. I had changed the code because i was originally returning the details as part of the regular get_orders function, but split them up. also, order_id 14 doesnt have any details, try 13 instead.

c-topherl commented 8 years ago

Order details is now an object, not an array!

{
"response":{
"order_details":{
"2":{
"id":"2", "price":"123.99", "quantity":"10", "product_id":"2", "product_code":"joels", "product_description":"joels favorite beer", "unit_id":"1", "unit_code":"jrm", "unit_description":"joels unit" }, "3":{
"id":"3", "price":"123", "quantity":"10", "product_id":"3", "product_code":"porter1", "product_description":"The #1 porter", "unit_id":"1", "unit_code":"jrm", "unit_description":"joels unit" } } }, "status":"success", "message":"Order details successfully read" }

joelmeister commented 8 years ago

damnit fixed

c-topherl commented 8 years ago

Works