• Resolved kenteush29

    (@kenteush29)


    Hello,

    Your plugin isn’t compatible with wp all import due to its stock updating method. Their support gave me a code some times ago, you should correct it and add it into your plugin functions directly:

    • This topic was modified 3 years, 5 months ago by kenteush29.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter kenteush29

    (@kenteush29)

    add_action( 'pmxi_saved_post', function( $id )
    {
    	$import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) );
    	// Only run for import IDs 329 and 212.     
    	if ( $import_id == '329' || $import_id == '212' ) {
    		// get locations total stock
    		$locations_total_stock = \SLW\SRC\Helpers\SlwProductHelper::get_product_locations_stock_total( $id );
    		// update stock
    		update_post_meta( $id, '_stock', $locations_total_stock );
    		// update stock status
    		\SLW\SRC\Helpers\SlwProductHelper::update_wc_stock_status( $id );
    	}
    }, 10, 1 );
    
    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Please check the inc/functions.php around line no. 245, this add_action thing “pmxi_saved_post” is already there. Please explain the following condition, is it specifically for your use-case or they recommended it for every user.

    if ( $import_id == '329' || $import_id == '212' ) {

    Thread Starter kenteush29

    (@kenteush29)

    Imports DOESN’T WORK with your plugin. It’s possible to update the stock depending on locations with the code _stock_at_[4 number ID], but the product general stock isn’t updated like in there.

    These conditions you wrote are for me the only way to apply the custom code depending on the import ID. Because it creates problems for the classic stock imports (when only _stock is updated and not _stock_at).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WP all import issues’ is closed to new replies.