• Resolved RayZorJ3lade

    (@rayzorj3lade)


    I’m trying to integrate API-based stock and pricing with my new product/product variations imports.

    My first idea was to use functions to make API calls for Stock and Price at the time of import, works fine for simple products but not for variations, probably because the API calls are pretty slow to respond.

    So my new plan is to use ‘pmxi_before_xml_import’ to pre-process the xml file, do a bulk stock and price query and inject the values into the xml before the import starts.

    I know the action works like this:

    function wp_all_import_before_xml_import( $import_id ) {
        // Unless you want this code to execute for every import, check the import id
        // if ($import_id == 5) { ... }
    }
    
    add_action('pmxi_before_xml_import', 'wp_all_import_before_xml_import', 10, 1);

    But how do I actually access the xml from within that function?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pre-processing the XML File’ is closed to new replies.