Copied to clipboard

Flag this post as spam?

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


  • Bjørn Fridal 274 posts 784 karma points
    May 13, 2013 @ 11:41
    Bjørn Fridal
    0

    The isUnique argument

    Hi,

    I have a Tea Commerce shop, where you can buy a product and select what day to pick it up. The pickup date is stored in a seperate table, along with a bunch of other custom details. I am aware of the custom order line property feature, but I wanted a bit more control.

    Now if a customer wants to buy the same product, but with a different pickup date then I need to handle that as a new order line. It seems that the isUnique argument, might be an easy way to do just that? If the customer does not have a product in his cart with the same pickup date, then isUnique is true and otherwise its false.

    Does that sound correct, or am I missing something.

    Cheers
    Bjørn

  • Rune Grønkjær 1303 posts 2895 karma points
    May 13, 2013 @ 11:58
    Rune Grønkjær
    100

    Yes, that would be a fine way to do it.

    isUnique will make sure that to update a specific order line, you need the order line id. In your case your JavaScript will need some changes.

    When adding a product:
    You will need to check the existing order lines to see if one of them matches the product identifier and the pickup date.
    If there's a match you update that one using it's order line id
    If there's no match you add the new order line using the product identifier and the isUnique=true

    /Rune

  • Bjørn Fridal 274 posts 784 karma points
    May 13, 2013 @ 12:00
    Bjørn Fridal
    0

    Hej Rune,

    Great I was hoping as much, but wanted to check with the masters before I went further down this path. Thanks :)

    Cheers
    Bjørn 

  • Rune Grønkjær 1303 posts 2895 karma points
    May 13, 2013 @ 12:37
    Rune Grønkjær
    0

    Cool. Hope it will work out for you. Otherwise feel free to ask again.

    Could you please mark the correct answer for others to see.

    /Rune

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies