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 338 posts 987 karma points
    Jul 28, 2019 @ 12:39
    Neil Hodges
    0

    Adding each product to basket uniquely

    Hi

    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 338 posts 987 karma points
    Jul 28, 2019 @ 12:48
    Neil Hodges
    1

    Scratch that, figure it out :)

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

    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

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft