Announcement

Collapse
No announcement yet.

Updating Product Cost Fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Updating Product Cost Fields

    Hello,

    I'm looking for the most effective / efficient way to update the Cost field on products. So we can take advantage of the "markup from cost" Price Group. The value is coming in via our inventory/order management system. This is what I have right now in my testing environment:

    Code:
    <MvDO FILE="{g.Module_Library_DB}" NAME="l.ok" VALUE="{Runtime_Product_Load_Code(l.productCode, l.product)}">
    <MvASSIGN NAME = "l.product:cost" VALUE = "{ l.costs:standard }">
    <MvDO FILE="{g.Module_Library_DB}" NAME="l.ok" VALUE="{Product_Update( l.product )}">
    This does work and is appropriately updating the Cost field. But, I'm mostly concerned that it's technically updating all the basic product fields (description, price, etc.). I feel there might be a risk here that product information might get wiped if something goes wrong between the two systems communicating with each other.

    Is this the most correct method or is there a better way to handle this?

    Thank you!

    #2
    Why are you making these updates via a module? How is the value getting from your order management system into this module?

    Ideaily the best solution would be to leverage our JSON API and have the inventory system push to this function:

    https://docs.miva.com/developer/deve...roduct_update/

    This would allow you to update just the fields you care about.

    However, the function you're calling in template code is also correct and will make the same updates to the product.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      We already had the module which receives various information (including product costs) from our order management system's web services. Continuing to leverage that seemed to be the most economical choice.

      I admit that I did forget about the JSON API, so I'll look into that. Thanks!

      Comment

      Working...
      X