Indexation via cron on CS-Cart

You can run a cron job to do a full re-index. To do so, follow these steps:

  1. Install the Searchanise Enhancements module.
  2. Find the file app/addons/searchanise_enhancements/controllers/frontend/searchanise.pre.php and add the following code to it:
    if ($mode == 'async' &&
    !empty($_REQUEST['parent_private_key']) &&
    $_REQUEST['parent_private_key'] === fn_se_get_parent_private_key($_REQUEST['company_id'], DEFAULT_LANGUAGE) &&
    !empty($_REQUEST['full_reimport']) && $_REQUEST['full_reimport'] === 'Y'
    ) {
    fn_se_queue_import(NULL, NULL, true);
    }
    
  3. Ask your system administrator to set up the cron that will initiate the Searchanise indexation using the following command:
    /usr/bin/php %PATH_TO_CS_CART_ROOT_DIR%/index.php --dispatch=searchanise.async --full_reimport=Y --ignore_processing=Y
    

    Please make sure to replace %PATH_TO_CS_CART_ROOT_DIR% with the actual path to the CS-Cart root directory.

    %COMPANY_ID% – the company ID, which can be found in the CS-Cart admin panel. It appears in the URL when switching storefronts in the top-right corner of the admin panel.

    If you are using CS-Cart Ultimate with multiple storefronts, each storefront has its own engine.

    • If there is only one storefront, you can skip the --switch_company_id parameter.

    • If there are multiple storefronts, you need to add as many commands as there are storefronts, each with its corresponding ID.

    • Ignore the storefront with ID = 0.

    Updated on September 16, 2025

    How useful was this post?

    Click on a star to rate it!

    Average rating 5 / 5. Vote count: 1

    No votes so far! Be the first to rate this post.

    We are sorry that this post was not useful for you

    Let us improve this post!

    Please tell us how we can improve this post

    Related Articles

    Back to top