Export Active Products Only From Cs-Cart

How can we export only active products from the cs-cart , currently it exports all the products ( hidden / disabled as well. ) ?

Hi

Admin>Administration>Export Data>Products>select (right hand side) Product>Advance search>status>select (tick) gear wheel export selected

or

straight to admin>Products>Products>Advance search>status>select (tick) gear wheel export selected

Regards

Barry

Export all products, open in Excel, sort by Status, delete non-active items, save the result

Export all products, open in Excel, sort by Status, delete non-active items, save the result

We have more than 67K products and it takes too long for the export and all the products are never exported in single shot. Can we tweak the query somehow that always we can export the active products only while exporting.

Yes, you can use one of the hooks that retrieves product data. You would look at AREA == A && Registry::get('runtime.controller') == 'exim' and Registry::get('runtime.mode') == 'export' to determine whether to force the "param" for 'status' to be 'A'. You might also want to qualify it based on $_REQUEST['section'] == 'products' too.

Yes, you can use one of the hooks that retrieves product data. You would look at AREA == A && Registry::get('runtime.controller') == 'exim' and Registry::get('runtime.mode') == 'export' to determine whether to force the "param" for 'status' to be 'A'. You might also want to qualify it based on $_REQUEST['section'] == 'products' too.

Which file is this code in where we need to modify it ?

app/schemas/exim/products.php

replace:

    ‘condition’ => array(
‘use_company_condition’ => true,
),
with

    ‘condition’ => array(
‘use_company_condition’ => true,
‘conditions’ => array(‘status’ => ‘A’),
),
The clear cache and check

(!) Not tested

That is by far the simplest way though I would suggest you use a my_changes/schema/exim/products.post instead so that your changes are not overwritten on the next upgrade rather than modifying the distributed schema.

That is by far the simplest way though I would suggest you use a my_changes/schema/exim/products.post instead so that your changes are not overwritten on the next upgrade rather than modifying the distributed schema.

Totally agree. It is always better to use addons to add extra functionality. But not everyone familiar with modules

LOL, and not everyone's familiar with schmeas in general (they have great power but are undocumented and not all definitions apply to all the various types of entries)! I think we should all try to educate and help people do things in a way that they don't have to dig through year old posts/emails to find what they did to solve a problem they had before they upgraded to a newer version.

Maybe in cases like these we should post what to change in the standard schema (because we can provide context) and then suggest they do it in a posts.php file if they have knowledge.

Can you tell me how can we get the thumbnail path for a product if we use the below function

        fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_features' => true,'get_extra' => false, 'detailed_params' => false, 'get_options'=> true));

Changing 'get_icon' => true does not show any thumbnail values.

Can you tell me how can we get the thumbnail path for a product if we use the below function

        fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_features' => true,'get_extra' => false, 'detailed_params' => false, 'get_options'=> true));

Changing 'get_icon' => true does not show any thumbnail values.

Please clarify what do you want to receive?

Please clarify what do you want to receive?

Need the path of the thumbnail image of the product image.

Why not just use "Image URL" in the export list?

thumbnails are created dynamicall based on dimension. if you have a detailed image named images/detailed/8/xyz.png that is 600x400 and your have a page that wants a thumb in 200x150 then it will be created dynamically and live in images/thumbnails//200/500/detailed/8/xyz.png. That size for that detailed image will then be available and won't have to be recreated.

Cs-cart really needs to re-do their image handling. The whole concept of image pairs is irrelevant since they moved to dynamic thumbnails. All you need is Main and Alternate images.

I don't think all thumbnail sizes will be in the export since they are dynamically created. However, if you uploaded a 'thumbnail', then that image (which I think is now treated as a detailed image internally) then that path will be exported.

oh actually we were facing a problem where we wanted a smaller version / size of the actual image uploaded to show for a thumbnail so we needed the path of the image since we were planning to export it with the above function.