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 338 posts 987 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 4125 posts 22223 karma points MVP 9x 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 338 posts 987 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 4125 posts 22223 karma points MVP 9x 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