Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Kim Bantz Rasmussen 81 posts 310 karma points
    Nov 12, 2013 @ 09:32
    Kim Bantz Rasmussen
    0

    Basket won't work - json error

    Hi,

    Umbraco 6.1 MVC with uCommerce Razor demo store installed. I have my shop located in website/shop and have changed the rewrite a bit to make that work.

    I get this error when trying to put something in my basket:

    Failed to load resource: the server responded with a status of 500 (InvalidOperationException)

    http://living.shol.dk/ucommerceapi/Json/SyncReply/AddToBasket 

     

    Best regards
    Kim

  • Morten Skjoldager 440 posts 1499 karma points
    Nov 12, 2013 @ 10:06
    Morten Skjoldager
    0

    Did you get it working now ? 

    I just added a few bits to the cart. Looks like it is using JS ? 

  • Morten Skjoldager 440 posts 1499 karma points
    Nov 12, 2013 @ 10:16
    Morten Skjoldager
    0

    Also i just tried using POSTMAN plugin for chrome to do a POST to the javascript API. It seems to be working. Remember to send the correct values. You need to send at least these values:

    Sku,

    VariantSku,

    Quantity

     

    You can allways take a look at the meta data for the servies:

    http://living.shol.dk/ucommerceapi/

    http://living.shol.dk/ucommerceapi/xml/metadata?op=AddToBasket

     

    Hope that helps.

  • Kim Bantz Rasmussen 81 posts 310 karma points
    Nov 12, 2013 @ 11:47
    Kim Bantz Rasmussen
    0

    Hi Morten,

    No, I did not get it to work :(

    I have not made any changes to the product template from the demo shop ...  

    Any ideas?

  • Morten Skjoldager 440 posts 1499 karma points
    Nov 12, 2013 @ 12:50
    Morten Skjoldager
    0

    Well it looks like the request is corrupt - not sending the correct values. And this is again because i can call the API from a tool and get a 200 back (and see that the  basket has updated),.

    I would take a look at the javascriptfile uCommerce.Jquery. Try to make a console.log(extendedOptions); in the addtobasket method and see what it says.

    doing so on demo.ucommerce.net got me this when i added something to the basket:

    Object {quantity: "1", sku: "GHXG-4044-7604-1", variantSku: "GHXG-4044-7604-1-SML-White/Red", addToExistingLine: true, catalogId: "24"} 

    You can edit the scripting file directly from umbraco under settings/scripts/uCommerce.Jquery 

    Hope that helps.

  • Kim Bantz Rasmussen 81 posts 310 karma points
    Nov 12, 2013 @ 13:01
    Kim Bantz Rasmussen
    0

    Doing a console.log is giving me:

    Object {quantity: "1", sku: "traning123", variantSku: "", addToExistingLine: true, catalogId: "24"} ucommerce.jquery.js:35
  • Morten Skjoldager 440 posts 1499 karma points
    Nov 13, 2013 @ 14:34
    Morten Skjoldager
    100

    When i call AddToBasket with those exact parameters it works. I even refresh the page and see that the products are in the basket. 

  • Kim Bantz Rasmussen 81 posts 310 karma points
    Nov 13, 2013 @ 15:10
    Kim Bantz Rasmussen
    0

    Okay, that is strange - it works in FF, IE and my colleagues Chrome browser, but in my own Chrome it doesn't! I will try with a reinstall.

    Sorry for the inconvenience!

    Best regards
    Kim 

     

  • Morten Skjoldager 440 posts 1499 karma points
    Nov 13, 2013 @ 15:32
    Morten Skjoldager
    0

    There might be a caching problem. Try using a Incognito window. 

Please Sign in or register to post replies

Write your reply to:

Draft