Adding shuffle functionality for Alex Branding addon

I have used Alex Branding product filling block on my blogs page. It is showing 12 products right now.
However, there are 500 products, but i am only able to see the same 12 products. I wanted to add a shuffle functionality to these 500 products and show 12 by shuffling.

First i just added

shuffle($product_ids);
inside fn_ab__product_fillings_get_search_products function inside func.php of this ab_product_filling addon. And returned shuffled products. But it shuffled only if i clear the cache.

Then, to disable the cache, i override blocks.php and blocks.functionality.php files by adding blocks.post.php and blocks.functionality.post.php files inside my my_changes/schemas/block_manager/ folder.
What i did:

$schema['products']['cache']['disable_cache_when']['callable_handlers'] = array(
    array('fn_block_disable_cache_for_your_filling', array('$block_data'))
);

return $schema;

inside blocks.post.php and then i also created a function inside blocks.functionality.post.php as following:

function fn_block_disable_cache_for_your_filling($block_data)
{
    // Disable cache for your filling type
    if (isset($block_data['content']['items']['filling'])
        && $block_data['content']['items']['filling'] == 'ab__pf_search'
    ) {
        return true;
    }

    return false;
}

But i am still not able to shuffle the products, did i miss smth here, can someone help me with that.
Thanks.

Hi!

Is this block’s filling is really ab__pf_search? I can only assume that the only place where this issue may be, is here, in $block_data['content']['items']['filling'].

if (!defined('BOOTSTRAP')) { die('Access denied'); }
$schema['products']['content']['items']['fillings']['ab__pf_search'] = [
'picker' => 'addons/ab__product_fillings/views/ab__pf_searches/components/picker/block_manager_picker.tpl',
'picker_params' => array(
'multiple' => false,
'view_mode' => 'external',
'show_positions' => true,
),
'settings' => array(
'limit' => array(
'type' => 'input',
'default_value' => 3
),
)
];

This i the default code inside the

app/addons/ab__product_fillings/schemas/block_manager/blocks.post.php

@CS-Cart_team did you see any problem here ?

Could you please check that the ab__pf_search option is selected for this block fillings?

Thanks for the screenshot!

Sorry, but I don’t see any issues here. Your case requires debugging.

The last thought I have on this case, is that some other add-on with higher priority, overrides the value of $schema['products']['cache']['disable_cache_when']['callable_handlers'] in this scheme.