Listing Hidden Products In Sitemap

Hi,

I would like to list hidden products in sitemap.xml however I wasn't able to get fn_get_products in app/addons/google_sitemap/func.php cooperate with me.

I tested $params['status'] = "A,H" and couple of other variations but I'm not getting anywhere.

How can I list both Active and Hidden products?

Thanks in advance.

The main reason is that available statuses for the store-front are hardcoded in the fn_get_products function.

Try to open the app/addons/google_sitemap/func.php file and replace:

$params['area'] = 'C';

with

$params['area'] = 'A';
$params['status'] = array('A', 'H');

(!) Not tested

The main reason is that available statuses for the store-front are hardcoded in the fn_get_products function.

Try to open the app/addons/google_sitemap/func.php file and replace:

$params['area'] = 'C';

with

$params['area'] = 'A';
$params['status'] = array('A', 'H');

(!) Not tested

Dears

I tired this one but didn't work

Please can anyone help us here , Appreciated

After the changes are applied, try to regenerate Sitemap using the special button in the addon settings:

http://prntscr.com/9kaqqt

eComLabs, I appreciate the help, you guys are great help here on the forum.

Looks like this solution only applies to 4.3.x I'm currently at 4.2.x and I don't see

$params['area']

variable in func.php

Yousefse, what's your CS-Cart version? Did you have this variable in your version?

Thanks

eComLabs, I appreciate the help, you guys are great help here on the forum.

Looks like this solution only applies to 4.3.x I'm currently at 4.2.x and I don't see

$params['area']

variable in func.php

Yousefse, what's your CS-Cart version? Did you have this variable in your version?

Thanks

Dear i have 4.3.x and still did not work, and i tried to regenerate the sitemap but unfortunately nothing happened

If you provide us with the temporary FTP access, our specialists can check the issue

If you provide us with the temporary FTP access, our specialists can check the issue

Dear thanks for your cooperation

I have sent it via private message. Waiting for your advice.

Thanks

Fixed!

Fixed!

Dears

Thank you very much it works perfectly, can you share how you did it in case other users wanted the same

Again thank you for your help

Sure

app/addons/google_sitemap/func.php

replace:

        $params['area'] = 'C';
    $original_auth = $_SESSION['auth'];
    $_SESSION['auth'] = fn_fill_auth(array(), array(), false, 'C');

    fn_set_progress('step_scale', db_get_field("SELECT COUNT(*) FROM ?:products WHERE status = 'A'"));

    while ($params['pid'] = db_get_fields("SELECT product_id FROM ?:products WHERE status = 'A' ORDER BY product_id ASC LIMIT $i, $total")) {

with:

        $params['area'] = 'A';
        $params['status'] = array('A', 'H');
    $original_auth = $_SESSION['auth'];
    $_SESSION['auth'] = fn_fill_auth(array(), array(), false, 'C');

    fn_set_progress('step_scale', db_get_field("SELECT COUNT(*) FROM ?:products WHERE (status = 'A' || status = 'H')"));

    while ($params['pid'] = db_get_fields("SELECT product_id FROM ?:products WHERE (status = 'A' || status = 'H') ORDER BY product_id ASC LIMIT $i, $total")) {

Thank you very much dear for helping and working to benefit all users ;)

You are welcome!