Copied to clipboard

Flag this post as spam?

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


  • seanrock 99 posts 173 karma points
    Jun 18, 2013 @ 09:55
    seanrock
    0

    TeaCommerce is not defined

    Hi

    I've installed tea commerce and eventually got it to work (install this as the admin user and save yourself some headache). However now that i'm working through the example shown here i'm now getting the above js error. I've included the tea-commerce.js file and as far as i can see the code is in order. Any ideas?

    Thanks
    Sean

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 19, 2013 @ 08:53
    Anders Burla Johansen
    0

    Hi Sean

    Did you install Tea Commerce 2? Because the blog post you is referering is for 1.x - so that might be the problem :)

    The concepts are the same but some of the code should be done in slightly a different way.

    Kind regards
    Anders

  • seanrock 99 posts 173 karma points
    Jun 19, 2013 @ 09:08
    seanrock
    0

    Hi Anders

    Thanks for your reply. Yes I have installed v2.1.2. I made the obvious mistake assuming the links where for the current version.

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 19, 2013 @ 09:26
    Anders Burla Johansen
    0

    Yeah - sorry for not having it more visible that is for the 1.x. The best way to see how things are done in 2.x is to download the starter kit for Tea Commerce.
    http://starterkit.teacommerce.net/

    Kind regards
    Anders

  • seanrock 99 posts 173 karma points
    Jun 19, 2013 @ 09:28
    seanrock
    0

    Ok I've found the new docs and updated my script however I know receive this js error.

    Themodeldidn't have a store id associated with it - remember to add the Tea Commerce store picker to your Umbraco content tree

    here is my javascript

     

    $(function(){ $('.productAddToCart').on('click',function(ev){ var storeId = $('.storeId span').html(); var nodeId = $(this).attr('nodeid'); TC.addOrUpdateOrderLine({'productIdentifier':nodeId, 'quantity':1, 'storeId':storeId}); }); });

     

     

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 19, 2013 @ 09:31
    Anders Burla Johansen
    0

    That is because your product need a store associated with it. Add a store picker to a parent node in Umbraco (then you only have to specifiy the store in one place). Now that will work. Be sure to pass the store id along if you dont have a JavaScript variable with the name of _storeId.
    http://documentation.teacommerce.net/javascript-api/order-lines/addorupdateorderline/

    Kind regards
    Anders

  • seanrock 99 posts 173 karma points
    Jun 19, 2013 @ 09:40
    seanrock
    0

    Hi Anders

    Again thanks your reply. As you can see from the script, I have done that which you've indicated. I've aded a store picker, I've added a macro that outputs that store id (.storeId span) and then passes that store id. The request actually shows that I am passing the store id.

    See it here

    http://www.landsharkdivers.co.uk/shop.aspx

    Thanks for your patience.

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 19, 2013 @ 10:15
    Anders Burla Johansen
    0

    Tea Commerce cant fint the store id for your node. Did you add the store picker with an alias of "store"? That is required. Try and download the starter kit and see how things are done.

  • seanrock 99 posts 173 karma points
    Jun 19, 2013 @ 10:32
    seanrock
    0

    Hi Anders

    I've called my store alias storeId. However i've updated my code and it does appear to work now. Thanks for your assistance.

    Regards

    Sean

  • Anders Burla Johansen 2560 posts 8256 karma points
    Jun 19, 2013 @ 10:38
    Anders Burla Johansen
    0

    Your welcome. Hope you have loads of fun implementing your webshop using Tea Commerce

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft