jasonknight / woocommerce-json-api

A simple, Abstract JSON API for Wordpress' Awesome Plugin: WooCommerce
58 stars 21 forks source link

More String Responses instead of Array #32

Closed michaelfranzl closed 11 years ago

michaelfranzl commented 11 years ago

get_coupons -> payload -> product_ids get_coupons -> payload -> exclude_product_ids

are returned as strings

"payload": [
    {
      "id": "21",
      "code": "cc1",
      "slug": "cc1",
      "type": "shop_coupon",
      "publishing": "publish",
      "discount_type": "fixed_cart",
      "value": "10",
      "is_exclusive": "yes",
      "limit": "100",
      "product_ids": "15,16",
      "exclude_product_ids": "19",
      "expiry_date": "2013-09-25",
      "is_before_tax": "yes",
      "is_shipping_free": "",
      "will_exclude_sale_products": "yes",
      "product_category_ids": [
        13,
        14
      ],
      "exclude_product_category_ids": [
        13,
        14
      ],
      "minimum_total": "3",
      "customer_email": [
        "a@b.c",
        "d@e.g"
      ]
    }
  ],
jasonknight commented 11 years ago

Possibly fixed in latest commit

michaelfranzl commented 11 years ago

It's fixed, however there is a small 'aesthetics' issue: When the array is empty, it returns an array with size of 1, containing an empty string:

      "product_category_ids": [
        ""
      ],
      "exclude_product_category_ids": [
        ""
      ],