Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1461 posts 1883 karma points
    Feb 19, 2019 @ 21:25
    Gordon Saxby
    0

    Transferring Variants to another environment

    Umbraco 7.4.2, TC v3.1.1

    This is causing us unbelievable grief!!

    We are using Variants to define Size and Colour for a product. The setup of that all works fine (well, just about) but the problem comes when we want to transfer that data to another environment (e.g. Staging, Live).

    The Variant data seems to be stored as JSON in a property field in the database. The problem is, the JSON contains node IDs which relate to the current environment - and then don't match when the Product is copied using Courier to another environment.

    Is there any way of copying / transferring Products and their Variant data from one environment to another?

    Has the way Variants work and / or how they are stored changed in any newer versions of TeaCommerce?

    Currently, it looks like I'm going to be extracting the JSON from the database, editing it in notepad to update the node IDs and putting it back into the database!! :-(

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 07:31
    Matt Brailsford
    0

    Hi Gordon,

    Sorry to hear you are having difficulties with this :(

    Ultimately the correct way to do this would be to write a data resolver for Courier / Umbraco Deploy (depending on which you are using). Unfortunately we don't currently have one written ourselves. There are examples out there which you could use as a starting point, for example there are a bunch here for Umbraco Deploy

    https://github.com/umbraco/Umbraco.Deploy.Contrib

    And here for Courier

    https://github.com/umbraco/Umbraco.Courier.Contrib

    This is definitely something we will be looking at in future, and with that in mind I have created an issue to track this here https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/issues/81, although I do appreciate that doesn't exactly help you now.

    If you did want to look at writing a resolver, I'd gladly offer any guidance and maybe it could be contributed back in order to help others?

    Matt

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 08:09
    Matt Brailsford
    0

    Are you using Courier the product? Or Umbraco cloud?

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 08:17
    Gordon Saxby
    0

    Hi Matt, we are using Courier the product.

    I have an immediate issue of getting 4 (I think) products that have been set up on Staging, up onto live. I am going to look at manually editing the JSON in this situation.

    Assuming I am allowed the time, I will suggest that I create a data resolver. Your help will almost certainly be needed and I'd be happy to contribute it back to the community.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 09:31
    Gordon Saxby
    0

    Unfortunately, the JSON is too large to get using SQL Management Studio, so I'm looking at creating a Data Resolver. Just not sure where / how to start!!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 09:44
    Matt Brailsford
    0

    Hi Gordon,

    I'd start by creating a standalone project TeaCommerce.Umbraco.Courier and then add the same UmbracoCms.Core 7.1.8 and Courier.Core 3.1.7 nuget dependencies as used in the Umbraco repository.

    From their I'd create a TeaCommerceVariantsDataResolver class that inherits from PropertyDataResolverProvider and then look through the examples here to see how that needs to be implemented:

    https://github.com/umbraco/Umbraco.Courier.Contrib/tree/dev/src/Umbraco.Courier.Contrib.Resolvers/PropertyDataResolvers

    Ultimately, these grab the JSON value and parse out the node ID's and tell Courier to resolve them. Then on the flip side, take a node ID and update the JSON with the other environments ID. You'll need to review the TC Variants property editor JSON format though to undersrtand where these need to be extracted from.

    Hopefully this gives you a starting point.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 10:12
    Gordon Saxby
    0

    I can't see / find Courier.Core in Nuget?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 10:17
    Matt Brailsford
    0

    Looking at the Umbraco repo, I think you might need to add a Nuget source in VS for https://www.myget.org/F/uaas/api/v3/index.json. See if that helps.

    I'm hoping it's not in some private Nuget repo :(

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 10:26
    Gordon Saxby
    0

    I added it as a source, but the Nuget package manager just hangs saying "Retrieving information..."

    Can I just copy the Umbraco.Courier.Core.dll from our website?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 10:33
    Matt Brailsford
    0

    Sure, if it's quicker for now. Just drop it in a Lib folder in the project root and reference it from there.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 11:20
    Gordon Saxby
    0

    This is a snippet of the data:

        "combination": [{
            "name": "N",
            "id": 5219,
            "groupName": "Size",
            "groupId": 1102
        },
        {
            "name": "Jet",
            "id": 75335,
            "groupName": "Colour",
            "groupId": 75332
        }]
    

    I assume I need to tell Courier to add "id" and "groupId" to the list of dependency items? How do I find / get the id's for those when it is "unpackaged" to the destination?

    Is there an existing resolver that deals with similar data (e.g. node IDs inside XML / JSON)?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 11:34
    Matt Brailsford
    0

    That's correct, so we need to tell Courier about the id and groupIds for each item.

    You could look at the MultiUrlPicker one here https://github.com/umbraco/Umbraco.Courier.Contrib/blob/dev/src/Umbraco.Courier.Contrib.Resolvers/PropertyDataResolvers/MultiUrlPickerPropertyDataResolver.cs

    You don't need to implement the DataType side of things like some others do as we don't store any IDs as part of the data type config. So you only need to implement PackagingProperty and ExtractingProperty.

    When packing you need to loop through the JSON, and when it finds an id / groupId you need to use the Courier API's to fetch the nodes GUID and then you

    • Tell courier about that dependency
    • Update the JSON swapping the ID to the GUID
    • Reserialize the JSON back to the propertyData.Value

    Then in the Extract method, you do the opposite, looping through the JSON, extracting the GUID and then requesting the related ID on the given environment and then update the JSON swapping the GUID for the local ID and saving the serializaed JSON back again.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 11:43
    Matt Brailsford
    0

    Sorry you will also need to implement the EditorAlias property like so:

    public override string EditorAlias
    {
       get
       {
         return "TeaCommerce.VariantEditor";
       }
    }
    
  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 11:53
    Matt Brailsford
    0

    Hmm, we might need to implement the datatype side of things actually as we do reference a document type by alias in the prevalue (data type config), so I think we'll need to tell courier about that dependency otherwise it could deploy the property data but leave the document type behind.

    We can get to that though after this core bit.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 12:13
    Gordon Saxby
    0

    Oh, OK!

    I thought I'd try making life a bit easier by converting JSON to classes using http://json2csharp.com/ and it is mostly fine, except for the "variantGroupsOpen" bit which is just a list of IDs and true/false values. Unfortunately, I get

    public class Variantgroupsopen
    {
        public bool _1102 { get; set; }
        public bool _5267 { get; set; }
        public bool _75332 { get; set; }
    }
    

    for

    "variantGroupsOpen": {
        "1102": true,
        "5267": true,
        "75332": true
    }
    

    which isn't really right!?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 12:24
    Matt Brailsford
    0

    To be honest, i think you could just ignore that property to. That just records which variant groups were open in the UI (which I don't even know if that works right). Leaving them out would just mean on the next environment, everything would be defaulted to closed, which I don't think is a big deal.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 12:26
    Gordon Saxby
    0

    OK, but I wasn't sure that this command would work if there wasn't a definition for "variantGroupsOpen".

    How would you recommend I test this, once I (hopefully) get some code together?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 12:32
    Matt Brailsford
    0

    RE the variantGroupsOpen, there should be a check in the code to see if it exists or not so it should be safe to remove:

    https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/blob/ca70e42acbdf5c0e68ef447d716bdb2d7623d7c0/Source/TeaCommerce.Umbraco.Application/PropertyEditors/variant-editor.controller.js#L41

    However on newer instances, this doesn't actually work as it looks like at some point it was changed so that the property value was only set on form submittion, and at that point it strips anything other than variants.

    Either way it should be safe to ignore them for the time being.

    RE testing, the only way I was able to do it in the past (which is the harder part) is that you HAVE to push it through courier. Unfortunately they don't have any kind of testing tool so you'd have to setup 2 environments, make a change in one and then try and deploy it to the 2nd and make sure it works.

    Ideally I'd try and make is that the variants get different node IDs (maybe create a few dummy pages on 2nd environment so that the ID's move on a bit). This way you can make sure the IDs actually map.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 13:04
    Matt Brailsford
    0

    So this may or may not work, but I've just roughed this out in VS Code (so there is every possibility it doesn't compile and it's defo missing using statements).

    https://gist.github.com/mattbrailsford/777a8c5b6e6a063176d32e84964da14a

    This might at least give you a rough idea.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 13:14
    Gordon Saxby
    0

    Thanks for that! Amazingly, I had pretty much the same thing :-)

    I'm just installing Courier locally and then I need to setup a test destination site. Then I can see if it works!

    By the way, the version of item.Dependencies.Add you used is marked as obsolete ... does that matter?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 13:23
    Matt Brailsford
    100

    I've just updated my Gist to also support the DataType prevalue config (again, this is coding blind so might not be exact).

    RE Obsolete, I'd imagine it should be fine so long as it's not the kind that prevents you compiling. This is all worked out from the Courier repo so all those resolvers are doing the same. If it tells you an alternative, you could change it if you want. Like I say, I'm just throwing this together in VS code so I have no intellisense or anything.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 13:28
    Matt Brailsford
    0

    We might not actually need the resovledDocTypes cache as I think all doctypes in the prevalue would be unique, but I just copied this from the InnerContent resolver so no big deal that it's there.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 14:42
    Gordon Saxby
    0

    Lines 22 and 31 are not valid - they both return a DataTypePrevalue

    enter image description here

    I'm not 100% sure what's happening there, so unsure how to fix it.

    EDIT - ah, those are the options available on the Variant editor DataType. We have "Variant document type" = "Variant". However, "Variant group document types" is blank.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:07
    Matt Brailsford
    0

    Updated the Gist. Needed to do a Null check on the vars and then access their Value property. Couldn't tell they came back as DataTypePrevalue from VS Code.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:09
    Matt Brailsford
    0

    RE EDIT: That should be fine, Variant Group Doc Types should get skipped if it has no value.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 15:12
    Gordon Saxby
    0

    There is the hierarchy of

    Variant Groups Variant Group (e.g. colour) Variant Item (e.g. Red)

    So, will these get added when a Product is Courier'd across, as they are dependencies for the Product variants?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:14
    Matt Brailsford
    0

    So the variants property editor just has dependencies on what is either in the data type config (so the varients doc type field or the doc type groups variants field) and then on the document nodes referenced within the property editor UI itself.

    We should now have captured all those dependencies, but what courier should do is then asks those entities "do you have any dependencies" and then that should pull everything else along. That's what courier does. Builds up a big dependency tree, and then sends it to the other instance to process in the right order.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 15:24
    Gordon Saxby
    0

    First test - copy Product with variants. Destination site does not have any Product pages or the container node, nor does it have any Variant data (groups or items).

    It seems to have worked - it created the container folder for the product and the product itself. It also created the Variant Groups - Variant Group - Variant Item elements used on the Product.

    Seems too good to be true!! More testing now, I'll let you know if I have any other issues.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 15:35
    Gordon Saxby
    0

    Sorry, a bit premature with the "working" statement! The Variant groups/items have copied over, but they haven't been applied to the Variants on the Product:

    enter image description here

    This is the Courier log:

    2019-02-20 15:19:40,334 [46] INFO  Umbraco.Courier.Core.TaskManager - [Thread 46] Added PackagingTask behind queue of : 0
    2019-02-20 15:19:40,334 [46] INFO  Umbraco.Courier.Core.BackgroundTaskRunner - [Thread 46]  Task added Umbraco.Courier.Core.Tasks.PackagingTask
    2019-02-20 15:19:40,334 [49] INFO  Umbraco.Courier.Core.TaskManager - [Thread 49] Starting PackagingTask with id: f3523955-98b6-47d5-b3d1-ed0ec627cbcb
    2019-02-20 15:19:40,335 [49] INFO  Umbraco.Courier.Core.Tasks.PackagingTask - [Thread 49] PackagingTask running by user admin
    2019-02-20 15:19:41,521 [49] DEBUG Umbraco.Courier.Persistence.V6.NHibernate.NHibernateProvider - [Thread 49] Closing session, UseGlobalSession: False, key: 73e36d40-bb6d-4877-8558-9570af287076
    2019-02-20 15:19:41,525 [49] INFO  Umbraco.Courier.Core.TaskManager - [Thread 49] Completed PackagingTask with id: f3523955-98b6-47d5-b3d1-ed0ec627cbcb
    2019-02-20 15:19:58,158 [74] INFO  Umbraco.Courier.Core.TaskManager - [Thread 74] Added ExtractionTask behind queue of : 0
    2019-02-20 15:19:58,158 [74] INFO  Umbraco.Courier.Core.BackgroundTaskRunner - [Thread 74]  Task added Umbraco.Courier.Core.Tasks.ExtractionTask
    2019-02-20 15:19:58,158 [55] INFO  Umbraco.Courier.Core.TaskManager - [Thread 55] Starting ExtractionTask with id: b86d5540-9e1c-4245-928c-fafeec903dc7
    2019-02-20 15:19:58,158 [55] INFO  Umbraco.Courier.Core.Tasks.ExtractionTask - [Thread 55] ExtractionTask running by user admin
    2019-02-20 15:19:58,158 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Running PopulateGraph
    2019-02-20 15:19:58,219 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Finished PopulateGraph (took 60ms)
    2019-02-20 15:19:58,219 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Starting extraction
    2019-02-20 15:19:58,219 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Opens database session
    2019-02-20 15:19:58,274 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Transfering pre-extraction files
    2019-02-20 15:19:58,275 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Running ExtractReadyRevisionBatch
    2019-02-20 15:19:58,275 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Extracting batch of 2 items
    2019-02-20 15:19:58,372 [55] WARN  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item extraction did not complete, status returned: NeedPostProcessing
    2019-02-20 15:19:58,372 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item Variant groups needs post processing
    2019-02-20 15:19:58,373 [55] WARN  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item extraction did not complete, status returned: NeedPostProcessing
    2019-02-20 15:19:58,373 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item Rings needs post processing
    2019-02-20 15:19:58,373 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Extracting batch of 5 items
    2019-02-20 15:19:58,489 [55] WARN  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item extraction did not complete, status returned: NeedPostProcessing
    2019-02-20 15:19:58,489 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item Ring size needs post processing
    2019-02-20 15:19:58,489 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Extracting batch of 10 items
    2019-02-20 15:19:58,577 [55] WARN  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item extraction did not complete, status returned: NeedPostProcessing
    2019-02-20 15:19:58,577 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Item UK Size M needs post processing
    2019-02-20 15:19:58,577 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Extracting batch of 9 items
    2019-02-20 15:19:58,656 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Finished ExtractReadyRevisionBatch (took 381ms)
    2019-02-20 15:19:58,656 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Completed extraction queue
    2019-02-20 15:19:58,671 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Post processing
    2019-02-20 15:19:58,671 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Post processing 4 items
    2019-02-20 15:19:58,737 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Finished PostProcessing (took 65ms)
    2019-02-20 15:19:58,742 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Completed post processing
    2019-02-20 15:19:58,742 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Committing to database
    2019-02-20 15:19:58,765 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Transfering post-extract resources
    2019-02-20 15:19:58,765 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Completing database transaction
    2019-02-20 15:19:59,831 [55] INFO  Umbraco.Courier.Core.Extraction.RevisionExtraction - [Thread 55] Completing entire deployement
    2019-02-20 15:20:00,515 [55] DEBUG Umbraco.Courier.Persistence.V6.NHibernate.NHibernateProvider - [Thread 55] Closing session, UseGlobalSession: False, key: dcecda4c-1131-48cd-b4d4-0b98cab01fd3
    2019-02-20 15:20:00,550 [55] INFO  Umbraco.Courier.Core.TaskManager - [Thread 55] Completed ExtractionTask with id: b86d5540-9e1c-4245-928c-fafeec903dc7
    

    I don't know if that helps at all.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:36
    Matt Brailsford
    0

    Was the courier resolver installed on both instances?

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 15:46
    Gordon Saxby
    0

    Umm ... oops!! It is now ;-) And it worked properly that time!

    Except for the Stock field which is blank on all at the Destination.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:49
    Matt Brailsford
    0

    Hmm, that would probably make sense as stock levels are maintained outside of the umbraco nodes in a custom table.

    In theory though, that is the desired effect as you wouldn't want to deploy stock level changes between environments. (IE your live environment should not have it's stock levels overwritten by dev / staging).

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 15:51
    Gordon Saxby
    0

    Ah, actually - we do want to deploy the stock levels!

    There are a lot of options and the stock levels on the site are not the main source of that info (it's complicated!).

    Would it be possible to add that in somehow (transfer the stock levels)?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:54
    Matt Brailsford
    0

    I'm not sure if Courier can deploy custom entities, would need to check with HQ.

    You could try copying the TC stock levels DB table from staging to live, although I have a sinking feeling that the table holds Node ID references :(

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 15:57
    Gordon Saxby
    0

    The Stock table is just Store Id, Sku and Stock enter image description here

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 15:58
    Matt Brailsford
    0

    Ahh, I think it uses the NodeID if you don't have an SKU so that's a relief. In that case, you could copy that DB table and insert values for SKUs that don't already existing in that table? (Assuming your Store IDs are the same, but that's an easier one to resolve :))

    If you really wanted to try and do this via courier, you could try and write a resolver for the TC Stock prop editor and get it's values from the DB, inject it into the prop value, then push it out, and on extract, take the value and inject it into the database. Thought this is kind of a hack and not sure how that would work with these variant property editors.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 16:11
    Matt Brailsford
    0

    As I say, from a Tea Commerce official perspective, I think our stance would have to be that Stock levels aren't transfered as it's effectively "user generated content" in the fact that those values change on the live server so you wouldn't want to inadvertantly override those from a staging ENV.

    In terms of the courier provider code, did you have to change anything (other than adding using statements)? or was it pretty much as per my Gist? If it's the same I'll look at moving it to a github repo.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 16:23
    Gordon Saxby
    0

    Regarding the stock level transferring - here it is not the ultimate indicator of actual stock (!), and they want to be able to set the stock levels on Staging and then transfer it all to live.

    I think the code I have is the same as yours - I can paste it here or email it to you (if you let me know the address).

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 16:33
    Matt Brailsford
    0

    If you could send it to [email protected] that would be great.

    If you aren't using actual stock levels, does that mean the values don't change? If they don't change, you could use a numeric field instead of TC stock and then that should transfer.

    Alternatively, you could try and fake it by writing your own Courier resovler for the TC Stock property editor and fetch the raw value from the DB and then put it back in the DB on live. The resolver wouldn't really declare any dependencies, but it would be a temporary hold for the stock level in transit if you see what I mean.

    I'm not sure if this would require additional changes to the Variants resolver though to do some recursive dependency handling. You'd need to look into the InnerContent / NestedContent resolvers for that, as they should do that type of thing.

  • Gordon Saxby 1461 posts 1883 karma points
    Feb 20, 2019 @ 16:38
    Gordon Saxby
    0

    The stock level on Variants is used / updated by the website / TC, but just because it says 10 (for example), it doesn't necessarily mean there are actually 10 in stock. I don't operate the site, apparently they often update or correct the stock levels.

    I think this may be a "possible future" issue to look at. For now I think they will just set the levels directly on Live.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 20, 2019 @ 16:41
    Matt Brailsford
    0

    Yea, I can defo see some resolution issues there. If stock levels change on live, but they don't on staging, if you tell it to push the product from staging again then it would overwrite the stock level there. Courier is really meant for "content" in that it would generally be, you get it ready on staging, then push it to live, then you just overwrite it on the next release.

    Things like stock levels though, and other user generated content will change, and unless you are going to sync back down before pushing back up, it really doesn't have a mechanism (As far as I know) for doing this level of diffing.

Please Sign in or register to post replies

Write your reply to:

Draft