• Resolved Erfan MHDi

    (@erfanmhd)


    hi,
    i have setup my api key from stockunlocks but when i press the “retrive” key in import section nothing happens. no product is adding to my woocommerce and no error is showing up !

    i also created the changes you mentioned in php.ini and wp-confifig but nothing happens ??

    can you help me ?!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author StockUnlocks

    (@stockunlocks)

    Hi erfanmhd,

    Can you let me know which version of the StockUnlocks plugin you’re using? In the meantime, I’ll check your details on reseller.stockunlocks.com.

    Thanks

    Update: I just checked your profile on reseller.stockunlocks.com. It doesn’t look like you’re are making a successful connection to the Dhru server. Are you trying to test your connect from a hosted environment or a local computer?

    • This reply was modified 7 years, 11 months ago by StockUnlocks. Reason: Additional question
    Thread Starter Erfan MHDi

    (@erfanmhd)

    Hi Stock Unlocks,
    I’m Using Version 1.0.8.6 from a hosted environment.

    Thanks

    Plugin Author StockUnlocks

    (@stockunlocks)

    I’ve just successfully connected and retrieved services using your credentials just fine, no problems.

    Please take a screen shot of the following and send them to “support at stockunlocks dot com”:

    1. StockUnlocks > Providers
    2. StockUnlocks > Import Services

    Also, have you tried clearing your cache or a different browser?

    It might be helpful to right click on the “Retrieve” button and select “Inspect Element”.

    Next, select the “Network” tab and then click the “Retrieve” button and take note of the network activity from the remote server. Response codes, etc.

    Thread Starter Erfan MHDi

    (@erfanmhd)

    Hello,
    i’ve sent the shots to [email protected]
    i also check the network tab on inspect area and i got 404 on network requests!

    i also send the network error screenshot in E-Mail.

    thanks!

    Plugin Author StockUnlocks

    (@stockunlocks)

    The 404 error that appears in the Network tab points directly to this file:

    /plugins/stockunlocks/js/private/stockunlocks.js

    Line 5:

    var wpajax_url = document.location.protocol + '//' + document.location.host + '/wp-admin/admin-ajax.php';

    I can recreate your problem when I’m running WordPress locally.

    This is because /wp-admin/admin-ajax.php would need additional info due to local hosting arrangement.

    For example, my local hosting environment requires that I add /stockunlocks-plugin because that’s how my local environment is set up.

    So, here is what line 5 will look like for me, running locally:

    var wpajax_url = document.location.protocol + '//' + document.location.host + '/stockunlocks-plugin/wp-admin/admin-ajax.php';

    If I do not add /stockunlocks-plugin, I get the same 404 error that you receive on the Network tab. After adding, it works just fine.

    Check your URL structure for your environment. The plugin is designed to work with the most common structures encountered for a hosted environment.

    Hope this helps.

    Regards,
    Henry

    Plugin Author StockUnlocks

    (@stockunlocks)

    The next update will fix this problem by extracting the necessary path element:

    	var doc_pathname = '';
    	var suwp_pathname = document.location.pathname.split('/')[1];
    	
    	// add the path element, if necessary
    	if( suwp_pathname == 'wp-admin' ) {
    		doc_pathname = '/wp-admin/admin-ajax.php';
    	} else {
    		doc_pathname = '/' + suwp_pathname + '/wp-admin/admin-ajax.php';
    	}
    	
    	// setup our wp ajax URL
    	var wpajax_url = document.location.protocol + '//' + document.location.host + doc_pathname;

    Once this is implemented, there will be no need to edit this file anymore.

    Thanks for your patience!

    Take care,
    Henry

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘import problem with api’ is closed to new replies.