Code Monkey home page Code Monkey logo

android-sdk's People

Contributors

marek1985 avatar outrunthewolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sdk's Issues

Cart contents returns object

Note: I don't believe this is an actual issue with the SDK, but rather with the backend response. And this also might be related to creating Customer objects.

In the docs for the Cart object, it shows that the contents field should be an array of products added to the cart. When I use moltin.cart.contents(callback); the response correctly returns an array when the contents field is empty. However, when there are any number of items in the cart (tested with 1, 2, and 3 items), the response contains an object of objects with unique keys for each object.

Here is an example:

{
  "3a3460afc114c682a3a1e9f66c20e4c4": {
    "id": "1378365502061019855",
    "quantity": 2,
    "limit": 10,
    "offset": 0,
    "order": null,
    "created_at": "2016-11-07 15:53:13",
    "updated_at": "2016-11-07 22:07:23",
    "sku": "001",
    "title": "Boots",
    "slug": "booties",
    "sale_price": 39.99,
    ...
  },
  "b104bcc99d675bb55bed9b4e03baef57": {
    "id": "1378783908706910272",
    "quantity": 1,
    "limit": 10,
    "offset": 0,
    "order": null,
    "created_at": "2016-11-08 05:44:31",
    "updated_at": "2016-11-08 05:44:31",
    "sku": "003",
    "title": "White jacket",
    "slug": "white-jacket",
    "sale_price": 5.99,
    ...
}

I'm trying to hold off on collecting customer information until they are ready to checkout.
Any help is appreciated - thanks!

Variant id in response equals Modifier id

         "modifiers":{  
            "1390253840774726537":{ ... },
            "1390255856766944148":{  
               "id":"1390255856766944148",
               "data":{  
                  "type":{  
                     "value":"Variant",
                     "data":{  
                        "key":"variant",
                        "value":"Variant"
                     }
                  },
                  "title":"Color",
                  "product":"1378365502061019855"
               },
               "var_title":"Black",
               "var_price":"+$0.00",
               "var_id":"1390255856766944148"
            }
         }

When getting the variations associated with a specific product (the above json is apart of a specific product variation), the modifiers object (which I believe should actually be an array) contains the correct modifiers as indicated by their id's as the keys. In those objects, there is some data about the variant shown by var_{field}. Shown above is var_title, var_price, and var_id. The var_id is returning incorrectly and is actually just the same id as the modifier it is associated with. In my case, the var_id should actually be 1390263527645643676.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.