• Resolved Harkály Gerg?

    (@harkalygergo)


    Is there a way to get current row’s ID/number while exporting orders with WP All Import plugin?

    First row would contains the columns’ name, but we need that the first column contains a growing number, so second row (which contains first order details) first column value should be 1; third row (which contains second order details) first column value should be 2; etc…

    Situation is complicated because orders export limit is 50 (In each iteration, process 50 records), so if you have 60 orders 51. order’s first column should be 51, not 1.

    I have tried with $i variable and $_SESSION[] variable too, but this are not the best solutions.

    https://wordpress.stackexchange.com/questions/243113/get-wp-all-export-row-id

Viewing 1 replies (of 1 total)
  • Thread Starter Harkály Gerg?

    (@harkalygergo)

    We’ve got a solution from plugin’s developers:

    // add this code to theme's functions.php file
    add_action('pmxe_before_export', 'wp_all_export_pmxe_before_export', 10, 1);
    function wp_all_export_pmxe_before_export($export_id)
    {
    	delete_option('wp_all_export_current_row');
    }
    // add this to All Export plugin's Edit Export screen under " Export the value returned by a PHP function" section
    function get_row_number()
    {
    	$current = get_option('wp_all_export_current_row', 1);
    	update_option('wp_all_export_current_row', $current + 1);
    	return $current;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Get WP All Export row ID’ is closed to new replies.