Get Only Active Products

Hi,



I am using the function below to get the products and then export them but the issue is that it is exporting all the products ( active / disabled / hidden )



I only want the active products. Can the function below be passed some param to do the same ?




        fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => true, 'detailed_params' => true, 'get_options'=> false));<br />
<br />

This function is used to get additional product data for the set of products which is defined in the $products array. How and where do you get this array?

[quote name='eComLabs' timestamp='1440404882' post='227643']

This function is used to get additional product data for the set of products which is defined in the $products array. How and where do you get this array?

[/quote]

I wrote this code to export products in xml format but facing an issue that the xml file is not getting created now since the products count has increased and it takes long for the script to process all products and I somehow want active products only.


list($products, $search) = fn_get_products($params, 8000);
fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => true, 'detailed_params' => true, 'get_options'=> false));




Is it somehow possible that the above code can generate files based on main categories + active products. ? That will surely cut down the time.

Please try



$params['status'] = 'A';
list($products, $search) = fn_get_products($params, 8000);
fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => true, 'detailed_params' => true, 'get_options'=> false));

There seems to be some strange issue, earlier I was able to export upto 10K Products and now I cant even export 4K Products:



I added some timestamps as below to see the performance.



echo date(' h:i:s A');
list($products, $search) = fn_get_products($params, 4000);
echo date(' h:i:s A');
fn_gather_additional_products_data($products, array('get_icon' => false, 'get_detailed' => true, 'get_additional' => false, 'detailed_params' => false, 'get_options'=> false));
echo date(' h:i:s A');




The results were as below


1000 Products - 08:18:57 AM 08:18:58 AM 08:19:06 AM - 8 sec
2000 Products - 08:20:04 AM 08:20:06 AM 08:20:21 AM - 15 sec
3000 Products - 08:20:52 AM 08:20:54 AM 08:21:20 AM - 26 sec
4000 Products - Gateway Time-out The gateway did not receive a timely response from the upstream server or application

Possibly something was changed on the server side. Please contact server administrator and ask him to increase the value of the script timeout

I am sick of these siteground people ... dont know what they keep on doing on servers , charge like hell and service is so bad.