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. Create the app/addons/searchanise_enhancements/addon.xml file and fill it with the following code:
    <?xml version="1.0"?>
    <addon scheme="3.0">
        <id>searchanise_enhancements</id>
        <version>1.0.1</version>
        <priority>5000</priority>
        <position>10</position>
        <status>active</status>
        <has_icon>Y</has_icon>
        <supplier>Searchanise</supplier>
        <default_language>en</default_language>
    </addon>
    
  1. Copy thedesign/backend/media/images/addons/searchanise/icon.png file and paste it into the design/backend/media/images/addons/searchanise_enhancements/ folder;
  2. Create the var/langs/en/addons/searchanise_enhancements.po file and fill it with the following code:
    msgid ""
    msgstr "Project-Id-Version: tygh\\n"
    "Content-Type: text/plain; charset=UTF-8\\n"
    "Language-Team: English\\n"
    "Language: en_US"
    msgctxt "Addons::name::searchanise_enhancements"
    msgid "Searchanise enhancements"
    msgstr "Searchanise enhancements"
    msgctxt "Addons::description::searchanise_enhancements"
    msgid "Provides enhancements from Searchanise team"
    msgstr "Provides enhancements from Searchanise team"
  1. Go to the Add-ons > Manage add-ons menu in the CS-Cart admin panel and install the Searchanise Enhancements add-on;
  2. After the Searchanise Enhancements add-on is installed, create the app/addons/searchanise_enhancements/controllers/frontend/searchanise.post.php file and fill it with the following code:
    <?php
    /***************************************************************************
    *                                                                          *
    *   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
    *                                                                          *
    * This  is  commercial  software,  only  users  who have purchased a valid *
    * license  and  accept  to the terms of the  License Agreement can install *
    * and use this program.                                                    *
    *                                                                          *
    ****************************************************************************
    * PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
    * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
    ****************************************************************************/
    defined('BOOTSTRAP') or die('Access denied');
    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);
    }
  1. After all previous steps are finished, you can set up 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.

Updated on February 24, 2025

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

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