Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Export Active Products Only From Cs-Cart Rate Topic   * * * * * 1 votes

 
  • technoob
  • Senior Member
  • Trial users
  • Join Date: 08-Jun 15
  • 309 posts

Posted 09 December 2016 - 09:45 AM #1

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



 
  • BarryH
  • Senior Member
  • Members
  • Join Date: 03-Sep 07
  • 1459 posts

Posted 09 December 2016 - 10:20 AM #2

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


BarryH

 

CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19842 posts

Posted 09 December 2016 - 02:03 PM #3

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 10 December 2016 - 09:30 AM #4

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.


Warm Regards,
Admin | MVE: 4.2.4

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11425 posts

Posted 11 December 2016 - 09:19 PM #5

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • technoob
  • Senior Member
  • Trial users
  • Join Date: 08-Jun 15
  • 309 posts

Posted 12 December 2016 - 06:41 AM #6

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 ?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19842 posts

Posted 12 December 2016 - 08:30 AM #7

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

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11425 posts

Posted 12 December 2016 - 07:58 PM #8

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19842 posts

Posted 13 December 2016 - 06:43 AM #9

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11425 posts

Posted 13 December 2016 - 08:07 PM #10

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 14 December 2016 - 12:30 PM #11

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.


Warm Regards,
Admin | MVE: 4.2.4

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19842 posts

Posted 14 December 2016 - 02:11 PM #12

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?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 14 December 2016 - 02:53 PM #13

Please clarify what do you want to receive?

 

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


Warm Regards,
Admin | MVE: 4.2.4

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3848 posts

Posted 14 December 2016 - 04:17 PM #14

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



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11425 posts

Posted 15 December 2016 - 12:12 AM #15

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • fleaffair
  • Senior Member
  • Members
  • Join Date: 11-Jun 14
  • 537 posts

Posted 15 December 2016 - 05:03 AM #16

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.


Warm Regards,
Admin | MVE: 4.2.4