Updating price with Perch API

  • Hello,

    I would like to update the price of products using the update function. Prices are stored in the productDynamicFields, using the following JSON structure:

    1. "price": {"44": 34.50, "_default": 34.50}

    I tried the follow code, but this wipes the rest of the productDynamicFields and is not updating the price either:

    Is there a way to update the price by using the update function?


  • I got it! First I had to obviously put all the dynamicFields into an array, then edit the price field and then putting it back into the array:

    (I also indexed the product)

    My only problem now is that the price in the dynamicFields is as follows: 120.45, but when I edit the product in Perch it has a comma: 120,45.

    I checked the EUR currency, but the Decimal point character has . in Perch.

    EDIT: On the product listing in Perch (/perch/addons/apps/perch_shop_products/) it is written as 120.45, but when editting the product in the template it is written as 120,45...


    1. <perch:shop id="price" type="shop_currency_value" label="Prijs" size="s" min="0" step="any" divider-before="Prijzen"/>