Announcement

Collapse
No announcement yet.

basket:groups merge records that should not be merged.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    basket:groups merge records that should not be merged.

    I have an app that inserts OEM parts into the basket using BasketItem_Insert() and BasketOption_Insert().

    The product record comes from an external site and are not contained in the stores product database. To make this work I have a dummy product that I load and then alter the product code, description, price, etc before inserting the record.

    I confirm two separate records are created in s01_BasketItems and s01_BasketOptions

    However on BASK and other pages MM9 uses the new array basket:groups instead of basket:items and it is merging the records even though everything is different except the basket_id. It combines the quantites and uses the data from the first record.

    In mmlsk-cmp-cssui-basket.mv I find CommonComponentFields_Merge_BasketOrOrderItem_Grou ps(). It ignores the basket:items contents and only uses the id to determing what to merge.

    I tried altering the content of the basket:option record (a single text field) but it ignores the fact that the data is different and merges them anyway.

    At this point I'm stuck and would appreciated any suggestions. I'd prefer to not add multiple dummy product records.
    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    #2
    Make sure you are passing an empty (not 0, but actually an empty string) basketitem:group_id field to BasketItem_Insert. This should result in each item receiving a unique group_id (it will be equal to the line_id) and should prevent them from being merged in CommonComponentFields_Merge_BasketOrOrderItem_Grou ps.

    Comment


      #3
      That did it. Thanks Jon
      Ray Yates
      "If I have seen further, it is by standing on the shoulders of giants."
      --- Sir Isaac Newton

      Comment

      Working...
      X