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 195 posts 523 karma points
    May 02, 2019 @ 16:48
    Neil Hodges
    0

    Update Stock Level of Product programmatically

    Hi

    So I need to update the stock level of a product in Tea Commerce. I can't seem to use ContentService like this:

    contentService.SaveAndPublishWithStatus(content,0,false);
    

    Is there a way I can update the stock level via ID of the product or SKU?

  • Matt Brailsford 2274 posts 11082 karma points MVP 6x c-trib
    May 02, 2019 @ 16:52
    Matt Brailsford
    100

    Hi Neil,

    You can yes, however it's not available on the TC facade like GetStock so you'll need to go via the ProductService instead.

    ProductService.Instance.SetStock( long storeId, string sku, decimal? value );
    

    Hope this helps

    Matt

  • Neil Hodges 195 posts 523 karma points
    May 02, 2019 @ 16:57
    Neil Hodges
    0

    Brill! Once again Matt, thank you for the amazingly quick response to this.

    That's was the last part of the puzzle for my demo/proof of concept with the client in the morning,

    Sage now integrated :)

  • Matt Brailsford 2274 posts 11082 karma points MVP 6x c-trib
    May 02, 2019 @ 19:53
    Matt Brailsford
    0

    You are more than welcome.

    Good luck with the PoC tomorrow 😁

Please Sign in or register to post replies

Write your reply to:

Draft