Updating the contents for a number field via the front-end once a (non perch) form is submitted.

  • Quick question. Is there a way to update the content of perch field via php on the front-end?

    I have a number of places remaining field that I want to deplete by one when a user books a place.
    The field called event_spaces_remaining and currently is a number field. It just contains a single number (e.g. 12)
    I am not using Perch Forms at the moment. I’m hoping I don't have to migrate it all over to perch forms.

    I am thinking this might be possible with the API but I am unsure on how to achieve this. If anyone can clarify this would be possible and perhaps steer me in the right direction?


  • So with the help of hus_hmd (massively appreciated). I believe I have this working, with the exception of what appears to be a significant bug in the Perch PerchCollectionImporter.class.php.

    Here is my final code.

    I am going to raise a separate post to alert Perch of the bug.