Posts by gustavobica

    Hi!

    I'm trying to run a few queries when a product is deleted,edited or added from the perch_shop. I have no problem for the add/edit, but the delete event seems to never be triggered. This is what I'm doing :


    Code
    1. API = new PerchAPI(1.0, 'perch_shop');
    2. $API->on('*', function(PerchSystemEvent $Event){
    3. $DB = PerchDB::fetch();
    4. $dataToInsert = array("message" => "Event: ".$Event->event.".");
    5. $DB->insert('debug', $dataToInsert);
    6. });

    Hi, thank you for the response. I should have specified those topics beforehand.

    1 - The php error is enabled and returns nothing.
    2 - No, I'm using react for the frontend, so I'm using Perch has a headless cms (Via API)
    3 - I would say yes, because I added manually a product so I'm guessing that yes, although I didn't set any category.
    4 - ^^ Yes, I could see where it stopped within the addProducts function (by using var_dumps) it stopped in this line

    $Importer
    = $API->get('PerchShopProductImporter');

    Also, the block try catch returns nothing (if I place a var_dump inside the try it wont print anything and the same thing goes for the catch part).
    (I'm not using the perch runway, is the importer something exclusive for the runway ? )
    My file looks something like this (I removed the other functions)

    Hi!

    I'm currently working on a new website that will have a lot of products so I'm trying to automate the adding/updating of the products. That being said, by looking at the docs I found this: importing products . But so for I wasn't able to use it successfully, What I am doing wrong ? The page doesn't provide any errors, but it wont get past the line:

    $Importer = $API->get('PerchShopProductImporter');


    I leave it here the function responsible for the importing (currently I'm using static content, but then I will move to an array of items):