Copied to clipboard

Flag this post as spam?

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


  • Alessandro Bellisai 30 posts 120 karma points
    Jan 09, 2012 @ 18:16
    Alessandro Bellisai
    0

    Add parameter to AddOrderLine method

    Hi

    How can i add some parameters to AddOrderLine method?

    The parameter that i want to add to AddOrderLine method is not bound to product, so i can't obtain it server side.

    I've see that when the AddOrderLine method is fire form javascript, it call a specific page via ajax, passing the parameters via REST, something like: http://www.teacommerceexample.com/tcbase/teacommerce/AddOrderLine/{nodeId} /{quantity}/...

    When i try to add a parameter, server side i obtain this error: Parameter count mismatch.

    Some one can help me?

     

    Thanks

    Alessandro

     

     

     

     

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 09, 2012 @ 19:27
    Rune Grønkjær
    0

    Hi Alessandro,

    You can add all the order line properties you want when calling the addOrderLine method. The properties are sent as form data to the server, not with the rest api.

    Call the addOrderLine method like this:
    TeaCommerce.addOrderLine([product id], 1, {properties:{variantId: [id of variant]}});

    To read more about the method go here:
    http://rune.gronkjaer.dk/en-US/2010/11/16/tea-commerce-javascript-api/#addOrderLine

    Hope this answers your question.

    /Rune

  • Alessandro Bellisai 30 posts 120 karma points
    Jan 09, 2012 @ 22:21
    Alessandro Bellisai
    0

    Hi Rune

    Thank you so much for the quick response, you solve my problem.

     

    Alessandro

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 10, 2012 @ 08:02
    Rune Grønkjær
    0

    No problem. Just happy to help. Please mark my answer for future reference.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft