Copied to clipboard

Flag this post as spam?

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

  • Neil Hodges 267 posts 761 karma points
    Jul 28, 2019 @ 12:39
    Neil Hodges

    Adding each product to basket uniquely


    I'm trying to add products to the basket uniquely. I've followed the documentation to add the propertyAlias to 'Product uniqueness property aliases' like productName and sku.

    But it doesn't seem to want to see them as unique products.

    For some of the products I am overriding CalculatePrice to build up the price via size, it's for a Picture Frame.

    I read another post from 2013 about adding a Guid to the OrdlerLine property, but shouldn't setting the 'productName' or 'sku' property force it to add it uniquely anyway?

  • Neil Hodges 267 posts 761 karma points
    Jul 28, 2019 @ 12:48
    Neil Hodges

    Scratch that, figure it out :)

          var newGuid = Guid.NewGuid();
      <input name="productGuidUnique" value="@newGuid.ToString()" type="hidden" />
  • Matt Brailsford 2576 posts 12723 karma points MVP 7x c-trib
    Jul 28, 2019 @ 14:04
    Matt Brailsford

    Hey Neil,

    Glad you got it working 👍

    As an explanation, the unieqPropertAliases list properties on a node to use to determine if the product is unique or not. If the values of those properties are the same for each item being added, then it will see the product as being the same.

    What you have done is right because now you are introducing a value that is unique for each item added to the cart, whether it is the same product or not.

    Hope this helps


Please Sign in or register to post replies

Write your reply to: