Product Blocks in Product Pages displaying wrong Items

Having an issue where our product has a block to the right assigned with related items manually in the blocks section in the product editor page



So we should have



PRODUCT A PAGE

Has block with

ASSOCIATED PRODUCT A1

ASSOCIATED PRODUCT A2

ASSOCIATED PRODUCT A3

ASSOCIATED PRODUCT A4



and

PRODUCT B PAGE

Has block with

ASSOCIATED PRODUCT B1

ASSOCIATED PRODUCT B2

ASSOCIATED PRODUCT B3

ASSOCIATED PRODUCT B4





But instead we are getting



PRODUCT A PAGE

Has block with (RANDOM LIST FROM ANOTHER PRODUCT)

ASSOCIATED PRODUCT B1

ASSOCIATED PRODUCT B2

ASSOCIATED PRODUCT B3

ASSOCIATED PRODUCT B4





Anyone any ideas? Cross selling items related is huge for us, so this is pretty important



we’re using 2.1.2 Professional



Thanks



Stephen

Also the Random list changes Randomly to another list,



This doesnt affect all products in the store only certain ones



I’ve done a database check and all appears ok

I’m having the same issue. At first the block is missing. Then if I deactivate then reactivate, the wrong products are in the block… it seems to be showing the same products for the same block, even though the products assigned are different. After a while the block disappears again. Clearing cache and smart optimizer, and optimizing database does nothing. Unfortunately restoring the database is not an option because I didn’t notice this for 24 hours. If I restore i will lose orders. This happened after I upgraded and downgraded again. Any thoughts?

[quote name=‘djstevie84’]Also the Random list changes Randomly to another list,



This doesnt affect all products in the store only certain ones



I’ve done a database check and all appears ok[/QUOTE]



Hello djstevie,



In order to fix this bug replace the following part of code:



if (!empty($property['update_params']['auth'])) {
foreach ($property['update_params']['auth'] as $param) {
$param = strtolower(str_replace('%', '', $param));
if (isset($_SESSION['auth'][$param])) {
$update_params_condition .= '|' . $param . '=' . $_SESSION['auth'][$param];
}
}
}
}
}
}
}
fn_set_hook('smarty_function_block_output_pre_cache', $_block_data, $smarty, $use_cache, $update_handlers, $update_params_condition);
if ($use_cache == true) {
//update handlers for data function




with this one:



if (!empty($property['update_params']['auth'])) {
foreach ($property['update_params']['auth'] as $param) {
$param = strtolower(str_replace('%', '', $param));
if (isset($_SESSION['auth'][$param])) {
$update_params_condition .= '|' . $param . '=' . $_SESSION['auth'][$param];
}
}
}
}
}
}
if (!empty($_block_data['item_ids'])) {
$update_params_condition .= '|' . 'item_ids' . '=' . $_block_data['item_ids'];
}
}
fn_set_hook('smarty_function_block_output_pre_cache', $_block_data, $smarty, $use_cache, $update_handlers, $update_params_condition);
if ($use_cache == true) {
//update handlers for data function




in the “function.block.php” file, located in the “core/templater_plugins” directory.



Thank you.