Copied to clipboard

Flag this post as spam?

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


  • Kasper Skov 66 posts 346 karma points
    Oct 22, 2013 @ 15:03
    Kasper Skov
    0

    isUnique not creating separate order line

    I add to my orders via the HTML-API like this:

    <form action="/base/TC/FormPost.aspx" method="post" class="">
      <input name="storeId" type="hidden" value="@storeId" />
          <input name="AddOrUpdateOrderLine" type="hidden" value="productIdentifier : productIdentifier , quantity : quantity, isUnique : true, properties : properties" />
           <input name="properties" value="subscription : subscription , subscriptionInterval : subscriptionInterval" type="hidden" />  
    
    @*OTHER STUFF******@
    
    <input type="submit" value="@Dictionary[ "AddToCart" ]" class="addToCart btn btn-addtocart btn-brown" />
    </form>
    

    It doesn't create unique order lines. I've checked the DB. It just adds to the quantity. What am I missing?

  • Anders Burla 2560 posts 8256 karma points
    Oct 22, 2013 @ 15:05
    Anders Burla
    0

    Hi Kasper

    I TC 2.2 that functionality was removed and moved to the settings area of the store where you can specify what order line properties that makes an order line unique. So that is where you specify that.

    Sorry for not updating the documentation

  • Kasper Skov 66 posts 346 karma points
    Oct 22, 2013 @ 15:12
    Kasper Skov
    0

    Ah alright, nice. That is actually pretty neat (in my case anyways). Great new feature! Thanks alot.

  • Kasper Skov 66 posts 346 karma points
    Oct 22, 2013 @ 15:18
    Kasper Skov
    0

    Anders the 'Product property aliases' setting. What is that for?

  • Anders Burla 2560 posts 8256 karma points
    Oct 22, 2013 @ 15:19
    Anders Burla
    1

    That is properties that is automatic copied from the Umbraco node to the Tea Commerce order line.

  • Kasper Skov 66 posts 346 karma points
    Oct 22, 2013 @ 15:21
    Kasper Skov
    0

    Perfect. I just separate them with a comma?

  • Anders Burla 2560 posts 8256 karma points
    Oct 22, 2013 @ 15:21
    Anders Burla
    1

    yes

  • Tobbe 81 posts 387 karma points c-trib
    Jan 14, 2014 @ 10:43
    Tobbe
    0

    Hey, I might be stupid but I cant figure out how to do this. I want that every product I add should get a separate orderline. So Ive set "Product property aliases unique" to "sku", like this. what am I missing?

    enter image description here

  • Anders Burla 2560 posts 8256 karma points
    Jan 15, 2014 @ 10:21
    Anders Burla
    0

    If you add a product with the same SKU then they are not unique. So you need to have a property at your order lines that make it unique and then use that property alias as the unique property alias setting. Maybe you could add a Guid as a property with the name "makeUnique". That should do the trick.

    Kind regards
    Anders

  • Tom 23 posts 79 karma points
    Feb 12, 2014 @ 11:51
    Tom
    0

    Hi Anders,

    I'm running into a similar issue, does the property that is unique have to exist on the product itself, or can it be passed in as a property in the form data at the time the form is submitted? (As I have tried that and I can't seem to get it to split the orderlines).

  • Rune Grønkjær 1372 posts 3103 karma points
    Feb 13, 2014 @ 10:35
    Rune Grønkjær
    0

    Hi Tom,

    The property making the order line unique can be anything. It does not have to come from the product. Your can add your own properties to the orderline using the AddOrUpdateOrderLine method. Read more about it here:

    http://documentation.teacommerce.net/html-api/order-line/addorupdateorderline/

    /Rune

  • Tom 23 posts 79 karma points
    Feb 13, 2014 @ 11:32
    Tom
    1

    Thanks Rune, you pushed me into the right direction, we were passing the unique field as an argument, but instead it needed to be part of the orderline properties. Now it seems to be working great :)

Please Sign in or register to post replies

Write your reply to:

Draft