Copied to clipboard

Flag this post as spam?

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


  • Alessandro 11 posts 84 karma points
    Dec 14, 2016 @ 16:35
    Alessandro
    0

    MerchelloHelperProductDataModifiers task chain

    Hi Rusty,

    we are building our first small Merchello prototype because we think it has huge potential.

    We need a multi-store (aka umbraco multi-node) tree structure, where each root node represents a city store. The price of each product should depend on the store.

    For this purpose we are using MerchelloHelperProductDataModifiers task chain, but our custom task (which modifies the price) runs only the very first time the customer visits the product page. Every following request for the same product does not call our task.

    Is there any caching on the MerchelloHelperProductDataModifiers task chain? How could we deal with it?

    Thanks, Alessandro

  • Alessandro 11 posts 84 karma points
    Dec 15, 2016 @ 11:17
    Alessandro
    0

    We found the caching system on VirtualContentCache class, so we switched to a new variant-per-store approach.

    Anyhow, don't you think that

    string.Format("{0}.{1}.{2}", key, typeof(TContent), modified)
    

    is a bit too restrictive?

    For example, think of different prices per user role, which is quite common in both B2B and B2C scenarios.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 15, 2016 @ 16:07
    Rusty Swayne
    0

    Hey Alessandro,

    I can see in your use case that it may be too restrictive, but for the 99% I think it's probably appropriate.

    I think the appropriate way to make this work with the flexibility you need is to optionally allow for an optional additional key (or perhaps even array that could be joined) when creating the key so that the modifiers don't have to execute every single time.

    In your case this might be an individual store alias or something ...

    what do you think?

    It'd be a great pull request!

Please Sign in or register to post replies

Write your reply to:

Draft