@Tsimi
...you put the "bro" in Lambros
😀
yeah man, ..that's exactly what I was trying to achieve and I'm not very good with SQL. Thank you for the help. I just tested this mod and it works as it should. If you want, you can add it to the next update release.
Ok, so here is the complete mod to only show the "See More" button when the number of Featured Products exceeds the content limit set in admin for the particular module.
I'm just going to use the index module for this sample, and this is for BS Edge. I'm not sure if there is a difference with other versions.
/index/modules/content/index/cm_i_featured_products.php
1) FIND this code:
if (tep_db_num_rows($featured_products_query) > 0) { // Show only if we still have products in the array
ADD just ABOVE it:
// this will show/hide the "See More" button
$fp_count_query = tep_db_query("select count(*) as total from featured WHERE status = '1'");
$fp_count = tep_db_fetch_array($fp_count_query);
$fp_btn = 'style="display:none;"';
if ($fp_count['total'] > MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_CONTENT_LIMIT) {
$fp_btn = 'style="display:inline;"';
}
2) FIND this code:
$featured_products_content = '<h3>' . ($cat_name != '' ? sprintf(MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_CATEGORY_TITLE, $cat_name) : MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_TITLE . ((MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_SHOW_BUTTON == 'True')? ' ' . tep_draw_button(MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_IMAGE_BUTTON_SEE_MORE, 'glyphicon glyphicon-triangle-right', tep_href_link('featured_products.php'), 'primary', null, 'btn-default btn-sm'):'')) . '</h3>';
REPLACE it with this:
$featured_products_content = '<h3>' . ($cat_name != '' ? sprintf(MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_CATEGORY_TITLE, $cat_name) : MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_TITLE . ((MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_SHOW_BUTTON == 'True')? ' <span ' . $fp_btn . '>' . tep_draw_button(MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_IMAGE_BUTTON_SEE_MORE, 'glyphicon glyphicon-triangle-right', tep_href_link('featured_products.php'), 'primary', null, 'btn-default btn-sm') . '</span>':'')) . '</h3>';