Copied to clipboard

Flag this post as spam?

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


  • Robert 30 posts 110 karma points
    Aug 15, 2013 @ 10:55
    Robert
    0

    calling addOrUpdateOrderLine - The model doesn't have a store id associated with it - but it does!

    I'm running Umbraco 6.1.3 and TeaCommerce 2.1.2

    I'm following the examples on http://documentation.teacommerce.net/javascript-api/order-lines/addorupdateorderline/

    I keep getting the error:INNEREXCEPTION:System.ArgumentException: The model doesn't have a store id associated with it - remember to add the Tea Commerce store picker to your Umbraco content tree when trying to add to basket: 

    I've added a tea commerce store picker to my root and can see in my source it's writing out a javascript variable storeId = 1

    I've tried many different ways including: 

    TC.addOrUpdateOrderLine({ 'productIdentifier': 999, 'quantity': 4, 'properties': { color: 're1d', size: '410' }, 'storeId': 1}); TC.addOrUpdateOrderLine({ productIdentifier: fullSku, quantity: 1, storeId:storeId}); TC.addOrUpdateOrderLine({ 'storeId': storeId, 'productIdentifier': 1262, 'quantity': 1 })

    Can't seem to get it adding to basket.I know my store Id is 1 from looking in the database Any ideas?

    Thanks Rob  

  • Anders Burla 2560 posts 8256 karma points
    Aug 15, 2013 @ 10:59
    Anders Burla
    0

    Have you published all your content. Tried and refresh the Umbraco xml cache?

    Kind regards
    Anders

  • Robert 30 posts 110 karma points
    Aug 15, 2013 @ 11:06
    Robert
    0

    Thanks for the amazing quick response. Yes I've re-published the website from the root content node, re-started IIS.

    If I do: var order = TC.getCurrentOrder({ storeId: storeId });

    it works fine and creates me a row in the teacommerce order table with my hash.

    even when I hard code the store id in the url it doesn't work.

  • Anders Burla 2560 posts 8256 karma points
    Aug 15, 2013 @ 11:07
    Anders Burla
    0

    Could you take a screenshot of your umbraco node structure - what node/product you try to add - and where the store picker is added as a property?

  • Robert 30 posts 110 karma points
    Aug 15, 2013 @ 11:15
    Robert
    0

    The web store dropdown is equal to the first Master Catalogues

    I've had to clear out the name of the client. the webstore is under the first node under Content and is equal to the first node under Master Catalogue.

  • Anders Burla 2560 posts 8256 karma points
    Aug 15, 2013 @ 11:39
    Anders Burla
    100

    Could you make a circle around the umbraco node that have the id 999 - which is the one that you try to add?

  • Robert 30 posts 110 karma points
    Aug 15, 2013 @ 12:01
    Robert
    0

    Hi,

    You pointed me in the correct direction with your last message.

    Basically: TC.addOrUpdateOrderLine({ 'productIdentifier': 999, 'quantity': 4, 'properties': { color: 're1d', size: '410' }, 'storeId': 1});

    The productIdentifier was pointing to the actual product under the 'Master Catalogues' what it needed to point to was under the Website -> Catalogue -> product (this is just a doc type with a content link to the actual master product).

    This now works.

    Thanks for your very quick responses and pointing me in the right direction.

    Rob

  • Anders Burla 2560 posts 8256 karma points
    Aug 15, 2013 @ 12:10
    Anders Burla
    0

    No problem - glad you got it solved! :)

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft