Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/28/2018 in all areas

  1. 2 points
    Demitry

    Featured Products BS

    @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')? '&nbsp;&nbsp;<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>';
  2. 1 point
    Jack_mcs

    View Counter

    I don't know what might be causing that problem. Normally, if there is a problem like this, it is the other way around - the shop can be seen but not the admin. Please make sure the code changes have been made to the shops application_top.php file. And check both configure files to make sure the STORE_SESSIONS setting is set the same. You might also want to check what php version is being used. This addon should work with 7.0 but I haven't tested it above that. Other than those, I can't think of what else it might be. It would require troubleshooting at that point.
  3. 1 point
    Tsimi

    Featured Products BS

    @Demitry Ok, I had a look at my specials code and it is not what you are looking for. Actually it is same as the see more button currently inside the Featured Products BS add-on. But I started to do some research and found a solution. It was easier than I thought. You need to use a select count(*) query to get the current total amount of featured products and you only want to get the ones that are set to f.status 1 So this is what I came up with Open your index module featured file FIND: if (tep_db_num_rows($featured_products_query) > 0) { // Show only if we still have products in the array ADD BEFORE: $featured_count_query = tep_db_query("select count(*) as total from featured WHERE status = '1'"); $featured_count = tep_db_fetch_array($featured_count_query); Now you can use this here to hide/show the button. if ($featured_count['total'] > MODULE_CONTENT_INDEX_FEATURED_PRODUCTS_CONTENT_LIMIT) { BUTTON CODE HERE } Let me know if that works for you.
×