Copied to clipboard

Flag this post as spam?

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


  • Puck Holshuijsen 184 posts 727 karma points
    Apr 11, 2023 @ 06:08
    Puck Holshuijsen
    0

    Thawing prices question

    Hi Matt,

    Just got a quick question about thawing prices. I have a multivariantproduct page, with complex variants.

    If i thaw the prices of the 'master' product, will all the variants' prices also thaw? Or do I need to thaw them individially. This is my piece of code in the PublishedEvent:

     if (node.ContentType.Alias.Equals(DtMultiVariantProductPage.ModelTypeAlias))
                {
                    if (node.WasPropertyDirty("price") || node.WasPropertyDirty("salePrice") || node.WasPropertyDirty("saleActive"))
                    {
                        _priceFreezerService.ThawPrices(partialKey: node.Key.ToString());
                    }
                }
    

    Thanks!

    //Puck

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Apr 12, 2023 @ 07:00
    Matt Brailsford
    100

    Hi Puck,

    Good question, and I think it should.

    When using product variants with the variants property editor the frozen price key should be in the format

    "{storeId}_{orderId}_{productReference}_{productVariantReference}"
    

    So passing just the productReference of the parent product should indeed thaw the prices of product variants

  • Puck Holshuijsen 184 posts 727 karma points
    Apr 13, 2023 @ 06:13
    Puck Holshuijsen
    0

    Awesome! Thanks :)

Please Sign in or register to post replies

Write your reply to:

Draft