Importing new products / Updating products

  • 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):

  • drewm

    Approved the thread.
  • Hi,

    • Is PHP error reporting enabled? If not, enabling it here can be helpful.
    • Is this on a regular page? If so, turn on debug mode and check the debug message at the bottom for any warnings or errors.
    • Have you finished configuring Perch Shop (setting up products category set, brands, etc)? I think you generally need to do this before adding products
    • I know this sounds silly, but since you haven't shared the whole file we have no way of knowing. Are you calling the function addProducts() anywhere on the page?
  • 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

    = $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)